-->
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.  [ 3 posts ] 
Author Message
 Post subject: hibernate.cfg.xml not found
PostPosted: Tue Oct 18, 2005 2:47 am 
Beginner
Beginner

Joined: Mon Jun 06, 2005 4:23 am
Posts: 41
Location: Hagenberg, AUSTRIA
i'm getting the exception below when deploying an enterprise archive (ear). the ear consists of business.ejb3 (all non-persistent ejb3-classes), entities.par (all persistent classes) and a jar file with relevant class files.

during the deployment of entities.par the exception below occurs. the directory/file-structure of entities.par is as follows:

entities.par
|- META-INF
| |- persistence.xml
| |- hibernate.cfg.xml
| |- MANIFEST.MF
|- my package structure

what could be the reason why hibernate.cfg.xml cannot be found?

best regards
patrik

ps.:

here's my persistence.xml file
Code:
<?xml version="1.0" encoding="UTF-8"?>
<entity-manager>
   <name>IngresManager</name>
   <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <property name="hibernate.ejb.cfgfile" value="hibernate.cfg.xml"/>
      
   </properties>
</entity-manager>


and the hibernate.cfg.xml file
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.username">***</property>
        <property name="hibernate.connection.password">***</property>
        <property name="hibernate.dialect">org.hibernate.dialect.IngresDialect</property>
      <property name="hibernate.connection.url">jdbc:edbc://***.***.***.***:21071/dipasdem</property>
        <property name="hibernate.connection.driver_class">ca.edbc.jdbc.EdbcDriver</property>
        <property name="hibernate.jdbc.fetch_size">600</property>
        <property name="hibernate.cglib.use_reflection_optimizer">false</property>
        <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
        <property name="hibernate.connection.release_mode">after_statement</property>
        <property name="hibernate.transaction.flush_before_completion">true</property>
        <property name="hibernate.transaction.auto_close_session">true</property>
        <property name="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
      <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>       
      <property name="hibernate.show_sql">true</property>
      <property name="javax.persistence.provider">org.hibernate.ejb.HibernatePersistence</property>
    </session-factory>
</hibernate-configuration>


Hibernate version:
3.1rc1
Full stack trace of any exception that occurs:
Code:
08:30:47,675 INFO  [Ejb3Deployment] Found persistence.xml file in EJB3 jar
08:30:47,695 INFO  [Ejb3Configuration] found EJB3 Entity bean: ams.uptoip.model.Akten
08:30:47,695 INFO  [Ejb3Configuration] found EJB3 @EmbeddableSuperclass: ams.uptoip.model.Entity
08:30:47,695 INFO  [Ejb3Configuration] found EJB3 Entity bean: ams.uptoip.model.LegalEntity
08:30:47,695 INFO  [Ejb3Configuration] found EJB3 Entity bean: ams.uptoip.model.OmOcros
08:30:47,725 INFO  [Ejb3Configuration] found EJB3 Entity bean: ams.uptoip.model.OmOkopf
08:30:47,725 INFO  [Ejb3Configuration] found EJB3 Entity bean: ams.uptoip.model.OmOpos
08:30:47,735 INFO  [Ejb3Configuration] found EJB3 Entity bean: ams.uptoip.model.PvFamip
08:30:47,745 INFO  [Ejb3Configuration] found EJB3 Entity bean: ams.uptoip.model.PvStamp
08:30:47,745 INFO  [Configuration] configuring from resource: ./hibernate.cfg.xml
08:30:47,745 INFO  [Configuration] Configuration resource: hibernate.cfg.xml
08:30:47,755 WARN  [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=entities.par
org.hibernate.HibernateException: hibernate.cfg.xml not found
   at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
   at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1236)
   at org.hibernate.cfg.Configuration.configure(Configuration.java:1258)
   at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:378)
   at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:202)
   at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:78)
   at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:525)
   at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:264)
   at org.jboss.ejb3.Ejb3JmxDeployment.create(Ejb3JmxDeployment.java:230)
   at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:233)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:215)
   at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:950)
   at $Proxy0.create(Unknown Source)
   at org.jboss.system.ServiceController.create(ServiceController.java:342)
   at org.jboss.system.ServiceController.create(ServiceController.java:281)
   at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
   at $Proxy10.create(Unknown Source)
   at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:208)
   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:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
   at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
   at $Proxy11.create(Unknown Source)
   at org.jboss.deployment.MainDeployer.create(MainDeployer.java:919)
   at org.jboss.deployment.MainDeployer.create(MainDeployer.java:909)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:773)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
   at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
   at $Proxy6.deploy(Unknown Source)
   at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
   at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:483)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)

Name and version of the database you are using:
Computer Associates Ingers 2.6


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 3:14 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Try with /hibernate.cfg.xml
and put your hibernate.cfg.xml in the classpath, not the metainf

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 1:59 am 
Beginner
Beginner

Joined: Mon Jun 06, 2005 4:23 am
Posts: 41
Location: Hagenberg, AUSTRIA
i put it in the classpath, now it works...

for some reason it formerly worked when placing the cfg.xml-file in the meta-inf dir...


patrik


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.