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!!!