openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: OpenJPA 2.2.0-SNAPSHOT & Glassfish 3.1.1
Date Thu, 26 Jan 2012 16:55:29 GMT
Hi Francesco,
I'm not an expert with Glassfish, so I don't know if there any specific
steps to override the EclipseLink implementation.  I was only making an
assumption.  Maybe not an accurate assumption...

Is your persistence.xml specifying the openjpa persistence provider?  You
are definitely getting into the openjpa code base, so your configuration
must be pretty close.

But, getting a Stack Overflow error on a simple merge operation is kind of
indicating somebody or something is confused.  One of the uses of the
PersistenceUtil is used to help figure out if a given Entity instance is
being managed by a given provider.  Maybe EclipseLink and OpenJPA are
fighting over management of the merged entities.

Any additional debugging data would be good information.  Good luck.

Thanks,
Kevin

2012/1/26 Francesco Chicchiriccò <ilgrosso@apache.org>

> On 26/01/2012 17:18, Kevin Sutter wrote:
> > Hi,
> > Glassfish ships with EclipseLink (another JPA provider) by default.  If
> you
> > are attempting to use an alternate JPA provider (ie. OpenJPA), then have
> > you properly disabled or overloaded the EclipseLink impl with the OpenJPA
> > impl?
>
> Hi Kevin,
> nice question: how am I supposed to perform such task?
>
> Anyway, I did the same in the past for Hibernate and the steps reported
> below were enough.
>
> With current setup I have the following results:
>
> Tests run: 133, Failures: 6, Errors: 2, Skipped: 0
>
> This means that only some things are not working: I'll give them a
> closer look.
>
> Regards.
>
> > 2012/1/26 Francesco Chicchiriccò <ilgrosso@apache.org>
> >
> >> Hi all,
> >> I am trying to deploy my openjpa-based webapp to Glassfish 3.1.1
> >>
> >> A bare deploy of the same WAR working with Tomcat 7 simply fails.
> >>
> >> What I've done so far:
> >>
> >> 1. added WEB-INF/glassfish-web.xml like as follows:
> >>
> >> <glassfish-web-app>
> >>    <context-root>/syncope</context-root>
> >>    <resource-ref>
> >>        <res-ref-name>jdbc/syncopeDataSource</res-ref-name>
> >>        <jndi-name>jdbc/syncopeDataSource</jndi-name>
> >>    </resource-ref>
> >>    <class-loader delegate="false"/>
> >> </glassfish-web-app>
> >>
> >> The relevant stuff here is the delegating class-loader stuff, needed for
> >> letting Spring do its job.
> >>
> >> 2. added a property in persistence.xml in order to avoid to trigger
> >> EclipseLink's weaver, embedded in Glassfish (I am using build-time
> >> enhancement via openjpa-maven.plugin):
> >>
> >> <property name="eclipselink.weaving" value="false"/>
> >>
> >>
> >> With the settings above, many things in the application seem to work:
> >> unfortunately, when it comes to merge an entity, the following error is
> >> thrown:
> >>
> >> java.lang.StackOverflowError
> >>    at
> >>
> >>
> org.apache.openjpa.kernel.TransferFieldManager.storeObjectField(TransferFieldManager.java:115)
> >>    at
> >>
> >>
> org.apache.openjpa.kernel.StateManagerImpl.providedObjectField(StateManagerImpl.java:2166)
> >>    at
> >>
> >>
> org.syncope.core.persistence.beans.SchemaMapping.pcProvideField(SchemaMapping.java)
> >>    at
> >>
> >>
> org.apache.openjpa.kernel.StateManagerImpl.provideField(StateManagerImpl.java:3163)
> >>    at
> >>
> >>
> org.apache.openjpa.kernel.StateManagerImpl.fetchObjectField(StateManagerImpl.java:2392)
> >>    at
> >>
> >>
> org.apache.openjpa.kernel.StateManagerImpl.fetchField(StateManagerImpl.java:872)
> >>    at
> >>
> >>
> org.apache.openjpa.persistence.OpenJPAPersistenceUtil.isLoadedField(OpenJPAPersistenceUtil.java:200)
> >>    at
> >>
> >>
> org.apache.openjpa.persistence.OpenJPAPersistenceUtil.isLoaded(OpenJPAPersistenceUtil.java:161)
> >>    at
> >>
> >>
> org.apache.openjpa.persistence.OpenJPAPersistenceUtil.isLoadedArray(OpenJPAPersistenceUtil.java:265)
> >>    at
> >>
> >>
> org.apache.openjpa.persistence.OpenJPAPersistenceUtil.isLoadedCollection(OpenJPAPersistenceUtil.java:242)
> >>    at
> >>
> >>
> org.apache.openjpa.persistence.OpenJPAPersistenceUtil.isLoadedField(OpenJPAPersistenceUtil.java:212)
> >>    at
> >>
> >>
> org.apache.openjpa.persistence.OpenJPAPersistenceUtil.isLoaded(OpenJPAPersistenceUtil.java:161)
> >>    at
> >>
> >>
> org.apache.openjpa.persistence.OpenJPAPersistenceUtil.isLoadedArray(OpenJPAPersistenceUtil.java:265)
> >>    at
> >>
> >>
> org.apache.openjpa.persistence.OpenJPAPersistenceUtil.isLoadedCollection(OpenJPAPersistenceUtil.java:242)
> >>    at
> >>
> >>
> org.apache.openjpa.persistence.OpenJPAPersistenceUtil.isLoadedField(OpenJPAPersistenceUtil.java:212)
> >>    ...
> >>
> >> Any hint?
> >>
> >> TIA.
> >> Regards.
> --
> Francesco Chicchiriccò
>
> Apache Cocoon Committer and PMC Member
> http://people.apache.org/~ilgrosso/
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message