users@glassfish.java.net

GF3 + OpenJPA 2.0 - Enhancer not working

From: <glassfish_at_javadesktop.org>
Date: Mon, 19 Jul 2010 06:09:20 PDT

Hello,

I have a Glassfishv3 running here and *need* to use OpenJPA-2.0.0.

I'm currently having two different setups in our persistence.xml; here's the working one:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
        
        <persistence-unit name="myApplicationPersistenceUnit" transaction-type="RESOURCE_LOCAL">
                <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
                <jta-data-source>jdbc/MyDataSource</jta-data-source>
                <properties>
                        <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
                        <!-- <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/> -->
                </properties>
        </persistence-unit>
</persistence>

This one has the disadvantage, that the entity classes used (here: Class1 and Class2) need to be listed twice (in persistence.xml and pom.xml), to configure the Enhancer outside of Glassfish and push the results into OpenJPA's MetaDataFactory. Of course, keeping two lists of classes up to date is error prone, especially as the following error is produced, if this step is omitted or some classes are forgotten:

<openjpa-2.0.0-r422266:935683 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter "SELECT g FROM Class1 g ORDER BY g.dateCreated DESC". Error message: The name "Class1" is not a recognized entity or identifier. Known entity names: []
        at org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(AbstractExpressionBuilder.java:119)
        at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:197)
        at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:167)
        at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:242)
        at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:212)
        at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JPQLExpressionBuilder.java:205)
        at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$200(JPQLExpressionBuilder.java:81)
        at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(JPQLExpressionBuilder.java:2387)
        at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:61)
        at org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(ExpressionStoreQuery.java:154)
        at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:671)
        at org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:652)
        at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:618)
        at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:680)
        at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:587)
        at org.apache.openjpa.persistence.EntityManagerImpl.createQuery(EntityManagerImpl.java:985)
        at org.apache.openjpa.persistence.EntityManagerImpl.createQuery(EntityManagerImpl.java:971)
        at org.apache.openjpa.persistence.EntityManagerImpl.createQuery(EntityManagerImpl.java:100)
        at my.domain.database.DatabaseAccess.getAllClass1(DatabaseAccess.java:159)
        at my.domain.portlets.MyPortlet.doView(MyPortlet.java:74)
        at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
        at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:66)
        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:91)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
        at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:802)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:619)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:549)
        at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:630)
        at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:713)
        at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:426)
        at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java from :1414)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:406)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:483)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:373)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
        at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:802)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:619)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:549)
        at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:3616)
        at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1110)
        at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:162)
        at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:96)
        at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:261)
        at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:183)
        at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java from :815)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:406)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:483)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:373)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
        at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:802)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:619)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:549)
        at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:342)
        at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:599)
        at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:219)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
        at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:154)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
        at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:504)
        at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:481)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:139)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:254)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:800)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:497)
        at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:468)
        at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:364)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:314)
        at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:135)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:128)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:213)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:387)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:47)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:254)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:800)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:497)
        at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:468)
        at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:364)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:314)
        at com.liferay.portal.servlet.I18nServlet.service(I18nServlet.java:101)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:181)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:243)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:179)
        at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.processFilter(ThreadLocalFilter.java:37)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:619)
|#]

Now, we want to use Glassfish's automatic Enhancer support, as there seems to be a requirement to do so for JavaEE 5 compatible app servers (see: http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_pc_enhance.html#ref_guide_pc_enhance_runtime_container).

As the just copying the openjpa lib (plus required serp-1.13.1 library) to Glassfish's\domains\domain1\lib directory doesn't seem to help, I installed the OSGi-compatible packages (it also requires commons-lang-2.4.0, commons-collections-3.2.1, commons-logging-1.1.1, commons-pool-1.5.3 as well as serp-1.13.1; all obtained from springsource.com) and used the following persistence.xml:

