Hei
I get the following error when trying to deploy a .har file to JBoss4.0.1sp1. (The .harfile is included together with a .war file in an .ear)
13:04:53,125 WARN [ServiceController] Problem starting service jboss.har:service=Hibernate
java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/Configuration
at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:564)
at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:551)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
...
Why is it looking for "net/sf/hibernate/cfg/Configuration" when it should be looking for "org/hibernate/cfg/Configuration" since I'm using Hibernate3
I have placed "hibernate3.jar" in \jboss-4.0.1sp1\server\default\deploy\jboss-hibernate.deployer\
so it should be able to find it.
hibernate-service.xml:
<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate"
name="jboss.har:service=Hibernate">
<attribute name="DatasourceName">java:/mysql-ds</attribute>
<attribute name="Dialect">org.hibernate.dialect.MySQLDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<attribute name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>
<attribute name="ShowSqlEnabled">true</attribute>
<attribute name="Hbm2ddlAuto">create-drop</attribute>
</mbean>
</server>
hibernate.cfg.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="SessionFactory">
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.datasource">java:/mysql-ds</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/resultservice</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">Mama747</property>
<property name="hibernate.connection.pool_size">4</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
<property name="transaction.manager_lookup_class">
org.hibernate.transaction.JBossTransactionManagerLookup
</property>
<!-- mapping files -->
<mapping resource="com/cup/dao/Product.hbm" />
</session-factory>
</hibernate-configuration>
If I replace "hibernate3.jar" with "hibernate2.jar" in \jboss-4.0.1sp1\server\default\deploy\jboss-hibernate.deployer\
and replace "org" with "net.sf" in "hibernate-service.xml" everything deploys fine. My problem now is that I have to work whit hibernate2 API in my Java code, and I don't want that. Why does JBoss find "hibernate2.jar" and not "hibernate3.jar".
Please help! Thanks.
Mads
|