Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using EntityManagerFactoryImpl.newInstanceWithClassNames doesn't work on Mac OS #1

Open
grouchal opened this issue May 4, 2011 · 0 comments

Comments

@grouchal
Copy link
Contributor

grouchal commented May 4, 2011

NB This is Issue 39 at google code: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant