I'm running tomcat4 with hibernate3, and i've implemented a HibernateUtil class with a static block to initialize the SessionFactory
Code:
static {
try {
mFactory = new Configuration().configure().buildSessionFactory();
}
catch (HibernateException exception) {
System.err.println(exception);
}
}
when the HibernateUtil class is dynamically loaded, it executes the configuration line and throws this exception:
Code:
java.lang.NoClassDefFoundError: javax/transaction/SystemException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at org.hibernate.id.IdentifierGeneratorFactory.class$(IdentifierGeneratorFactory.java:25)
at org.hibernate.id.IdentifierGeneratorFactory.<clinit>(IdentifierGeneratorFactory.java:76)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:111)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:166)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
...
i am aware that javax.SystemException is part of j2ee, my problem is that i can't figure out how to include j2ee.jar into my classpath. if i just put a link to it in {...}/tomcat4/common/lib, i get errors when tomcat starts because it overrides some jmx classes, and if i put it in the webapp's WEB-INF/lib it doesn't load because it tries to override servlet classes.
how do i include the necessary j2ee classes without creating a conflict? thanks.