<persistence
        xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
                http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
        version="1.0">

        <persistence-unit name="myApplicationPersistenceUnit">
                <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
                <jta-data-source>jdbc/MyDataSource</jta-data-source>
                <properties>
                        <property name="openjpa.TransactionMode" value="managed"/>
                        <property name="openjpa.ConnectionFactoryMode" value="managed"/>
                    <property name="openjpa.jdbc.DBDictionary" value="mysql"/>
                    
                    <property name="openjpa.MetaDataFactory" value="jpa(Types=my.domain.entity.Class1;my.domain.entity.Class2)"/>
                    
                        <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
                </properties>
        </persistence-unit>
</persistence>

(Note: This persistence.xml was inspired by a IBM WebSphere 6.1 article, (although WebSphere 7 is our client's target platform; see: http://www.ibm.com/developerworks/websphere/techjournal/0612_barcia/0612_barcia.html)

After installing all the libraries through felix's admin web app, all bundles were shown to be actived, but when deploying the application, the following Exception came up:

[#|2010-07-13T14:02:17.996+0000|SEVERE|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=26;_ThreadName=Thread-1;|WebModule[/myApplication]PWC1396: Servlet /myApplication threw load() exception
com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class my.domain.servlets.Servlets1
        at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:312)
        at com.sun.enterprise.web.WebContainer.createServletInstance(WebContainer.java:700)
        at com.sun.enterprise.web.WebModule.createServletInstance(WebModule.java:1937)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1252)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1229)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4934)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5207)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:499)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1933)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1605)
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)
        at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
        at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
        at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:310)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
        at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:141)
        at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:573)
        at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:459)
        at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:391)
        at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:376)
        at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:195)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:303)
        ... 32 more
Caused by: java.lang.NoClassDefFoundError: serp/util/Strings
        at org.apache.openjpa.lib.conf.Configurations.newInstance(Configurations.java:200)
        at org.apache.openjpa.lib.conf.ObjectValue.newInstance(ObjectValue.java:124)
        at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:103)
        at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
        at org.apache.openjpa.lib.conf.ConfigurationImpl.getLogFactory(ConfigurationImpl.java:209)
        at org.apache.openjpa.lib.conf.ConfigurationImpl.getLog(ConfigurationImpl.java:226)
        at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getConfigurationLog(OpenJPAConfigurationImpl.java:1619)
        at org.apache.openjpa.lib.conf.ConfigurationImpl.loadGlobals(ConfigurationImpl.java:191)
        at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.<init>(JDBCConfigurationImpl.java:366)
        at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.<init>(JDBCConfigurationImpl.java:108)
        at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.<init>(JDBCConfigurationImpl.java:99)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(JDBCBrokerFactory.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:124)
        at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:62)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(PersistenceProviderImpl.java:148)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:94)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:154)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:65)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:78)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
        at my.domain.database.DatabaseAccess.getEntityManagerPersistenceUnit(DatabaseAccess.java:36)
        at my.domain.database.DatabaseAccess.<init>(DatabaseAccess.java:19)
        at my.domain.database.DatabaseAccess.getInstance(DatabaseAccess.java:23)
        at my.domain.servlets.Servlets1<init>(Servlets1.java:36)
        ... 37 more
|#]


As a result, I have two questions:
1) how do I enable OpenJPA's Enhancer to run at deployment time?
2) if question 1) requires the installment of OpenJPA-2.0.0 as a OSGi bundle, what else do I need to do to get it running?

Note 1: no, I cannot use Glassfishv3's integrated toplink support, as our target platform is IBM WebSphere 7 w/ OpenJPA
Note 2: this post will be cross-posted at OpenJPA in a few minutes; maybe that's going to fasten the whole thing up. I'll report it here, if something happens

Thanks a lot for your support and please do not hesitate to ask for anything else you might need to understand or help.

kniffte
[Message sent by forum member 'kniffte']

http://forums.java.net/jive/thread.jspa?messageID=477961