wood burning stoves 2.0*
The moose likes Websphere and the fly likes Got problem when setup HelloEJB project in RAD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Got problem when setup HelloEJB project in RAD" Watch "Got problem when setup HelloEJB project in RAD" New topic
Author

Got problem when setup HelloEJB project in RAD

Haifeng Jiang
Ranch Hand

Joined: Dec 14, 2008
Posts: 42
These are the files in HelloEJB project:
HelloEJB.java:

HelloEJBHome.java:

HelloEJBBean.java:


ejb-jar.xml:


File in HelloEJBClient project:
HelloEJBClient.java:


I deployed HelloEJB project into Websphere server 6 successfully. When I run HelloEJBClient.java, I got error:
Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.emf.ecore.EFactory
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:222)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:556)
at java.net.URLClassLoader.access$400(URLClassLoader.java:119)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961)
at java.security.AccessController.doPrivileged(AccessController.java:274)
at java.net.URLClassLoader.findClass(URLClassLoader.java:487)
at java.lang.ClassLoader.loadClass(ClassLoader.java:604)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327)
at java.lang.ClassLoader.loadClass(ClassLoader.java:561)
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
at java.lang.J9VMInternals.verify(J9VMInternals.java:57)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
at org.eclipse.hyades.logging.events.cbe.impl.EventFactoryContext.<init>(EventFactoryContext.java:82)
at org.eclipse.hyades.logging.events.cbe.impl.EventFactoryContext.getInstance(EventFactoryContext.java:122)
at com.ibm.ejs.ras.Tr.<clinit>(Tr.java:279)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at com.ibm.websphere.naming.WsnInitialContextFactory.<clinit>(WsnInitialContextFactory.java:70)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:57)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:666)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:259)
at javax.naming.InitialContext.init(InitialContext.java:235)
at javax.naming.InitialContext.<init>(InitialContext.java:209)
at com.myClient.HelloEJBClient.getInitContext(HelloEJBClient.java:34)
at com.myClient.HelloEJBClient.main(HelloEJBClient.java:18)


Is there anything wrong in my EJB project? I have no idea now. Appreciate your help. Thanks in advance.


Thinking a lot. Gaining a lot.
Haifeng Jiang
Ranch Hand

Joined: Dec 14, 2008
Posts: 42
Finally I got the answer.
I have to import 2 jar in my client project.
com.ibm.ws.admin.client_6.1.0.jar
com.ibm.ws.webservices.thinclient_6.1.0.jar

both of the jar are under Websphere runtimes directory.


Also below sentence in client class should be changed.

To


I got the output:
[3/16/10 21:48:09:125 CST] 00000013 SystemOut O invoke HelloEJBBean constructor
[3/16/10 21:48:09:187 CST] 00000013 SystemOut O invoke HelloEJBBean constructor
[3/16/10 21:48:09:187 CST] 00000013 SystemOut O invoke setSessionContext(SessionContext method
[3/16/10 21:48:09:187 CST] 00000013 SystemOut O invoke ejbCreate method
[3/16/10 21:48:09:187 CST] 00000013 SystemOut O invoke getEJBString method
[3/16/10 21:48:09:187 CST] 0000001c SystemOut O invoke getAnotherString method


Cheers!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Got problem when setup HelloEJB project in RAD