-
1. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
clebert.suconic Apr 9, 2009 2:47 PM (in response to dkuanwang)Looking at the line code, it seems you're missing org.jboss.logging.Logger:
298 @ one revison back> client = new Client(new InvokerLocator(serverLocatorURI), configuration);
And I see a dependency from both Client and InvokerLocator to org.jboss.logging.Logger.
That class is available at jboss-common.jar.
I just found it by using a find:
jboss-4.3.0.GA_CP03$ find . -name \*jar -exec unzip -l {} \; > list.txt -
2. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
timfox Apr 9, 2009 2:56 PM (in response to dkuanwang)Isn't that in jboss-all-client.jar?
-
3. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
clebert.suconic Apr 9, 2009 3:56 PM (in response to dkuanwang)Yes.. it is.
-
4. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
clebert.suconic Apr 9, 2009 3:58 PM (in response to dkuanwang)"clebert.suconic@jboss.com" wrote:
Yes.. it is.
jboss-5 has deprecated jboss-all-client though.
I'm not sure if dkuanwang is using JBAS 4 or 5 -
5. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
dkuanwang Apr 10, 2009 11:03 AM (in response to dkuanwang)Hi Clebert/Tim,
I did check the class dependencies and found all the classes in jboss-remoting.jar or jbossall-client.jar.
I have tried putting the jboss jars in Sun AS classpath perfix but the same exception happens:
/logicalhost/is/lib/jboss/jboss-aop.jar
/logicalhost/is/lib/jboss/jboss-remoting.jar
/logicalhost/is/lib/jboss/jbossall-client.jar
/logicalhost/is/lib/jboss/javassist.jar
/logicalhost/is/lib/jboss/jboss-mdr.jar
/logicalhost/is/lib/jboss/trove.jar
/logicalhost/is/lib/jboss/log4j.jar
I believe the JBAS version is 4.3.0 since all the Jars provided by the vendor is in 4.3.0. I will confirm it with the vendor. On the other hand, if JBAS 5 deprecated jbossall-client.jar, what jar should a client use instead of it? -
6. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
clebert.suconic Apr 10, 2009 1:03 PM (in response to dkuanwang)"dkuanwang" wrote:
Hi Clebert/Tim,
I did check the class dependencies and found all the classes in jboss-remoting.jar or jbossall-client.jar.
I have tried putting the jboss jars in Sun AS classpath perfix but the same exception happens:
I don't know how ClassLoader would work on SunOne/Gassfish/JavaApplicationServer/WhateverNameTheyAreUsingNow. I used to work with it years ago, and I remember being somewhat different in regard to hierarchies.. etc.
You have the JAR list you need to use, you just need to make sure the application will have access to those classes.
On the other hand, if JBAS 5 deprecated jbossall-client.jar, what jar should a client use instead of it?
jbossall-client.jar is an evil aggregation of jars. You will need to use the individual client jars from /jboss/client. I have changes the examples to make use of the correct jars, and we have documented the minimal set for JBM, but depending on the other EE features you use you may need to add more client jars. I would suggest looking at the JBossAS docs. (Or ask on the jbas forum if you still miss anything). -
7. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
clebert.suconic Apr 10, 2009 1:07 PM (in response to dkuanwang)I have tried putting the jboss jars in Sun AS classpath perfix but the same exception happens:
What about isolatin the classes on the EAR application?
I'm a little rusty now about this... I believe there is a place somewhere on /WEB-INF/classes... /EAR-whatever. don't know.. I would need to look at docs or hack other examples.. but I believe you got the idea of what I mean. -
8. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
gaohoward Apr 12, 2009 10:55 PM (in response to dkuanwang)If Clebert is right about jbossall-client.jar being deprecated, then you shouldn't use that with your app. This is because the jbossall-client.jar (only from JBM perspect) contains JBM classes and may not be updated since it is deprecated.
-
9. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
clebert.suconic Apr 13, 2009 10:52 AM (in response to dkuanwang)jbossall-client.jar is deprecated after JBoss5 only.
The reasoning for the deprecation is this:
- Think about when a customer or user found a trivial bug. We then change the class and recompile it. Now we have to update at least two jars: -jboss-messaging.jar and jbossall-client.jar.
- Now think about another project doing the same.. say.. jboss-cache also found a bug, and updated jboss-all-client.jar.
If we send this customer both updates, you won' t know what version of jbossall-client you should use. It' s a mess.
That's why the jar was dropped after jboss5.
jbossall-client is still being "supported" on jboss4, however I really think it would be a good idea staying away from it for those reasons I pointed you. -
10. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
dkuanwang Apr 13, 2009 5:01 PM (in response to dkuanwang)I tried building the JBoss jars within EAR but same exception happens. :(
Since the JBAS I am trying to connect to is 4.2.2 and I have successfully connected to it with the standalone remote client, I am staying with the list of JARs in the previous post (including jbossall-client.jar). I am just curious what can be the class that's missing/conflicting giving the exception:
Caused by: java.lang.NoClassDefFoundError
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createClient(ClientConnectionFactoryDelegate.java:298)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$getClientAOPStack$aop(ClientConnectionFactoryDelegate.java:228)
....
Any pointer on how to debug such issue would be appreciated, too. (the verbose:class option didn't help me much) Thanks for your inputs!
-David -
11. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
clebert.suconic Apr 14, 2009 2:47 PM (in response to dkuanwang)Any pointer on how to debug such issue would be appreciated, too. (the verbose:class option didn't help me much) Thanks for your inputs!
The only thing I can think of is doing a real debug by attaching a debugger or looking a log4j.trace logs.
I would also look if Sun AS is setting Thread.currentClassLoader properly, as AOP is probably going to use that. -
12. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
dkuanwang Apr 14, 2009 4:06 PM (in response to dkuanwang)Thanks again for all your suggestions and help...I am able to narrow the problem down to org.jboss.remoting.InvokeLocator. Apparently when I try to instantiate this class, I will get a NoClassDefFound exception (without indicating what class is missing). I am able to create the org.jboss.logging.Logger object within my application but not the InvokeLocator.
What could be some of the dependencies for InvokeLocator other than jboss Logger? -
13. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
dkuanwang Apr 14, 2009 10:26 PM (in response to dkuanwang)InvokerLocator (jboss-remoting.jar 2.2.2SP9) has the following code:
static Class _mthclass$(String x0) {
try{
return Class.forName(x0);
}
catch(ClassNotFoundException x1){
throw (new NoClassDefFoundError()).initCause(x1);
}}
I am guessing this is where the NoCalssDefFoundError exception is thrown. Any advise on resolving this issue? -
14. Re: NoClassDefFound Exception from Sun AS 8.2 to JBM 1.4.0
dkuanwang Apr 17, 2009 12:40 AM (in response to dkuanwang)Hi JBM experts:
After change the security policy setting from
permission java.util.PropertyPermission "*", "read";
to
permission java.util.PropertyPermission "*", "read,write";
The NoClassDefFoundError is gone and now I am getting the following exception when trying to do:
connection = connectionFactory.createConnection();
org.jboss.jms.exception.MessagingNetworkFailureException: Failed to download and/or install client side AOP stack
at
org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientClusteredConnectionFactoryDelegate$getClientAOPStack$aopClientClusteredConnectionFactoryDelegate.java:250) at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.getClientAOPStack(ClientClusteredConnectionFactoryDelegate.java)
at org.jboss.jms.client.ClientAOPStackLoader.loadClientAOPStackLoader.java:75)
at g.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:192)
This exception is somewhat generic and therefore I am posting here to see if anyone can share some of the common cause for this exception.
Again, thanks for those of you kindly share your knowledge and ideas.