-
1. Re: dependent classes
nagulapati Feb 2, 2004 6:24 PM (in response to shieroii)Hello Shieroii,
I am having few problems deploying EJB beans which are dependent on other classes. You seem to have everything working with respect to dependent classes. Hopefully you can answer my question :)
One of EJB beans accesses a dependent class to perform the business logic. I packed my EJB artifacts, deployment descriptors and the dependent classes into a jar file and tried deploying on the Jboss server. While deploying it gives me a "NoClassDefFoundError" for the dependent class. Somehow it is not loading the class ...... do you know why?
I tried the following options,
1. Packed the dependent classes into a separate jar file and placed it in the "deploy" directory but when the server was restarted it is not loading the jar file because it is expecting a EJB jar file with all the interfaces. Can we deploy a jar file into the deploy directory with only utility classes and how?
2. Tried setting the classpath by pointing it to the dependent classes but in vain
You have said that,
>>"I have some session beans wrapped in different jar files and all of them depend on classes that are wrapped in resources.jar. resources.jar is included in jboss-classpath and everything executes fine. "
How different is "jboss-classpath" from "classpath". Can we set the jboss's classpath explicitly while launching the server? Could you please clarify me further on "jboss-classpath"?
Here is the code snippet of my bean class "HelloWorldBean.java"
------------------------
//Make a service using ServiceLocator
AdminWebService admin = new AdminWebServiceLocator();
//Get the stub using the Service
AdminWebServiceSoap adminStub = admin.getAdminWebServiceSoap();
------------------------
Here the AdminWebService is an external interface which the bean is accessing.
When I am deploying the bean with the dependent classes packed into a jar file, I am getting the following error
-------------------------------------
18:07:25,343 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
Cause: Incomplete Deployment listing:
Packages waiting for a deployer:
Incompletely deployed packages:
MBeans waiting for classes:
MBeans waiting for other MBeans:
[ObjectName: jboss.j2ee:jndiName=HelloWorld,service=EJB
state: FAILED
I Depend On:
Depends On Me: java.lang.NoClassDefFoundError: AdminClient/AdminWebService]
-------------------------------------
Do we have to change the "ejb-jar.xml" file and how can we use the <resource-ref> to point to dependent classes instead of dependent EJB's?
I have been struggling with this since long time and would really appreciate any pointers or help!
Thanks a lot in advance,
Vivek -
2. Re: dependent classes
shieroii Feb 3, 2004 8:18 AM (in response to shieroii)Hello Vivek,
the path (of jar file containing dependent classes) should be appended to the jboss-classpath (see run.bat in <jboss-home>/bin folder). this will solve your problem.
here a snippet from run.bat...
...................
set MYLIB_PATH=%MYLIB_PATH%F:\Java\lib\resources.jar;
set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%MYLIB_PATH%
...................
good luck! -
3. Re: dependent classes
shieroii Feb 4, 2004 9:17 AM (in response to shieroii)Ok, but the main question still remains the same!!