org/mortbay/jetty/webapp/WebAppClassLoader previously initiated loading for a different type with name "javax/management/MBeanServer"

View: New views
4 Messages — Rating Filter:   Alert me  

org/mortbay/jetty/webapp/WebAppClassLoader previously initiated loading for a different type with name "javax/management/MBeanServer"

by vedil :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a web application which uses webwork, hibernate and c3p0 which was working on apache tomcat.
I do not have any data source configured.

On jetty when i deploy the same war, the deployment was fine.
But when i try to use the dynamic content where a server side action tries to access database i get this exception
14:14:29,718 ERROR DispatcherUtils: Could not execute action
java.lang.reflect.InvocationTargetException

the cause or it is,
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance
 of org/mortbay/jetty/webapp/WebAppClassLoader) previously initiated loading for
 a different type with name "javax/management/MBeanServer"
down the stack trace I see c3p0 classes and hibernate ones.

So I am assuming some how the application is not bale to access database.

I have searched a lot for this could not find any useful results some of the relevant links that i found are
1. http://www.nabble.com/Help-a-sysadmin-smile-today-%3A)-tt16031477.html#a16031477
2. http://inventorsparadox.blogspot.com/2008_11_01_archive.html

I have tried the second link mentioned but without any success.

Can any body help me on this.

Re: org/mortbay/jetty/webapp/WebAppClassLoader previously initiated loading for a different type with name "javax/management/MBeanServer"

by vedil :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What I have observed is that the problem is with c3p0 connection pooling,
I have created a sample application which uses hibernate and it was working fine on jetty. Now I have added c3p0 related properties and added the required jars and boom I see the same exception I was explaining above.

Re: org/mortbay/jetty/webapp/WebAppClassLoader previously initiated loading for a different type with name "javax/management/MBeanServer"

by vedil :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

After some more debugging i founf the problem is these jars that come with hibernate.
jboss-cache.jar; jboss-common.jar; jboss-jmx.jar; jboss-system.jar

I have removed them and it works fine now.

I got that info from this link
http://dev.eclipse.org/newslists/news.eclipse.platform/msg65467.html

So ultimately this is solved. If you are using the hibernate and c3p0 jars make sure that u remove the above mentioned jars
coz javax.management.MBeanServer is there in jboss-jmx.jar ( I removed all jboss related jars ) so removing this should solve the problem.


Re: org/mortbay/jetty/webapp/WebAppClassLoader previously initiated loading for a different type with name "javax/management/MBeanServer"

by mjfan80 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i just try an upgrade with grails 1.2M3
and i get a similar error, but with different class

Error executing script RunApp: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "javax/management/NotificationListener"

what it could be?


vedil wrote:
I have a web application which uses webwork, hibernate and c3p0 which was working on apache tomcat.
I do not have any data source configured.

On jetty when i deploy the same war, the deployment was fine.
But when i try to use the dynamic content where a server side action tries to access database i get this exception
14:14:29,718 ERROR DispatcherUtils: Could not execute action
java.lang.reflect.InvocationTargetException

the cause or it is,
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance
 of org/mortbay/jetty/webapp/WebAppClassLoader) previously initiated loading for
 a different type with name "javax/management/MBeanServer"
down the stack trace I see c3p0 classes and hibernate ones.

So I am assuming some how the application is not bale to access database.

I have searched a lot for this could not find any useful results some of the relevant links that i found are
1. http://www.nabble.com/Help-a-sysadmin-smile-today-%3A)-tt16031477.html#a16031477
2. http://inventorsparadox.blogspot.com/2008_11_01_archive.html

I have tried the second link mentioned but without any success.

Can any body help me on this.