-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate with Axis2
PostPosted: Thu Aug 21, 2008 2:38 am 
Newbie

Joined: Thu Aug 21, 2008 2:34 am
Posts: 1
I am try to write sample using Hibernate with Axis2. But I have the following errors:
Caused by: java.lang.ExceptionInInitializerError
at org.test.persistence.HibernateUtil.createSessionFactory(HibernateUtil
.java:15)
at org.test.dao.implement.AdminDaoImpl.getAdmins(AdminDaoImpl.java:49)
... 27 more

(Caused by org.apache.commons.logging.LogConfigurationExcep
tion: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.)

this is services.xml
<service name="AdminService" scope="application"
targetNamespace="http://implement.dao.test.org/"
class="org.test.dao.implement.AdminDaoImpl">
<description> Sample service to demonstrate Axis2 with Hibernate </description>
<schema schemaNamespace="http://implement.dao.test.org/"/>
<parameter name="ServiceTCCL" locked="false">composite</parameter>
<parameter name="ServiceClass" locked="false">
org.test.dao.implement.AdminDaoImpl</parameter>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
</service>

HibernateUtil.java
package org.test.persistence;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {

private static SessionFactory sessionFactory;

public static void createSessionFactory() {
try {
sessionFactory = new Configuration().configure()
.buildSessionFactory();
} catch (Exception e) {
}

}

public static Session getSession() {
return sessionFactory.openSession();
}
}

I don't know how to load xml configuration, if you have sample and link, please send it to me: trinhnt@gmail.com Thanks so much!!!


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

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.