Hibernate version:
3.0 RC1
Java version:
5.0_01
JBoss version:
3.0 RC1
DB version:
Postgres 8.0
hibernate.properties:
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
hibernate.connection.datasource=java:/PostgresDS
hibernate.default_schema= public
hibernate-service.xml:
Code:
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=HibernateTicketsystem">
<attribute name="DatasourceName">java:/PostgresDS</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<attribute name="Dialect">org.hibernate.dialect.PostgreSQLDialect</attribute>
<attribute name="CacheProviderClass">org.hibernate.cache.EhCacheProvider</attribute>
<attribute name="DefaultSchema">public</attribute>
</mbean>
Hi there,
I have rebuild the jboss-hibernate.jar so that it works with Hibernate3.0. Now I replaced the HAR archive in the deploy dir of the server and started. I expected that the Mappings are processed but they weren't. Then I opened the Web-Console and I looked if the MBean Service was deployed and it was, but the SessionFactory wasn't running so I invoke rebuildSessionFactory() from the Console and I saw that the Mappings were processed. So I was able to run my queries but I wasn't able to put the results to the wire. In my testcase I get the following trace while getting an object from the remote interface:
Code:
java.lang.ExceptionInInitializerError
at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1641)
at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:47)
at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:175)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:172)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:515)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:119)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:163)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:103)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:91)
at $Proxy2.getPerson(Unknown Source)
at de.xcom.ticketsystem.ejb.PersonBcBeanTest.testGetPersonById(PersonBcBeanTest.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4jFactory does not implement 'org.apache.commons.logging.Log'. (Caused by org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4jFactory does not implement 'org.apache.commons.logging.Log'.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4jFactory does not implement 'org.apache.commons.logging.Log'. (Caused by org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4jFactory does not implement 'org.apache.commons.logging.Log'.))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.hibernate.engine.CollectionEntry.<clinit>(CollectionEntry.java:27)
... 45 more
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4jFactory does not implement 'org.apache.commons.logging.Log'. (Caused by org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4jFactory does not implement 'org.apache.commons.logging.Log'.)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 49 more
Caused by: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4jFactory does not implement 'org.apache.commons.logging.Log'.
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:392)
... 50 more
DAO code for this:
Code:
public Person findPersonById(Integer id) throws HibernateException {
try {
Session session = getSession();
Person ret = (Person) session
.createCriteria(Person.class)
.add(Expression.eq("PersonId", id))
.setCacheable(true)
.setCacheRegion("Persons")
.uniqueResult();
return ret;
} finally {
closeSession();
}
}
Bean Code:
Code:
public Person getPerson(Integer id) throws RemoteException{
try {
Person p = dao.findPersonById( id );
personByLogin.put( id, p );
return p;
} catch (HibernateException e) {
log.error(e);
throw new RemoteException(e.getMessage(), e);
}
}
So first did I miss something that the SessionFactory isn't build on startup.
2nd why I'm not able to put the objects to the wire, I already added a UID to the Object generated by HBM2JAVA.[/code]
Code: