Issue 39 in simplejpa: Using EntityManagerFactoryImpl.newInstanceWithClassNames doesn't work on Mac OS

11 views
Skip to first unread message

simp...@googlecode.com

unread,
May 4, 2011, 2:35:51 AM5/4/11
to simp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 39 by ad...@albriggs.com: Using
EntityManagerFactoryImpl.newInstanceWithClassNames doesn't work on Mac OS
http://code.google.com/p/simplejpa/issues/detail?id=39

What steps will reproduce the problem?
1.Call the method EntityManagerFactoryImpl.newInstanceWithClassNames with a
list of class names that are located in a jar file and run on MAC OS X
2.Run a query against the EntityManager referencing one of the classes
loaded from the jar file - exception thrown with file not found.

What is the expected output?
Should run without exception
What do you see instead?
A FileNotFoundException

What version of the product are you using? On what operating system?
1.6-SNAPSHOT on OSX 10.6.7

Please provide any additional information below.
The problem is actually caused in the method getLibsToScan

the line :

libs.add(resource.getFile().split("!")[0].substring(6));

is stripping off the leading slash so that

file:/Users/..... becomes Users/.....

this maybe what is required on Windows, but breaks on Mac OS and possibly
also on *nix

Changing the line to:

libs.add(resource.getFile().split("!")[0].substring(5));

solves the problem but I would like someone to test on Windows before I
commit the change.


simp...@googlecode.com

unread,
May 4, 2011, 2:31:40 PM5/4/11
to simp...@googlegroups.com

Comment #1 on issue 39 by ad...@albriggs.com: Using
EntityManagerFactoryImpl.newInstanceWithClassNames doesn't work on Mac OS
http://code.google.com/p/simplejpa/issues/detail?id=39

Added at github: https://github.com/appoxy/simplejpa/issues/1

Reply all
Reply to author
Forward
0 new messages