Issue Details (XML | Word | Printable)

Key: EJB-284
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Gary Ip
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
z - Hibernate Entity Manager

Scanning for META-INF/orm.xml does not work on Windows in EE mode

Created: 01/Apr/07 10:15 PM   Updated: 03/Jul/07 03:32 AM   Resolved: 03/Jul/07 03:32 AM
Component/s: EntityManager
Affects Version/s: 3.3.1.GA
Fix Version/s: 3.3.2.Beta1

Time Tracking:
Not Specified

File Attachments: 1. File petclinic.log.bz2 (4 kB)
2. File petclinic.z01 (5.86 MB)
3. Zip Archive petclinic.zip (4.27 MB)
4. Java Source File SeparatorTest.java (0.7 kB)

Environment:
Windows XP SP2
Tomcat 5.2.23
Spring 2.0.3
Hibernate Core 3.2.2.GA
Hibernate Annotations 3.3.0.GA
Hibernate EntityManager 3.3.1.GA
Issue Links:
Fix
 

Bug Testcase Reminder (view):
REMINDER: Bug reports should generally be accompanied by a test case
Participants: Christian Bauer, Emmanuel Bernard and Gary Ip


 Description  « Hide

In

org.hibernate.ejb.Ejb3Configuration: line: 606, method scanForXmlFiles(...),

Iterator it = ArchiveBrowser.getBrowser(
jar, new ArchiveBrowser.Filter() {
public boolean accept(String filename) { return (searchforHBMFiles && filename.endsWith( ".hbm.xml" ) ) || (searchforORMFiles && filename.endsWith( META_INF_ORM_XML ) ) ; }
}

filename passed in use "/" in *NIX environment, while "\" is used in Win32 environment. So orm.xml will be ignored in Win32 environment, as it will end with META-INF\orm.xml and won't be matched.



Emmanuel Bernard added a comment - 09/Apr/07 08:20 AM

Can you provide a runnable test case? The path should be normalized before so such problem should not appear


Gary Ip added a comment - 09/Apr/07 10:10 AM

You may need Spring 2.0.4 latest snapshot, as I tested with the hsqldb comes with Spring petclinic example.

Test environment:
Windows XP SP2
Tomcat 5.2.23

P.S. I have split the war file into two zip files, as JIRA restrict the upload size to 10MB.


Christian Bauer added a comment - 09/Apr/07 11:19 AM

Please attach a standalone testcase without Spring, WAR, etc.


Emmanuel Bernard added a comment - 09/Apr/07 06:03 PM

Hum, I suspect this is a bug related to how Spring treats URLs and propagate them to JPA.
can you set your logs to debug and report the log starting with
Processing PersistenceUnitInfo [

AFAIK an URL should not use \ unless it's encoded. And certainly it should not be considered a separator.


Gary Ip added a comment - 09/Apr/07 08:44 PM

A small Java program that simple prints all files searched from "file:///". It shows filename are using "\" rather than "/".

Tested with jboss-archive-browsing.jar that comes with HEM 3.3.1.GA.


Gary Ip added a comment - 09/Apr/07 09:09 PM

Here attached the log file as requested.


Emmanuel Bernard added a comment - 11/Apr/07 02:27 PM

Yes but the spec states that URL should be returned, not File objects


Emmanuel Bernard added a comment - 11/Apr/07 03:04 PM

OK the bug is in ArchiveBrowser, they actually do not abstract the path. Luckily for him, Bill is a thousand miles away from me at the moment.

i plan to get rid of ArchiveBrowser completly and use JarVisitor which has been more thoroughly tested.


Emmanuel Bernard added a comment - 02/Jul/07 07:36 AM

Hi Gary, can you give SVN head a try?
http://anonsvn.jboss.org/repos/hibernate/trunk/HibernateExt/

I've reworked the way archives are parsed (EJB-302). It should work fine now. I can't test on windows though


Gary Ip added a comment - 02/Jul/07 11:07 PM

Hi Emmanuel, I have tested the SVN head and worked. Thanks.


Emmanuel Bernard added a comment - 03/Jul/07 03:32 AM

Fantastic