aspose file tools*
The moose likes Java in General and the fly likes Classpath\ClassLoader Issue NoClassDefFoundError org.apache.commons.logging.LogFactory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Classpath\ClassLoader Issue NoClassDefFoundError org.apache.commons.logging.LogFactory" Watch "Classpath\ClassLoader Issue NoClassDefFoundError org.apache.commons.logging.LogFactory" New topic
Author

Classpath\ClassLoader Issue NoClassDefFoundError org.apache.commons.logging.LogFactory

Doug MacKenzie
Greenhorn

Joined: Feb 18, 2009
Posts: 13
I've got a problem that I can't seem to find any solution to despite trolling the internet for similar experiences.

Environment:
Struts 1.3.8
Hibernate 3.2.7
J2EE 5
Weblogic 10.3

The weblogic classpath has been locked down and can't be changed.

When hibernate instantiates a Configuration object it's throwing the following error:


I've checked the WEB-INF\lib folder and commons-logging-1.1.1.jar is present. On my local server if I run the weblogic server through MyEclipse, and add the commons-logging-1.1.1.jar to the classpath I can get past this issue, but I can't do this in production. Any ideas on how to get past this without appending to the classpath?

Thanks,
Doug
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Doug MacKenzie wrote:On my local server if I run the weblogic server through MyEclipse, and add the commons-logging-1.1.1.jar to the classpath I can get past this issue, but I can't do this in production.

That is most probably because eclipse will add the entire classpath while starting the weblogic instance.

Doug MacKenzie wrote:Any ideas on how to get past this without appending to the classpath?

Do you have the logging jar in your ear/war file? If yes, then you would not require it in weblogic's classpath.
In any case, its not a good idea to depend on the weblogic's classpath. All classes you need in your application, must be available within your application.

Since, it looks like a problem with configuring a J2EE application in weblogic, moving it to weblogic forum.


apigee, a better way to API!
Doug MacKenzie
Greenhorn

Joined: Feb 18, 2009
Posts: 13
Do you have the logging jar in your ear/war file? If yes, then you would not require it in weblogic's classpath.

I am deploying via an ear, I've also tried deploying a war with the same behaviour. I've also checked to ensure that the logging jar is in the ear/war and I've confirmed that it is.
Ed Ward
Ranch Hand

Joined: Jan 30, 2006
Posts: 147
I'm not too familiar with Hibernate (yea, I can't believe it either), but I do know there are a number of hibernate properties that sometimes must be
explicilty specified when deploying to Weblogic.

Check your hibernate properties too make sure that everything is mapped properly as well as checking the config documentation to see what's available.
Maybe explicilty adding hibernate.session_factory_name or one of the others optionals will resolve the issue.

Also, and this depends on the design and intent of your app, if the missing lib is in your archive and if you can use the weblogic.xml descriptor specify

<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>


Hope this helps!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classpath\ClassLoader Issue NoClassDefFoundError org.apache.commons.logging.LogFactory