• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic