-->
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.  [ 5 posts ] 
Author Message
 Post subject: Cant read the mappings after I put them in WEB-INF/lib
PostPosted: Wed Aug 10, 2005 4:09 pm 
Beginner
Beginner

Joined: Thu Jan 13, 2005 10:31 am
Posts: 20
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 4:43 pm 
Newbie

Joined: Fri Jan 07, 2005 5:46 pm
Posts: 19
Are you using '\' for mapping resources in your config file? Try '/' instead.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 4:51 pm 
Beginner
Beginner

Joined: Thu Jan 13, 2005 10:31 am
Posts: 20
One thing i forgot to mention is after putting all those files in a jar and putting it in WEB-INF/lib folder, i deleted those files from WEB-INF/classes folder. I know its is understood but just want to state it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 4:57 pm 
Beginner
Beginner

Joined: Thu Jan 13, 2005 10:31 am
Posts: 20
Quote:
Are you using '\' for mapping resources in your config file? Try '/' instead.


Yes I was using '\'. I changed it to '/' and it works perfect. Thanks. Do you know what is the reason?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 5:06 pm 
Newbie

Joined: Fri Jan 07, 2005 5:46 pm
Posts: 19
Well '\' is the Windows-only way, and '/' are used in URIs defined by [url http=http://www.ietf.org/rfc/rfc2396.txt]RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax[/url]. They are mapped to platform-specific naming conventions by the implementation.


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

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.