Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Doug MacKenzie
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Doug MacKenzie
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic