Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes EJB 3.0 Deployment Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 3.0 Deployment Problem" Watch "EJB 3.0 Deployment Problem" New topic
Author

EJB 3.0 Deployment Problem

Aryan Khan
Ranch Hand

Joined: Sep 12, 2004
Posts: 290

My first ejb deployment running in trouble.

Created the ejb



Packaged and deployed successfully to Sun App Server PE 9. Created the client:

While deploying getting the following error:
Class [ LmyEJB/NewSessionBean; ] not found. Error while loading [ class clientea.Main ]
Error in annotation processing: java.lang.NoClassDefFoundError: LmyEJB/NewSessionBean;

--------------------------------
But deployment message says successfully deployed.:
-------------
Deploying application in domain completed successfully
Trying to create reference for application in target server completed successfully
Trying to start application in target server completed successfully
Deployment of application ClientEA-app-client completed successfully
Target module started
---------------------------------------

While running the client I get a nullpointer exception:

--- --------------- --------
Apr 2, 2007 3:22:38 PM com.sun.enterprise.appclient.MainWithModuleSupport <init>
WARNING: ACC003: Application threw an exception.
java.lang.NullPointerException
at clientea.Main.main(Main.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:232)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:329)
at com.sun.enterprise.appclient.Main.main(Main.java:180)
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:340)
at com.sun.enterprise.appclient.Main.main(Main.java:180)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:232)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:329)
... 1 more
Caused by: java.lang.NullPointerException
at clientea.Main.main(Main.java:31)
... 7 more
Java Result: 1
-----------
Cant figure out why?

Ahmad


OCP/MCP/SCJP/SCWCD/IBM XML/SCMAD/SCEA-1
bala nannaka
Ranch Hand

Joined: Apr 02, 2007
Posts: 49
import home and remote interfaces into your client and lookup for home stub object through JNDI bounded name.copy your appropriate home and remote interfaces classes into your client directory.
Aryan Khan
Ranch Hand

Joined: Sep 12, 2004
Posts: 290

I am following one of the tutorials from sun. They have not used JNDI at all and used "injection". Is JNDI a must. Also the remote interface is there in client application.
Aryan Khan
Ranch Hand

Joined: Sep 12, 2004
Posts: 290

Ok I found the problem.

I declared the bean instead of the remote interface in the client
-------
private static NewSessionBean aBean; //Wrong
--------
 
wood burning stoves
 
subject: EJB 3.0 Deployment Problem