Hibernate version:3.2.1
Full stack trace of any exception that occurs:
01/23 19:30:52 info [axis] Factory name: java:comp/env/yassan
01/23 19:30:52 info [axis] JNDI InitialContext properties:{}
01/23 19:30:52 info [axis] Returning a Reference to the SessionFactory
01/23 19:30:52 info [axis] Bound factory to JNDI name: java:comp/env/yassan
01/23 19:30:52 warning [axis] InitialContext did not implement EventContext
01/23 19:30:52 info [axis] instantiated session factory
01/23 19:30:53 info [axis] Running hbm2ddl schema export
01/23 19:30:53 info [axis] exporting generated schema to database
01/23 19:30:53 info [axis] schema export complete
01/23 19:30:53 info [axis] obtaining JTA TransactionManager
01/23 19:30:53 info [axis] JNDI InitialContext properties:{}
01/23 19:30:53 info [axis] Checking 0 named HQL queries
01/23 19:30:53 info [axis] Checking 0 named SQL queries
01/23 19:30:53 error [axis] execute: Error while performing request
org.apache.xmlrpc.XmlRpcException: Failed to invoke method login in class com.eidai.wp.procedure.User: Unable to locate current JTA transaction
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:122)
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:102)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:43)
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:79)
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:182)
at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:103)
at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:117)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Caused by:
org.hibernate.HibernateException: Unable to locate current JTA transaction
at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:555)
at com.eidai.wp.procedure.User.login(User.java:25)
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:324)
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:111)
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:102)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:43)
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:79)
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:182)
at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:103)
at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:117)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Name and version of the database you are using:MySQL 3.23.58-nt
Debug level Hibernate log excerpt:info
I made a configuration for this application like that.
hibernate.cfg.xml
<hibernate-configuration>
<session-factory name="java:comp/env/yassan">
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/yassan?useUnicode=true&characterEncoding=UTF-8</property>
<property name="hibernate.connection.username">yassan</property>
<property name="hibernate.connection.password">yassan</property>
<property name="hibernate.jdbc.fetch_size">0</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JRun4TransactionManagerLookup</property>
<property name="hibernate.current_session_context_class">jta</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">create</property>
<property name="hibernate.c3p0.max_size">10</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statements">0</property>
<mapping resource="com/eidai/wp/model/Mt_user.hbm.xml"/>
</session-factory>
</hibernate-configuration>
and
new Configuration().configure().buildSessionFactory().currentSession();
An exception above was thrown at this code.
Do not anyone know what's the probrem.
thanks.
Read this:
http://hibernate.org/42.html