J2ee jar extension mechanism

I use bea weblogic as webserver
In my application directory there are 2 jar file: test0EJB.jar and test1EJB.jar
Inside the first jar there is one ejb: test0, package of test0 is print0
Inside the second jar there is one ejb: test1, package of test1 is print1
test0 call some method from test1 (not vice versa)
Inside test0EJB.jar there are 2 xml file: ejb-jar.xml and weblogic-ejb-jar.xml
this is ejb-jar.xml:
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<description></description>
<ejb-name>test0</ejb-name>
<home>stampa0.test0Home</home>
<remote>stampa0.test0</remote>
<ejb-class>stampa0.test0EJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref>
<ejb-ref-name>test1</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>stampa1.test1Home</home>
<remote>stampa1.test1</remote>
</ejb-ref>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>test0</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
this is weblogic-ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>test0</ejb-name>
<stateless-session-descriptor></stateless-session-descriptor>
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>test1</ejb-ref-name>
<jndi-name>test1</jndi-name>
</ejb-reference-description>
</reference-descriptor>
<jndi-name>test0</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Inside META-INF directory in test0EJB.jar there is this manifest.mf:
Manifest-Version: 1.0
Created-By: 1.3.0_01 (WebGain, Inc.)
Class-Path: test1EJB.jar
When i execute my client, test0 work but when he call tes1 i have this error:
java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.NoClassDefFoundError: print1/test1Home
I can't put the 2 jar file in one ear file
Anybody can help me?

Pack your EJBs into an EAR (with any common jars) and deploy the ear.
I had a working example with Weblogic 7.0, built the EAR with ANT
and from the build.xml file I have copied the following comment, that might clarify things a bit.
In this case oevCalculators_common.jar was the common JAR, which was used by oevCalculators_server.jar. The expansion of the server.jar in my example is a snippet of the content of the jar within the EAR, you should not see a structur like that if you open the final EAR with Winzip.
EAR:
+--META-INF
|  +--Manifest.MF
|  +--application.xml
+--oevCalculators_common.jar <----------------------+
+--oevCalculators_server.jar                        |
   *--META-INF                                      |(refers to)
   |  *--Manifeast.MF                               |
   |       CLASS-PATH: oevCalculators_common.jar ---+
   *--com

