class loading problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

class loading problem

cgazit
I seem to have a problem with  the class loader due to classes' visibility.
My EAR had references to 3 external application utility jars and 1 reference to  log4j jar.
I deployed the jars and the log4j and then attempted to deploy the EAR. The deployment complained with NoClassDefFoundError about a class in one of app jars. I tried to use import-package statements in the plan , but it didn't help.

So, I packaged all the jars (including the log4j) in the EAR, rebuilt the EAR , and attempted another deploy.
It now finds my app jars, but still complain about a class in the log4j.
Exception: class java.lang.NoClassDefFoundError: org.apache.log4j.BasicConfigurator: org.apache.log4j.BasicConfigurator
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:835)
This statement in the plan is not helping:
<sys:import-package>org.apache.log4j</sys:import-package> 

I find v3.x very difficult to work with because of this (or what I believe to be) OSGi restrictions.
Almost ready to give up and go back to 2.2!
PS I'm using log4j.1.2.14.jar

thanks for any help.
Reply | Threaded
Open this post in threaded view
|

Re: class loading problem

Ivan Xu
Hi,

Since you have already packaged the log4j jar file in your EAR, cloud you try to use the configuration below :

<sys:import-package>!org.apache.log4j*</sys:import-package>


2013/9/11 cgazit <[hidden email]>
I seem to have a problem with  the class loader due to classes' visibility.
My EAR had references to 3 external application utility jars and 1 reference
to  log4j jar.
I deployed the jars and the log4j and then attempted to deploy the EAR. The
deployment complained with NoClassDefFoundError about a class in one of app
jars. I tried to use import-package statements in the plan , but it didn't
help.

So, I packaged all the jars (including the log4j) in the EAR, rebuilt the
EAR , and attempted another deploy.
It now finds my app jars, but still complain about a class in the log4j.
Exception: class java.lang.NoClassDefFoundError:
org.apache.log4j.BasicConfigurator: org.apache.log4j.BasicConfigurator
        at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:835)
This statement in the plan is not helping:
<sys:import-package>org.apache.log4j</sys:import-package>

I find v3.x very difficult to work with because of this (or what I believe
to be) OSGi restrictions.
Almost ready to give up and go back to 2.2!
PS I'm using log4j.1.2.14.jar

thanks for any help.



--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/class-loading-problem-tp3987163.html
Sent from the Users mailing list archive at Nabble.com.



--
Ivan