Environment
Eclipse Version: 3.2.0
WTP 1.5
Linux 2.6.10-5-k7
ubuntu breezy
Hibernate 3.1.3
java.vm.vendor=Sun Microsystems Inc.
java.vm.version=1.5.0_04-b05
Ok, here is the problem which I only get this issue inside of Eclipse. From the command line I get way past this issue.
In the code below I only get to
new Configuration() when things go wrong. See code and excpetion below.
Code:
try
{
// Create the SessionFactory from hibernate.cfg.xml
Configuration c= new Configuration();
c.configure();
sessionFactory = c.buildSessionFactory();
logInfo("AnalyzeRawTripData Initialized");
}
catch (Throwable ex)
{
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
logException("unable to Initialize AnalyzeRawTripData",ex);
}
exceptionCode:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:116)
at com.travelbahn.xgwStats.AnalyzeRawTripData.init(AnalyzeRawTripData.java:38)
at com.travelbahn.xgwStats.XGWStatsProcess.process(XGWStatsProcess.java:53)
at com.travelbahn.xgwStats.XGWStatsProcess.main(XGWStatsProcess.java:196)
The exception would make you think that I don't have the hibernate-3.1/lib/commons-logging-1.0.4.jar setup in the build path for this project, but I do! Can't seem to get very far with this and I've even traced this down into the hibernate lib.
Code:
public class Configuration implements Serializable {
private static Log log = LogFactory.getLog( Configuration.class );
Seem to bomb out in the LogFactory code. Funny thing is you get way down into the getLog() method when it trys to load the default wraper for log4j and the class loader fails by returning null.
Again, if I run this app from the command line using a simple script everything goes along just fine.
Another thing I've tried is
Code:
try {
Class.forName("org.apache.commons.logging.LogFactory");
}
as you'd expect this bombs!