Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Commons LogFactory NoClassDefFoundError, Hibernate

 
Abhi Vuyyuru
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep getting this error when I try to deploy on weblogic 10.3 (a split-directory env). I'm trying to initialize hibernate through spring



Here is the spring configuration



I have commons-logging.jar in my classpath. The following is a list of jar files in my lib directory

 
Pradeep Kumar
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try running the code outside the Weblogic in a standalone and see the results. If you are not able to run then fix it and then try running in weblogic. You can use this approcah to solve dependency as solving dependencies might take time.

 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Essentially, you're missing a jar on your runtime classpath.

Remember, you have a design time classpath that you use when you compile, and a runtime time classpath that is used when you test your application. Make sure you're aware of any differences between your design-time classpath and the runtime classpath of your server.
 
Abhi Vuyyuru
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jar file is in the runtime classpath. I removed the commons-logging.jar file and tried to deploy, and it fails before attempting to initialize hibernate, the exception is thrown at spring initialization. If I include commons-logging.jar file, spring initializes fine (by this I mean other beans) but fails at hibernate initialization.

This happens if I deploy as split-directory and also when I try to deploy the ear (which contains all the jar files).
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a classloader issue. J2EE applications have a vareity of classloaders that are used by different parts of an application. A jar on one classloader classpath isn't necessarily on another classloaders classpath. That's the issue you're having it seems.

I wrote this article on J2EE classloaders. You might find it interesting.

Understanding J2EE Classloaders

Where have you placed the jar file that contains the class? Where is it on your runtime classpath?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic