This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Websphere and the fly likes websphere 7 and (application based) open-jpa 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "websphere 7 and (application based) open-jpa 2" Watch "websphere 7 and (application based) open-jpa 2" New topic

websphere 7 and (application based) open-jpa 2

morgan dowell

Joined: Aug 24, 2011
Posts: 5
I want to not use the built in Websphere 7 jpa plugin, instead use an application WEB-INF/lib/open-jpa 2 and a proprietary persistence provider. I cannot install the OSGI and JPA 2 feature pack for Websphere.

Originally, I was getting a sax parse error simply trying to load the persistence.xml (version="2" not supported). The error was thrown by a class in open-jpa 1.2.3. When I run websphere/appserver/bin/wsjpaversion.bat, the open-jpa 1.2.3 jar is displayed. By default it overrides the open-jpa 2 jar in the app. I created a shared library containing the open-jpa 2 jar with this config option checked: 'Use an isolated class loader for this shared library'. I set my application classloader to load parent last and assigned it the new shared library resource. The 'version 2' error is gone, but there is another problem. When I try to initialize an EntityManager I get an error:

One more detail: inside the persistence.xml, the provider element is set to the proprietary PersistenceProviderImpl not the default Websphere persistence provider. So where is this websphere default coming from and how do I prevent it? (another important note: when I remove persistence.xml completely, I get the same error)

Thank you
morgan dowell

Joined: Aug 24, 2011
Posts: 5
I ended up using the service pack. I found that JPA version is too deeply ingrained in WAS to change this without significant work and blatant misuse.
jQuery in Action, 2nd edition
subject: websphere 7 and (application based) open-jpa 2
Similar Threads
Deployement problem in oc4j with hibernate + JPA and Spring
Application-Managed Transaction without joining
Unable to deploy first enterprise application EJB 3.0
Error caused by persistence.xml
No Persistence provider for EntityManager