Hi,
I'm trying to deploy the simple HelloWorld example ejb, found in the Mastering EJB book. This is my ejb-jar.xml file:
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>Hello</ejb-name>
<home>examples.HelloHome</home>
<remote>examples.Hello</remote>
<local-home>examples.HelloLocalHome</local-home>
<local>examples.HelloLocal</local>
<ejb-class>examples.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
This is my weblogic-ejb-jar.xml file:
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd">
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>Hello</ejb-name>
<jndi-name>ejb20-Hello-HelloHome</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
When I log into the admin console & try to deploy, I get the message : Unable to load a class specified in your ejb-jar.xml: examples.HelloBean
Can anybody please help?
Thanks
Meera
-
EJB deployment question (6 messages)
- Posted by: Arvind Arvind
- Posted on: February 07 2005 11:59 EST
Threaded Messages (6)
- Re: EJB deployment question by James Carman on February 07 2005 14:39 EST
- Re: EJB deployment question by Arvind Arvind on February 09 2005 09:16 EST
- Re: EJB deployment question by James Carman on February 09 2005 14:33 EST
- Re: EJB deployment question by Sudhir Kethamakka on February 12 2005 08:19 EST
- Re: EJB deployment question by ahmed kasim on March 10 2005 06:41 EST
- ahmed karim's solution by viral shah on August 17 2005 05:35 EDT
-
Re: EJB deployment question[ Go to top ]
- Posted by: James Carman
- Posted on: February 07 2005 14:39 EST
- in response to Arvind Arvind
Is the class really named "examples.HelloBean"? Is it in your ejb jar file? Open your jar file in winzip or do a jar -tf on it to verify that your class files are actually in there. Make sure you include all necessary dependencies (like helper classes, if any since this is just a hello world example) in there too. -
Re: EJB deployment question[ Go to top ]
- Posted by: Arvind Arvind
- Posted on: February 09 2005 09:16 EST
- in response to James Carman
Thank you for replying.
This is what I did to create the jar file:
I was in the c:\examples directory and I said
jar -cf HelloWorld.jar examples\*
and when I did jar -xvf HelloWorld.jar, I get
C:\examples>jar -xvf HelloWorld.jar
created: META-INF/
extracted: META-INF/MANIFEST.MF
extracted: examples/Hello.class
extracted: examples/Hello.java
extracted: examples/HelloBean.class
extracted: examples/HelloBean.java
extracted: examples/HelloHome.class
extracted: examples/HelloHome.java
extracted: examples/HelloLocal.class
extracted: examples/HelloLocal.java
extracted: examples/HelloLocalHome.class
extracted: examples/HelloLocalHome.java
extracted: examples/HelloWorld.jar
created: examples/META-INF/
extracted: examples/META-INF/ejb-jar.xml
extracted: examples/META-INF/MANIFEST.MF
extracted: examples/META-INF/WebLogic-ejb-jar.xml
Is it not right? I stil get the error about not being able to load the class
Thanks
Meera -
Re: EJB deployment question[ Go to top ]
- Posted by: James Carman
- Posted on: February 09 2005 14:33 EST
- in response to Arvind Arvind
Did you make sure you have a package statement at the top of the source files, indicating that all of the classes/interfaces will be in the examples package? -
Re: EJB deployment question[ Go to top ]
- Posted by: Sudhir Kethamakka
- Posted on: February 12 2005 08:19 EST
- in response to James Carman
Don't you have to run, EJBC or APPC (Weblogic) on the jar file before you try to deploy ? -
Re: EJB deployment question[ Go to top ]
- Posted by: ahmed kasim
- Posted on: March 10 2005 06:41 EST
- in response to James Carman
Hi
open ur jar file in zip, at the end of column ie 'path' it shows the beans path. if it is empty then you have created wrong jar file
eg: if ur package is like this
com.mycompany.trade.ejb
then go to bin directory and make the jar file like
jar cvf myejb.jar com\mycompany\trade\ejb\*.class
to add META-INF(ejb-jar.xml and weblogic-ejb-jar.xml)
jar uvf myejbjar.jar META-INF/*.xml
and remove all the .package from myserver and applications redeploy it.
Regards
Kasim -
ahmed karim's solution[ Go to top ]
- Posted by: viral shah
- Posted on: August 17 2005 05:35 EDT
- in response to Arvind Arvind
yup,......what ever ahmed karim posted really helps
thanks ahmed karim