Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 2.14
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I am using Hibernate with my web application and it is working perfect. in my web application's WAR folder, hibernate.cfg.xml is in the WEB-INF\classes folder while the domain classes (*.class) and their respective mapping files (*.hbm.xml) are also located under WEB-INF\classes folder.
Now I have created a jar file which include all domain classes and mapping files. I have put it in WEB-INF\lib folder. I start JBoss and hibernate gives me an error message when it try to read the very first mapping file in my hibernate.cfg.xml:
2005-08-10 15:59:21,333 INFO [net.sf.hibernate.cfg.Environment] Hibernate 2.1.4
2005-08-10 15:59:21,349 INFO [net.sf.hibernate.cfg.Environment] hibernate.properties not found
2005-08-10 15:59:21,349 INFO [net.sf.hibernate.cfg.Environment] using CGLIB reflection optimizer
2005-08-10 15:59:21,364 INFO [net.sf.hibernate.cfg.Configuration] configuring from resource: /hibernate.cfg.xml
2005-08-10 15:59:21,364 INFO [net.sf.hibernate.cfg.Configuration] Configuration resource: /hibernate.cfg.xml
2005-08-10 15:59:21,474 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate
http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath under net/sf/hibernate/
2005-08-10 15:59:21,474 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found
http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath
2005-08-10 15:59:21,536 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.connection.datasource=java:/SchedulerDB
2005-08-10 15:59:21,536 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
2005-08-10 15:59:21,536 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup
2005-08-10 15:59:21,536 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect
2005-08-10 15:59:21,536 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'
2005-08-10 15:59:21,536 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.show_sql=false
2005-08-10 15:59:21,536 DEBUG [net.sf.hibernate.cfg.Configuration] java:/hibernate/HibernateFactory<-org.dom4j.tree.DefaultAttribute@171b246 [Attribute: name resource value "com\pendylum\main\model\CdAccumulatorType.hbm.xml"]
2005-08-10 15:59:21,536 INFO [net.sf.hibernate.cfg.Configuration] Mapping resource: com\pendylum\main\model\CdAccumulatorType.hbm.xml
2005-08-10 15:59:21,567 INFO [STDOUT] HibernateHelper: Static Initializer Block failed.
2005-08-10 15:59:21,567 INFO [STDOUT] net.sf.hibernate.MappingException: Resource: com\pendylum\main\model\CdAccumulatorType.hbm.xml not found
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:331)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at com.pendylum.main.session.HibernateHelper.<clinit>(HibernateHelper.java:40)
at com.pendylum.scheduler.ejb.ShiftManager.updateShift(ShiftManager.java:2359)
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.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy98.updateShift(Unknown Source)
at com.pendylum.scheduler.delegate.ShiftDelegate.updateShift(ShiftDelegate.java:60)
at org.apache.jsp.schShiftUpdate_jsp._jspService(Unknown Source)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
2005-08-10 15:59:21,583 ERROR [org.jboss.ejb.plugins.LogInterceptor] Unexpected Error:
What I am doing wrong here? Thank