Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

currentThread().getContextClassLoader().getResourceAsStream() doesn't work!

843802Sep 2 2010 — edited Sep 2 2010
After reading all this instructions about how to run an application that uses Eclipselink API in JWS offline mode:

http://forums.sun.com/thread.jspa?threadID=5403895;
http://forums.sun.com/thread.jspa?threadID=5404318;
https://bugs.eclipse.org/bugs/show_bug.cgi?id=287718;
http://dev.eclipse.org/newslists/news.eclipse.rt.eclipselink/msg00933.html.

I am still having problems!

Basically, the solution that solves all peoples problems was to look up the resource, in this case "META-INF/persistence.xml", using the command "Thread.currentThread().getContextClassLoader().getResourceAsStream(entryPath)".

After modifying all the required classes, the application throws a "[EclipseLink-8034] JPQLException - Unknow entity type [Entity]", wich I suppose that is because the application wasn't able to find the "persistence.xml" file and them couldn't "resolve" the type that I am trying to find in the database.

I am using the following Java/API versions:
- JRE 1.6.0_02-b06
- EclipseLink 2.1.0.v20100614-r7608


Thanks.

Edited by: eduardogdom on Sep 2, 2010 7:45 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 30 2010
Added on Sep 2 2010
1 comment
282 views