-
1. Re: strange problem - NoClassDefFoundError
juhalindfors Aug 16, 2003 11:21 AM (in response to surekharao)What version of JBoss are you using and how are you packaging and deploying your application?
-- Juha -
2. Re: strange problem - NoClassDefFoundError
surekharao Aug 18, 2003 1:14 AM (in response to surekharao)Hi juwa
Thanks for your reply
sorry for late reply since I was on vacation
well .. I am using Jboss -2.4.4 and Tomcat -4.0.3 both are standard alone And my package structure is like below:
UserBean module
com.sms.user.ejb.*; --> calling bean package
UserControlBean--> Bean class
UserControl---> Remote Interface
UserControlHome--> Home Interface
MilageBean module
com.sms.milage.ejb.*; --> other bean package
MilageControlBean--> Bean class
MilageControl---> Remote Interface
MilageControlHome--> Home Interface
Problem :
When I call MilageControlHome in my calling bean(UserControlBean) getting exception java.lang.NoClassDefounderErrorException
The below code is where my bean calling other beans out side of package
Context ctx = EJBUtil.getInitialContext();
MilageControlHome milageHome = (MilageControlHome) EJBUtility.getEJBHome(ctx,"com/sms/milage/ejb/MilageControlHome",MilageControlHome.class);
MilageControl milageControl = milageHome.create();
And as I told if I packaged other bean classes in my calling bean package then it didn't give any exception and working very fine
I doubt some thing wrong in classpath, I have checked already my classpath settings and pretty sure there is nothing wrong.
So confusing what is the real problem with this..
Pls refer once this once and help me out.
Thanks in advance
regards
Surekharao -
3. Re: strange problem - NoClassDefFoundError
juhalindfors Aug 18, 2003 5:29 AM (in response to surekharao)You need to package the bean interfaces with the components that are using them to call your bean implementation.
Or create an EAR archive that contains all your EJB jars.
-- Juha -
4. Re: strange problem - NoClassDefFoundError
surekharao Aug 18, 2003 9:26 PM (in response to surekharao)Hi Juha.
I really don't get u r point.. could u please explain more clearly..
let me explain my package struchere once
I have made .jar files (which are stroing in /JBOSS_HOME/deploy ) for each module which contains Session Beans and CMP -Entity Beans
For your reference here with attaching make file for one of my user module
And also could you please explain how to create EAR with all my EJB jars
thanks for u r help
regards
Madhu -
5. Re: strange problem - NoClassDefFoundError
juhalindfors Aug 19, 2003 3:29 AM (in response to surekharao)If you're deploying two EJB jars in 2.4 what you get is two separate classloaders, one per jar, that do not have visibility to each other's loaded classes. That means that if you are using bean from jar B then you need to include the component interfaces (home and remote interfaces, custom types exposed in those interfaces) as part of jar A when invoking a bean from within that jar.
If you package both EJB jars in an EAR then the EAR file shares a single classloader and will have class visibility across all components inside the EAR. EAR packaging is explained in most J2EE tutorials available on the web. It is a standard J2EE package format.
-- Juha -
6. Re: strange problem - NoClassDefFoundError
surekharao Aug 21, 2003 6:54 AM (in response to surekharao)Hi Juha !
thanks for ur reply
I tried to make EAR Package, so I put all my deployed jars in EAR package directory
and inside package directory made META-INF folder there put application.xml
META-INF/
META-INF/MANIFEST.MF
META-INF/application.xml
application.xml
<display-name>smsbeans</display-name>
user.jar
milage.jar
wap.jar
------------------
Added all my jars here
---------------------
Here is ear file smsbean.ear) is built, using the jar command
cd smsbeans (EAR package Directory)
jar cvf smsbeans .ear *
After that I copied smsbeans.ear file to $JBOSS_HOME/deploy/
then I can see log trace($JBISS_HOME/bin/noput.out) showing errors and smsbeans .ear is not deployed.
Am I doing on right way or missing any thing?
Please check once ..
Thanks for your help
regards
Suree -
7. Re: strange problem - NoClassDefFoundError
juhalindfors Aug 22, 2003 8:29 AM (in response to surekharao)can you please attach the errors you get in the console or server.log that are causing the deployment to fail?
-- Juha