Hi folks,
I have the following error when i try to use hibernate with Java Sun Application Server:
Possible Source of Error:
Class Name: net.sf.hibernate.transaction.TransactionFactoryFactory
File Name: TransactionFactoryFactory.java
Method Name: buildTransactionFactory
Line Number: 34
51: cfg.configure();
52: else
53: cfg.configure(configFileName);
54: setSessionFactory(configFileName, cfg.buildSessionFactory());
55: }
56: }
57:
Stack Trace:
net.sf.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:34)
net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:77)
net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1172)
net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:803)
amanda.base._BaseRootDAO.initialize(_BaseRootDAO.java:54)
amanda.base._BaseRootDAO.initialize(_BaseRootDAO.java:38)
cacharreo.Page1.button1_action(Page1.java:131)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
javax.faces.component.UICommand.broadcast(UICommand.java:312)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
java.security.AccessController.doPrivileged(AccessController.java:-2)
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
java.security.AccessController.doPrivileged(AccessController.java:-2)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
java.lang.Thread.run(Thread.java:534)
The code that uses hibernate runs ok as a desktop application, but when I try tu use it in a web application, it simply doesn't work.
this is the hibernate.cfg.xml that I use:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory >
<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost:1433/amanda</property>
<property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password">sa</property>
<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for Microsoft SQL Server -->
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_outer_join">true</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.SunONETransactionManagerLookup</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<mapping resource="amanda/Users.hbm" />
</session-factory>
</hibernate-configuration>
Could you please give me any help??
thanks a lot!
|