ClassNotFoundException if ejb jar file is not placed in the server's classpath

Hi,
My ejb jar file contains some non-weblogic generated files and is placed in
the applications directory. When client is executed, I get the ClassNotFoundException
on the server when my bean makes a reference to the generated class. The problem
gets resolved if I put the ejb jar in the server's classpath.
This problem happens in weblogic server version 6.1. It was not happening in
the previous releases of weblogic server(6.0).

Well
I follow your instruction
I am pasting the command prompt operation
Coding is same above
My all three files (.java )is resides in javath folder
command prompt code
Z:\javath>javac -d . sa.java
Z:\javath>javac -d . sb.java
Z:\javath>jar -cvf p1.jar p1/*.class
added manifest
adding: p1/sa.class(in = 687) (out= 423)(deflated 38%)
adding: p1/sb.class(in = 185) (out= 153)(deflated 17%)
Z:\javath>javac demopack.java
demopack.java:4: cannot access sb
bad class file: .\sb.java
file does not contain class sb
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
public class demopack implements sb
                                 ^
1 error
Z:\javath>------------------------------------------------------------
in demopack.java file i want to access class files which are resides in
jar files
Actually when we are writing import java.io.*;
we can access all the class file from that io package
Same thing i am trying to implement for user defined package
I hope you understand my question
regards

Similar Messages

  • How to load .jar files when not specified in the .jnlp file

    Hello,
    We are deploying an application with JWS but due to the nature of this app, we need to download additional jar file only when the user has been authenticated. The jar file(s) we need to download can hardly be predicted (in term of name) and thus cannot be all listed as lazzy resource in the .jnlp file.
    However, we would like to take advantage of the various JWS features relateed to .jar download and cache and would prefer not to reinvent the wheel by implementing our on stuff (i.e. URLClassLoader with caching etc.).
    Any idea, suggestion?
    Thanks in advance.
    Fred.

    How about writing a second jnlp file with the optional jar listed in it and running it only if your user is authenticated?

  • Trigger email if source file i not placed at the src folder every morning

    Hi All.
    I have a file to rfc scenario... the file is place at the source folder every morning...
    If the file is not place can we trigger an alert? or email?
    I was thiking of adapter scheduling but in case the file is not persent will it send an alert?
    PLs share ur thoughts..

    There is an ongoing discussion about this. See my reply here:
    Want email notification for fail cases
    Regards,
    Prateek Raj Srivastava

  • No EJBs found in the ejb-jar file

    Hello all, we are thinking about migrating from JBoss to WebLogic server, so as a proof of concept I am trying to migrate a JBoss Seam web application to WebLogic server.
    I have followed all the instructions here: http://docs.jboss.org/seam/2.0.2.SP1/reference/en-US/html/weblogic.html and I have set up ebvryhting that is needed in order to start the server (JMS queues, datasources, etc) but when the server starts and tries to load the web application I got the following error message
    <29 ═Ύί 2010 4:34:51 ΉΉ EET> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'myapplication-ear' due to error weblogic.application.ModuleException: Exception preparing module
    : EJBModule(MyApplication.jar)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    No EJBs found in the ejb-jar file 'MyApplication.jar'. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with t
    he @Stateless, @Stateful or @MessageDriven EJB annotation...
    weblogic.application.ModuleException: Exception preparing module: EJBModule(MyApplication.jar)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    No EJBs found in the ejb-jar file 'MyApplication.jar'. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with t
    he @Stateless, @Stateful or @MessageDriven EJB annotation..
    at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:467)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
    Truncated. see log file for complete stacktrace
    Caused By: java.io.IOException: No EJBs found in the ejb-jar file 'MyApplication.jar'. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at l
    east one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation.
    at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:219)
    at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
    at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1242)
    at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:395)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
    Truncated. see log file for complete stacktrace
    The MyApplication.jar is where we keep all the models and we are using an exploded folder for the ear file. We have declared all the classes to be entities by using the @Entity and @Table annotations and we have also defined an interceptor in the ejb-jar.xml file (shown below).
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
    version="3.0">
    <interceptors>
    <interceptor>
    <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
    </interceptor>
    </interceptors>
    <assembly-descriptor>
    <interceptor-binding>
    <ejb-name>*</ejb-name>
    <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
    </interceptor-binding>
    </assembly-descriptor>
    </ejb-jar>
    I have tried to compile everythign from scratch by using weblogic.appc but I am getting the same error: No EJBs found in the ejb-jar file 'ejbModule'. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation.
    Any ideas what is going on and how I can resolve the issue?
    Regards
    Panos
    Edited by: 816483 on 29 Νοε 2010 6:53 πμ

    Hi John,
    I am working on development an enterprise application using EJB 3.0 on Weblogic 10.
    While developing, I am keeping all my classes (from ejb's as well as web) into APP-INF/classes directory. It is working fine for Web and ejb 2.0 packages, but ejb 3.0 packages, I get the following error when I keep my ejb 3.0 beans classes in APP-INF/classes directory.
    No EJBs found in the ejb-jar file 'customer'. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation.
    One solution is to keep the classes under customer ejb directory, but I wan tto keep all the classes in APP-INF/classes directory so that when using Eclipse IDE I can output all compiled sources into APP-INF/classes directory.
    Has anyone faced this situation? Any suggestions to fix this issue?

  • Cannot build EJB jar file in NWDS

    hello,
    I changed java beans file, and tried to build jar file again, then the "build EJB archive" context menu is disabled so I can not make EJB jar file!
    So frustrated.. NWDS recognizes the changes in the java files , right? How come there 's no Build menu..
    Is there any pre-requisite to enable the menu?
    I have no idea how I can build jar file..
    Please give me a advice.. Thanks~!

    You might check the weblogic.developer.interest.ejb.tools new group.
    Make sure that the tool doesn't leave this ejbcgen directory around. It
    should delete
    that temp dir. When it doesn't it keeps all the old generated stuff around
    and your changes won't be
    reflected in the new jar.
    Rodrigo Ruiz Aguayo <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I have a problem with the EJBDeployerTool. When I want to update
    a class file (for example, because I corrected any problem), the
    deployer tool doesn't update the file correctly. It keeps the
    old version of the class file.
    In order to update a jar I have to copy the newer version in the
    .ejbdeployer/provider-projects directory by hand. Is it a bug?
    Is there any other way to do this? We are wasting too much time
    in this task, instead of programming :_(
    Thanks in advance,
    José Rodrigo Ruiz Aguayo e-mail : [email protected]
    I.T. en Informática de Sistemas webpage : ---------------------
    "Simulation is perfect, whenever we're not talking about reality"

  • Problem building EJB jar file using Eclipse

    Hi,
    Here's my file sturcture.
    ejb\x\y\z\test\
    ejb\x\y\z\test1\
    'ejb' is the root directory.
    The java source files under 'test' have a package name x.y.z.test.
    The java source files under 'test1' have a package name x.y.z.test1.
    I want to build a EJB jar file for 'test' and 'test1' separately. In eclipse when I create an EJB project, I specify the root folder as the source in the java build path settings. So the project explorer in Eclipse shows both the packages since they are under the same root folder. When I try to do 'Export - EJB Jar File', it includes both the 'test' and 'test1' in the .jar. Is there a way to build them separately ?
    Thanks,

    As far as I know, there is no way in Eclipse to specify a package prefix for a source folder. Assuming that you are not using an operating system with support for symbolic links at FS-level, the only way I can think of solving your problem is via linked folders and includes/excludes.
    1. Create two ejb projects in your workspace. Specify locations somewhere independent of where the root of your source tree is located.
    2. Right click on proj1 and select Properties / Java Build Path / Source.
    3. Click Link Source and specify the location to your source root on disk. Click Next.
    4. In the inclusion patterns section, add a pattern that captures classes appropriate for that module. Click Finish.
    5. Delete the original source directory that was created during project creation before leaving Build Path configuration dialog.
    6. Repeat steps 2-5 on the second project, except specify a different inclusion pattern.
    This should produce a project structure that Eclipse will be happy with, but you have to be a little bit careful. Even though you filtered out classes from the view of the java compiler for a particular project, you will still see them listed in the various navigational views (such as Package Explorer or Project Explorer). Don't modify these filtered out files. The project that is supposed to be building them will not react to changes in the other project. You will have to manually refresh (right click on project and select refresh) the other project before the java compiler will see changes.
    Hope this will help you out.
    - Konstantin

  • Deployment error when using several ejb-jar files

    Hello All,
    I am having problems with deployment of my J2EE application. My EAR file has several EJB-JARs, one for each entity bean. However I refer to the other EJBs in one EJB. Hence I included the <ejb-ref> element in the deployment descriptor of the entity bean. But I am getting the deployment error that "the bundle does not contain the bean name". I tried to change the <ejb-name> value (within the <ejb-ref> element) to the JNDI name of the EJB I am referring to, and also added the <ejb-link> tag specifying the location of the JAR file that has the EJB. None of the attempts worked.
    Can someone help me out on how I am supposed to go about when I have several ejb-jar files as opposed to a single one? I am deploying my app on Sun ONE AS 7.0.
    Thank you,
    PS: I am posting this message on several forum topics. Please disregard this message if you have seen/answered this message. Thanks.

    Hello,
    Thanks for the response. I have got both Local and Remote EJB References, but for the JAR (where the ejbc compiler stopped) that I have an error, it is the local reference.

  • Updating an EJB jar file on WL7.0

    Hi
    Iam attempting to update an EBJ jar file without taking down my WL7.0 server.
    When I copy the jar file to the applications directory, I see the server accepting
    the update but when I run my client the update is not visible! Iseem to be still
    accessing the old ejb.
    From my understanding, if the server is running in development mode I should be
    able to copy the jar file with my update directly to the applications directory(
    overwriting old jar file) and be able to access the udated ejb.

    Hello Ron,
    An alternative would be to modify a REDEPLOY file if your application is deployed
    in exploded directory format. However, updating the EJB JAR should also do the
    trick. Try going into the Admin console and explicity redeploying the EJB JAR
    file after copying over the new JAR file. Let us know if any errors appear.
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Ron Turner" <[email protected]> wrote:
    >
    Hi
    Iam attempting to update an EBJ jar file without taking down my WL7.0
    server.
    When I copy the jar file to the applications directory, I see the server
    accepting
    the update but when I run my client the update is not visible! Iseem
    to be still
    accessing the old ejb.
    From my understanding, if the server is running in development mode I
    should be
    able to copy the jar file with my update directly to the applications
    directory(
    overwriting old jar file) and be able to access the udated ejb.

  • Deployment problems when using several ejb-jar files

    Hello All,
    I am having problems with deployment of my J2EE application. My EAR file has several EJB-JARs, one for each entity bean. However I refer to the other EJBs in one EJB. Hence I included the <ejb-ref> element in the deployment descriptor of the entity bean. But I am getting the deployment error that "the bundle does not contain the bean name". I tried to change the <ejb-name> value (within the <ejb-ref> element) to the JNDI name of the EJB I am referring to, and also added the <ejb-link> tag specifying the location of the JAR file that has the EJB. None of the attempts worked.
    Can someone help me out on how I am supposed to go about when I have several ejb-jar files as opposed to a single one? I am deploying my app on Sun ONE AS 7.0.
    Thank you,
    PS: I am posting this message on several forum topics. Please disregard this message if you have seen/answered this message. Thanks.

    Hi ,
    It would help if you could post the relevant snippets of your
    ejb-jar.xml. In general, you definitely shouldn't use jndi-name
    for any of the linking information. jndi-name is not part of the
    standard deployment descriptor. The syntax for the ejb-link is
    [ejb-jar uri]#ejb-name
    K

  • Unable to create ejb.jar file.

    how do we create an ejb.jar file in j2ee explorer.
    I am not able to see the option <i>Build Ejb.jar</i>
    in the context menu when i click on my ejb project
    Regards
    Naresh Garg

    hi Naresh,
    There is option called EJB Archive this option builds your EJB. if your trying to create Web Module Project you can only create WAR file .
    Venkat

  • Jar file is not cached

    Hi,
    I have a problem in caching the jar file. When the browser was closed and then open again, it tries to load the jar file from the web server again. It seems the jar file is never cached in the Java-Plug in. Here is the code for the page:
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width=80% height=70% hspace="10" vspace="10" align="middle"
    codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab"
    standby="Please wait...">
    <PARAM name="type" value="application/x-java-applet">
    <PARAM name="codebase" value="/">
    <PARAM name="cache_archive" value="w1.jar">
    <PARAM name="cache_option" value="Plugin">
    <PARAM name="code" value="Proteus.class">Web Motion Control Applet</OBJECT>
    Any idea?
    Thanks for the help!

    Have the same nasty issue here - beginning with 1.4.2 we see that the java plug-in add
    Cache-Control: no-cache
    Pragma: no-cache
    to the HTTP request when downloading the JAR file (also happen when JAR is already in local plug-in cache). Therefore the web server always sends a HTTP 200 with full content instead of a lightweight HTTP 304 Not Modified.
    See also: Bug: 4837340 comment from mwwsun
    Is there a way to disable the explicit "no-cache" request?
    Keep the byte.
    C�dric

  • Jar file is not being creating

    Dear Members,
    My problem is that: I am using a serialized class in my project.( i.e. I created another project, I made up a serialized class in this this project And I compiled this project. Later I added this project to my actual/first project' s library folder for using this seralized class.) After I disposed my actual project. I builded it for creating a jar file. But any jar file is not falling out (I am using NetBeans) Could you help me please to solve this problem?
    Thank you for taking the time...
    Regards,

    Dear Members,
    My problem is that: I am using a serialized class in my project.( i.e. I created another project, I made up a serialized class in this this project And I compiled this project. Later I added this project to my actual/first project' s library folder for using this seralized class.) After I disposed my actual project. I builded it for creating a jar file. But any jar file is not falling out (I am using NetBeans) Could you help me please to solve this problem?
    Thank you for taking the time...
    Regards,

  • Jar file could not find main class.. I cant see why?

    I have read loads of tutorials on this and it should be very straight forward but i STILL cant make a working jar file of my program.. please see if you can see anything wrong with what im doing..
    my program is one .java file that compiles perfectly, and is runnable both through eclipse and by using the command prompt.. i made a jar file using both eclipse and the command prompt, and neither worked.. every time i run it by double clicking it i get the error "could not find main class, program will exit". here is the contents of my jar:
    CorePackage\IPEmailer.class
    CorePackage\IPEmailer$1.class
    CorePackage\IPEmailer$SMTPAuthenticator.class
    META-INF\MANIFEST.MF
    the MANIFEST.MF file contains:
    Manifest-Version: 1.0
    Class-path: .
    Created-By: 1.6.0_02 (Sun Microsystems Inc.)
    Main-Class: CorePackage.IPEmailer
    (yes there is a blank line at the end)
    the class mentioned in 'Main-Class' has a main method that looks like this:
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        new IPEmailer();
    }the program uses 2 external jar files:
    activation.jar
    mail.jar
    and reads a file called:
    ipemailer.ini
    and writes a file called:
    ip.txt
    the program has no GUI and is intended to run 'silently' in the background
    please help me understand what is wrong with this

    package CorePackage;
    import javax.mail.*;
    import javax.mail.Authenticator;
    import javax.mail.PasswordAuthentication;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class IPEmailer implements Runnable{
          * @param args
         String recipientsinput[]={""};
         String subject;
         String body;
         String server;
         String user;
         String pass;
         String from;
         String urlString = "http://www.whatismyip.org";
         String currentIP;
         String ipFromFile;
         boolean webFailed;
         long interval = 900000; //15 mins
         long oldInterval;
         Thread t = new Thread(this);
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              new IPEmailer();
         public IPEmailer(){
                         ..........etccould the problem be that the class is a thread? i cant see why it would be, but ive never made a jar where the main class also 'implements runnable'

  • JAR file does not get uploaded to client for my SERVLET generated APPLET

    Some help please...
    I have a servlet that generates the HTML code that contains an APPLET. This APPLET needs a JAR file that is listed under its ARCHIVE property. The SERVLET is in a JAR file that is in the same directory as the other needed JAR file. If I create a static HTML with the output of the SERVLET it works fine. But if go through Weblogic the needed JAR file does not get uploaded to the client so I get a java.lang.NoClassDefFoundError:and my APPLET does not load.
    Q1: I am not sure what to put under the CODEBASE tag. I tried "." and I also tried "http://mymachine" but both did not work. I also tried without the CODEBASE tag. No luck. The SERVLET is bound to http://mymachine/servlet.
    Q2: Does anyone have any suggestions on how to do this? Is there a way to force the browser to upload a certain JAR file?
    Thanks...

    It works!!
    This is what I did:
    The jar file in question was the weblogic.jar. I tried putting it under the lib directory of my war file but I had problems because the weblogic.jar contains other war files inside so when I tried to deploy my war file it also tried to deploy the inner war files which for some reason did not work. So I tried removing the war files from the weblogic.jar and this time I had no problems deploying my war file but I still could not find the classes I needed. So I tried moving the weblogic.jar to the root dir of my war file and it worked!! Now the trick here was: I did not set the CODEBASE AND I had the ARCHIVE paramenter set in TWO places like below:
    <APPLET CODE = "marketmap.client.MarketMapApplet"
    ARCHIVE = "weblogic.jar"
    WIDTH = "657"
    HEIGHT = "382"
    ALIGN = "BOTTOM"
    ALT = "APPLET tag not recognized">
    </XMP>
    <PARAM NAME = CODE VALUE = "MyApplet" >
    <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.2.2">
    <PARAM NAME = "scriptable" VALUE="false">
    <PARAM NAME = ARCHIVE VALUE="weblogic.jar">
    </APPLET>
    Actually if you do not place a parameter named ARCHIVE (at the end) it wil NOT work. I tried with multiple jar files listed and it works great too.
    Anyway I figure I'd share. Thanks for the help too.
    Lastly for people who choose not to upload the jar files to clients, you should look at the bea documentation on applets. It lists a classpath servlet that allows you to provide classes to the clients without having to force them to download the jar file.

  • Error: JAR-Ressources in JNLP-File are not signed from the same Certificate

    I have two handfull jars, all signed in batch with the same
    Certificate. When i start my App with Webstart it tells me:
    Your JAR-Ressources in JNLP-File are not signed from the same Certificate.
    "JAR-Ressourcen in JNLP-Datei sind nicht von demselben Zertifikat signiert"
    Well im shure that i signed all my jars with the same Certificate.
    What can i do to solve this problem ???

    I get the same error.
    Strangely exactly every second time it works and every second time I execute the JNLP I get the following error:
    network: Cache-Eintrag nicht gefunden [url: http://localhost:8080/fibo/lib/js_15R41.jar, Version: null]
    network: Verbindung von socket://127.0.0.1:3621 mit Proxy=DIRECT wird hergestellt
    #### Java Web Start Error:
    #### JAR-Ressourcen in JNLP-Datei sind nicht von demselben Zertifikat signiertCan this have something to do with browser caching? So that every 2nd time it tries to access the cache, fails. And than ignores the cache and works?
    Any ideas?
    Cheers,
    Rio

Maybe you are looking for

  • IPod randomly freezes when playing tunes

    My Ipod 30gb randomly freezes during a song. Sometimes it freezes for a few seconds and sometimes it can freeze for a couple of minutes. It then just carries on playing. It is not always the same song and can include songs purchased from Itunes as we

  • Photoshop CC 2014 Crashes on Startup

    Hi, i have just finishing installing Adobe CC 2014, all application works perfect beside Photoshop.. one opening the software it crashes down and i dont know what seems to be the problem.. i am using MS Windows 8.1 64bit. once entering the Event Log

  • Jpeg shows up when previewing in safari, but not when viewed after uploading to browser. CS5

    Hi, I'm afraid I don't know the jargon as someone else has set this up for me and I just make new pages based on the templates. But I've just uploaded 9 new pages all with 9 small images linked to the corresponding 9 large images. All of them work ex

  • How to display and type in Chinese on BB bold 9000?

    Hey, I'm a new user of BB bold 9000. Just bought the phone from the states, which was distributed by AT&T and it is unlocked. I have tried couple times by following this post: http://supportforums.blackberry.com/t5/BlackBerry-Curve-BlackBerry-8300/Ch

  • Add functional location in asset master

    Dear Friends, I need to add field 'Functional Location - TPLNR' in asset master data. I find the field TPLNR in table ANLZ but it is not displayed in Asset Master. Kindly help me understand how can I assign functional location to asset master. Regard