-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: HAR Service doesn't start on startup in Webconsole it does
PostPosted: Sat Mar 26, 2005 8:15 pm 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
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:

_________________
regards

Olaf

vote if it helped


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 1:21 pm 
Newbie

Joined: Tue Jul 25, 2006 6:39 pm
Posts: 16
Location: Dallas, TX
Kaneda, take a look at my post from the other day.

http://forum.hibernate.org/viewtopic.php?t=962498&highlight=

I've stripped this down to just trying to do commons-logging in my app and it looks like the culprit is commons-logging not hibernate.

Through poring through many posts all over the web the core of this problem is a class loader issue.

What's true is that in the commons-logging code you get to a point where they are calling a class loader and that call returns (from the JVM) a null value which causes the exception.

What I've also found is that the latest version of commons-logging has altered this area of the code drastically (i.e. 1.1). The 3.X version of hibernate seems to contain commons-logging 1.0.4.

I would look for duplicate versions of commons-logging in your class path.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.