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.
Added at github: https://github.com/appoxy/simplejpa/issues/1