[jboss-jira] [JBoss JIRA] Created: (HIBERNATE-71) ".." in relative path to orm.xml not properly recognized

Ronald Fischer (JIRA) jira-events at lists.jboss.org
Mon Sep 3 07:48:18 EDT 2007


".." in relative path to orm.xml not properly recognized
--------------------------------------------------------

                 Key: HIBERNATE-71
                 URL: http://jira.jboss.com/jira/browse/HIBERNATE-71
             Project: Hibernate
          Issue Type: Bug
         Environment: Windows XP
            Reporter: Ronald Fischer
         Assigned To: Steve Ebersole


I have the following files:

\thome\tmp\MyApplication.class
\thome\tmp\META-INF\persistence.xml
\thome\etc\orm.xml

The file persistence.xml contains the line

           <mapping-file>../etc/orm.xml</mapping-file>

The directory \thome\tmp is in my classpath.

MyApplication.class throws exception

     [java] log4j:WARN Please initialize the log4j system properly.             
     [java] Exception in thread "main" javax.persistence.PersistenceException: [
PersistenceUnit: TFW_InsertMasterData_SCM] Unable to find XML mapping file in cl
asspath: /../etc/orm.xml                                                        
     [java]     at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactor
y(Ejb3Configuration.java:914)                                                   
     [java]     at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configurati
on.java:772)                                                                    
     [java]     at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configurati
on.java:183)                                                                    
     [java]     at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configurati
on.java:240)                                                                    
     [java]     at org.hibernate.ejb.HibernatePersistence.createEntityManagerFac
tory(HibernatePersistence.java:120)                                             
     [java]     at javax.persistence.Persistence.createEntityManagerFactory(Pers
istence.java:51)                                                                
     [java]     at javax.persistence.Persistence.createEntityManagerFactory(Pers
istence.java:33)                                                                
     [java]     at InsertMasterData.main(InsertMasterData.java:27)              
                              
When I copy orm.xml into my META-INF  directory and change my persistence.xml
to 

           <mapping-file>/META-INF/orm.xml</mapping-file>

everything works fine.

>From this I conclude that Hibernate can not follow a path starting with .. to find the
mapping file.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list