Similar Messages

  • Extension mechanism

    I have developed an applet which uses some utility classes bundled in a jar file. I didn't want the user however to have to download the utility classes in the jar file every time he wanted to use the applet so I thought of making it an optional package. Thus I used the extension mechanism so that the first time the user downloaded the applet he could install the utility jar file as an extension.
    The problem that occured is this: From a utility class I load some images to display on the applet. The images reside within the utility jar file so I use the following code to load them:
    1:     URL url = this.getClass().getResource(imageName);
    2:     ImageIcon imageIcon = new ImageIcon(url);
    When I didn't use the extension mechanism there was no problem!
    When I did use extensions though a Null Pointer Exception was thrown
    at line 2. Obviously the url is null.
    This seems pretty strange to me because the image is loaded from within the jar file and the jar file has been downloaded (and installed). So what is the problem?
    Any help would be appreciated.

    You are using a JVM that supports the extension
    mechanism, I hope? Not the Microsoft JVM that comes
    with Internet Explorer, for example? If so, then
    perhaps you don't know where the extensions directory
    really is. The system property "java.ext.dirs" (I
    think) will tell you where it really is.
    Having gone through this, you may want to rethink your
    original idea that it would be more convenient for the
    user to download and install the jar file. If you had
    this much trouble, how easy would it be for somebody
    else?Hey there,
    Wonder if you could help me sort something out while you're at it. In my older WIN95 OS I put my extension .jar files - if I remember right - in, say, C:\jdk1.3.1_03\jre\lib
    . . . and things worked fine.
    I just upgraded to XP and I added my extensions to both C:\jdk1.3.1_03\jre\lib & C:\Program Files\JavaSoft\JRE\1.3.1_03\lib\ext
    . . . It finds the files fine, but my .jar files - that have in them some of the same files as in my extension .jar - are faultering. I'm trying to figure out if I need to add the CLASSPATH to my SYSTEM | ENVIRONMENTAL variable, or to my .jar applications. You have any ideas?
    Thanks in advance;
    ~Bill

  • JRE 7 update 51 and the extension mechanism

    I've developed an applet that uses Java extension mechanism to install an extension package. Both JARs are signed, and I have put this in the manifest:
    Permissions: all-permissions
    Codebase: *
    Application-Library-Allowable-Codebase: *
    Caller-Allowable-Codebase: *
    It works fine with the JRE 1.7 update 45, but with the last version of the JRE (1.7 update 51), I get the following error (NullPointer):
    java.lang.NullPointerException
      at com.sun.deploy.security.DeployManifestChecker.verifyCodebase(Unknown Source)
      at com.sun.deploy.security.DeployManifestChecker.verifyApplicationLibraryAllowableCodebase(Unknown Source)
      at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
      at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
      at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
      at sun.plugin.extension.ExtensionInstallationImpl.verifyJar(Unknown Source)
      at sun.plugin.extension.ExtensionInstallationImpl.access$100(Unknown Source)
      at sun.plugin.extension.ExtensionInstallationImpl$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.plugin.extension.ExtensionInstallationImpl.installExtension(Unknown Source)
      at sun.misc.ExtensionDependency.installExtension(Unknown Source)
      at sun.misc.ExtensionDependency.checkExtension(Unknown Source)
      at sun.misc.ExtensionDependency.checkExtensions(Unknown Source)
      at sun.misc.ExtensionDependency.checkExtensionsDependencies(Unknown Source)
      at com.sun.deploy.security.DeployURLClassPath$JarLoader.parseExtensionsDependencies(Unknown Source)
      at com.sun.deploy.security.DeployURLClassPath$JarLoader.getClassPath(Unknown Source)
      at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
      at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
      at sun.plugin2.applet.Plugin2ClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
      at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
      at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
      at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
    But if I copy the package extension in the lib/ext directory of the JRE, then the applet works.

    I tried with the latest version of java 7 (55), and I get the same error. I have set the security level to medium, and the URL is added to the list of exceptions to the JRE.

  • Jre extension Mechanism

    i have my own extension mechanism which updates the extension directory within japplet.every time i update the ext directory i have to restart the browser. is there any way to reload the jre without restarting the browser. The jar files which downloading to ext directory not used in the japplet which downloads the jar files into ext directory

    i have my own extension mechanism which updates the extension directory within japplet.every time i update the ext directory i have to restart the browser. is there any way to reload the jre without restarting the browser. The jar files which downloading to ext directory not used in the japplet which downloads the jar files into ext directory

  • Sun Application Server 7 - No j2ee.jar?

    I am trying to compile and run Advice App from O'Reilly's "Head First EJB" book (Kathy Sierra and Bert Bates). I am using the Sun AppServer 7, since the book indicated that I should be using a J2EE 1.3 (NOT 1.4) compatible application server. My code won't compile due to what seems to be a classpath issue ("package javax.ejb does not exist"). My question is: Shouldn't my C:\Sun\AppServer7\lib directory contain a j2ee.jar file? It doesn't. In fact, there is no j2ee.jar file on my machine. Any advice is appreciated.

    Which Linux distro? Red hat?

  • In which J2EE jar file is javax.DataSource jar contained?

    Does anyone know in which J2EE jar file the javax.DataSource class is contained?
    L.F.

    Thanks for the reply, but when I do a jar -tvf on both of these jar files I see that tools.jar 1.4.2 contains only com.sun.tools... and dt.jar 1.4.2 contains javax.swing..... So where is javax.sql.... hiding? I have checked all the other jar files in the J2EE Standard and Enterprise edition as well. Has it moved alltogether. Any assitance would be appreciated.
    Lennart

  • Is it j2ee.jar and jdk1.5.0.jar same

    when i search for j2ee.jar in google it is showing jdk1.5
    but link is j2ee.jar download.
    is it same.in my tutorial they are saying download j2ee.jar
    if it differ ples send me link for download.

    Check that Eclipse itself is running with the right VM.
    This is from the Windows readme (but Linux is similar) "Here is a typical
    Eclipse command line:
    eclipse -vm c:\jdk1.4.2\jre\bin\javaw -vmargs -Xmx256M
    Tip: It's generally a good idea to explicitly specify which Java VM to use when
    running Eclipse. This is achieved with the "-vm" command line argument as
    illustrated above. If you don't use "-vm", Eclipse will look on the O/S path. When
    you install other Java-based products, they may change your path and could
    result in a different Java VM being used when you next launch Eclipse."
    In your case you would give it the path to your new java executable.
    (I am assuming you can compile OK from the command line.)

  • J2ee.jar not seen although in classpath

    Hi. My classpath has C:\j2sdkee1.3.1\lib\j2ee.jar in it. However, when I compile my servlet class I get the following error:
    package javax.servlet.http does not exist
    I have viewed the j2ee.jar contents to make sure javax.servlet directory is there.
    Does anyone have any ideas what could be wrong?
    Much thanks,
    Ron

    If j2ee.jar is added to System Classpath variable reboot system
    for the new classpath to set.

  • Unable to set CLASS_PATH for j2ee.jar

    Hello all,
    I have a peculiar problem. I have included the j2ee.jar path in my XP Home Edition environment variable, but javac is unable to get packages from there. I have echo-ed the CLASS_PATH in DOS command prompt and it reports the correct path of j2ee.jar. What's amazing is that when I type the full javac command with -classpath option (javac -classpath ____/j2ee.jar *.java) everything compiles well. I am lost here. Does someone here has a solution to this?
    Thanks for your help in advance.

    With XP, I had the same problem even if I had CLASSPATH. AFter lot of headbreaking I realized my J2EE_HOME and JAVA_HOME were part of user variables in the environment. But CLASSPATH I defined in the System variables and CLASSPATH was set with %J2EE_HOME%\lib\j2ee.jar which was the culprit. Once I moved the J2EE_HOME from user variables to system variables ..lo behold ..it was working and I did not have to substitue the j2ee.jar on the command line.

  • 加载j2ee.jar在aix weblogic8.1.6

    j2ee.jar包加载在weblogic8.1.6
    在linux系统,使用sun的jdk启动weblogic没有问题,正常运行。(jdk142_11)
    在aix系统使用ibm的jdk,启动weblogic会出现下面问题。 (java version "1.4.2")
    The WebLogic Server did not start up properly.
    java.lang.NoClassDefFoundError: com/sun/corba/se/internal/util/IdentityHashtable
    at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.<clinit>(Util.java:87)
    at java.lang.Class.forName1(Native Method)
    at java.lang.Class.forName(Class.java(Compiled Code))
    at weblogic.iiop.UtilDelegateImpl.<clinit>(UtilDelegateImpl.java:63)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled Code))
    at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled Code))
    at java.lang.Class.newInstance3(Class.java:367)
    at java.lang.Class.newInstance(Class.java:305)
    at javax.rmi.CORBA.Util.createDelegateIfSpecified(Util.java:358)
    at javax.rmi.CORBA.Util.<clinit>(Util.java:70)
    at weblogic.iiop.Utils.<clinit>(Utils.java:128)
    at weblogic.corba.utils.RepositoryId.getIDFromValueType(RepositoryId.java:183)
    at weblogic.corba.utils.RepositoryId.<init>(RepositoryId.java:129)
    at weblogic.corba.utils.ClassInfo.<init>(ClassInfo.java:78)
    at weblogic.corba.utils.ClassInfo.putClassInfo(ClassInfo.java:281)
    at weblogic.corba.utils.ClassInfo.<clinit>(ClassInfo.java:60)
    at weblogic.iiop.IIOPService.resumeClient(IIOPService.java:205)
    at weblogic.iiop.IIOPService.initialize(IIOPService.java:145)
    at weblogic.t3.srvr.SubsystemManager.initialize(SubsystemManager.java:123)
    at weblogic.t3.srvr.T3Srvr.initializeHere(T3Srvr.java:894)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:669)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:343)
    at weblogic.Server.main(Server.java:32)
    Reason: com/sun/corba/se/internal/util/IdentityHashtable
    请问谁遇见过此问题,是和jdk有关系吗?请指点迷津

    Please let me know my question sense or not.

  • J2ee.jar not compatible with Tomcat 4.1.18 - HELP

    I am attempting to generate my first web page using EJBs. I have ran into a snag. It seems that Tomcat 4.1.18 is not compatable with j2sdkee1.4. I have tried using j2sdkee1.3.1 and got the same problem.
    Ant builds the project just fine therefore I believe this to be a configuration problem - but can not find it. HELP
    *** Below is the out put from Tomcat when he is starting up....
    Feb 3, 2003 11:50:31 AM org.apache.commons.modeler.Registry loadRegistry
    INFO: Loading registry information
    Feb 3, 2003 11:50:32 AM org.apache.commons.modeler.Registry getRegistry
    INFO: Creating new Registry instance
    Feb 3, 2003 11:50:32 AM org.apache.commons.modeler.Registry getServer
    INFO: Creating MBeanServer
    Feb 3, 2003 11:50:33 AM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on port 8181
    Starting service Tomcat-Standalone
    ********** Probjem with Jar ************
    Apache Tomcat/4.1.18
    WebappClassLoader: validateJarFile(C:\Program Files\Apache Group\Tomcat 4.1\weba
    pps\JobEntry\WEB-INF\lib\j2ee.jar) - jar not loaded. See Servlet Spec 2.3, secti
    on 9.7.2. Offending class: javax/servlet/Servlet.class
    *** Below is the compiler output
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\JobEntry\index_jsp.java:9: package javax.ejb does not exist
    import javax.ejb.*;
    ^
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\JobEntry\index_jsp.java:23: cannot resolve symbol
    symbol : method InitialContext ()
    location: class org.apache.jsp.index_jsp
    InitialContext initial = InitialContext();
    ^
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\JobEntry\index_jsp.java:25: cannot access javax.ejb.EJBObject
    file javax\ejb\EJBObject.class not found
    siteList = (JobEntry.SiteList) PortableRemoteObject.narrow(objectRef, SiteList.class);
    ^
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\JobEntry\index_jsp.java:26: cannot resolve symbol
    symbol : variable siteListHome
    location: class org.apache.jsp.index_jsp
    mySiteList = siteListHome.create();
    ^
    4 errors

    You should not add j2ee.jar to the WEB-INF folder. I think you should move it to "C:\Program Files\Apache Group\Tomcat 4.1\lib\j2ee.jar".
    Also, it might help to read section 9.7.2 in the servlet 2.3 specification (as stated in the error). You can download the spec here: http://www.jcp.org/aboutJava/communityprocess/final/jsr053/

  • IncompatibleClassChangeError when adding j2ee.jar to existing project

    Hi,
    Sorry if this question is obvious, but I have a hard time grasping how everything works together.
    I have installed the latest version of java SDK and created a project in Eclipse. I've created some jsp's and servlets, and I'm now working with JavaMail. I read that I need j2ee.jar in order to use the JavaMail, so I downloaded it and placed it under WEB-INF/lib. In the build path in Eclipse I added it as exernal jar. Now when I run my index file, I first get:
    HTTP ERROR 500
    Problem accessing /foo/. Reason:
    Implementing class
    Caused by:
    java.lang.IncompatibleClassChangeError: Implementing class
    and then if I refresh the page I get this:
    HTTP ERROR 500
    Problem accessing /foo/. Reason:
    Could not initialize class org.apache.jasper.compiler.JspUtil
    Caused by:
    java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspUtil
    I'm wondering if I have my whole project setup wrong. Maybe if I had it right I wouldn't have to manually add the j2ee.jar? In my Java build Path in Eclipse, I have JRE System Library [JavaSE-1.6], and above I have the j2ee.jar that I added. It also appears under Web App Libraries. Please give me some guidance as to how to solve this issue.
    Thanks!

    First thing, take j2ee.jar out of your WEB-INF/lib.
    Yes it would have the java mail classes, but its also got a whole heap of other guff that you are not going to want, and is going to cause you a world of pain.
    A quick google leads to [javamail download|http://www.oracle.com/technetwork/java/index-138643.html]
    The activation framework (activation.jar) formerly also a requirement for javamail is part of Java 6. So if you already have the latest SDK, all you should need is the download from that link.
    cheers,
    evnafets

  • Need Netbeans *.jcs *.jcb for j2ee.jar and weblogic.jar

    Any one have *.jcs and *.jcb files for j2ee.jar and/or weblogic.jar.
    These files are used by Forte for autocomplete.
    When I try to create, the IDE runs out of memory and crashes.
    If anyone has it please email to [email protected]
    Thanks

    No, you don't need to put it in your classpath, but
    when you go to compile your code (this is via pure
    commandline), try this:
    set J2EE_HOME to the location where your J2EE SDK is
    installed.
    example:
    J2EE_HOME=c:\java\j2eesdk1.4
    Now, in the dir where your ejb files are:
    javac -classpath %J2EE_HOME%/lib/j2ee.jar *.javaI keep changing and testing my code; recompiling...
    Is there an easier way than type the 2 lines above each time I compile...?

  • J2ee.jar or weblogic.jar

    I've been wondering something for a long time now. I have always compiled against weblogic.jar (WL is my target app server) but it always struck me as odd since my applications are supposed to be portable to other app servers. With this in mind, I've always got the feeling that I've been doing it wrong. Should I be compiling against j2ee.jar from the J2EE SDK? I ask because I've never seen a definate statement of what to compile my J2EE code against. I've simply always assumed it had to be my app server jar file, but maybe this was a bad assumption. Please tell me what you do. Thanks!

    I am sure the weblogic.jar contains the required interfaces allowing you to compile your app successfully. For the J2EE SDK, the jar file is j2ee.jar.
    This can vary implementation to implemenation. However it is possible that your application could also be using WLS specific classes. You can either use the AVK to validate or compile with the J2EE SDK j2ee.jar

  • Difference j2ee.jar and javaee.jar

    Hi, it is not clear for me why exist 2 files j2ee.jar and javaee.jar. I have look manifest file for j2ee.jar and found that only contains path to javaee.jar. But
    If I add as library only j2ee.jar to my project - doesn't found e.g. import javax.mail.Folder.
    Problem will be resolved if I add only javaee.jar. But why we need j2ee.jar?

    j2ee.jar has the interface definitions for Java EE v1.4 specification whereas javaee.jar has the interface definitions for Java EE v1.5 (the name has been simplified to Java EE v5). So when you are developing an application that uses JEE v1.4 then you will need j2ee.jar on your classpath when compiling (do not need to package it in the module when deploying). And when you are developing an application that uses JEE v5 then you will need javaee.jar on your classpath when compiling (do not need to package it in the module when deploying).
    The next two questions that might come to your mind are:
    1. How do you know which JEE version you are using for development?
    The j2ee.jar and javaee.jar files are just API deifinitions (interfaces, and abstract classes) for the corresponding Java EE versions (i.e. 1.4 and 5 respectively). These APIs were designed by SUN and specify a contract between a Java EE container and the applications that will be deployed on the container. The implementation of this contract is provided by the various application server vendors. For example, Glassfish v2ur2 implements BOTH versions, however it requires you to specify, in the deployment descriptions, the JEE version which is to be used for the application that you are deploying.
    So in short the version of JEE you are using is specified in the deployment descriptor for the application.
    2. Why do we need these jars only during compilation and do not need to add it to the war (or jar) when deploying our module to the app server?
    The reason is that it will already be available in the app server that you are deploying you application to. This seems quite obvious as if i provide implementation of an interface, i will need to give you the interface as well as you will actually be using my implementation via the interface and not by directly calling my implementation classes. If you directly call my implementation classes then it will beat the whole purpose of defining a standard interface that everyone can use.
    I hope that clears out a few things.
    Regards,
    Jawad.

Maybe you are looking for