GeeCON Prague 2014*
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


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
Author

websphere 7 and (application based) open-jpa 2

morgan dowell
Greenhorn

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
Greenhorn

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.
 
GeeCON Prague 2014
 
subject: websphere 7 and (application based) open-jpa 2