This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Got problem when setup HelloEJB project in RAD

 
Haifeng Jiang
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Haifeng Jiang
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic