geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "YunFeng Ma (JIRA)" <j...@apache.org>
Subject [jira] Commented: (GERONIMO-3317) "has not been enhanced" error when invoking an EJB 2.1 Entity Bean
Date Thu, 19 Jul 2007 02:07:04 GMT

    [ https://issues.apache.org/jira/browse/GERONIMO-3317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513788
] 

YunFeng Ma commented on GERONIMO-3317:
--------------------------------------

Hi Kevan,
After you deploy the sample, you run it with url http://localhost:8080/gvtlibraryWeb.  In
the home page, enter user Id with "admin" and password with "password", click "enter" button,
you will got the "has not been enhanced" error.

IIUC, this error will only happen when the application has only CMP entity beans, no JPA.
I made a bit of investigation with DayTrader. The configuration of DayTrader has two PersistenceUnitGBean,
one for the JPA and one for CMP. JPA PersistenceUnitGBean will be loaded before any entity
bean, but the CMP PersistenceUnitGBean always is loaded after the entity bean. So Daytrader
will not have the "has not been enhanced" error because the ClassTransformer has been installed
by the JPA PersistenceUnitGBean.

Maybe the patch should be changed to the following:

     public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection
repository) throws DeploymentException {
+        try {
+            //make sure the PersistenceUnitGBean is started before the Module GBean
+            if (earContext.findGBeans(new AbstractNameQuery(earContext.getConfigID(), Collections.EMPTY_MAP,
PersistenceUnitGBean.class.getName())).size() ==1) {
+                GBeanData moduleGBeanData = earContext.getGBeanInstance(module.getModuleName());
+                moduleGBeanData.addDependency(new AbstractNameQuery(earContext.getConfigID(),
Collections.EMPTY_MAP, PersistenceUnitGBean.class.getName()));
+            }
+        } catch (GBeanNotFoundException e) {
+            //Module GBean not found, do nothing
+        }
     }

What do you think?

> "has not been enhanced" error when invoking an EJB 2.1 Entity Bean
> ------------------------------------------------------------------
>
>                 Key: GERONIMO-3317
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3317
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: OpenEJB
>    Affects Versions: 2.0-M7
>            Reporter: Song
>            Assignee: Kevan Miller
>             Fix For: 2.0-M7
>
>         Attachments: GERONIMO-3317.patch
>
>
> My application could be deployed successfully. 
> But when launching an Entity Bean, "has not been enhanced" error is thrown:
> 17:07:58,593 ERROR [OpenEJB] The bean instances business method encountered a system
exception: The type "class openejb.gvtlibrary.EJBUser" has not been enhanced.
> <1.0.0-SNAPSHOT-SNAPSHOT fatal user error> org.apache.openjpa.persistence.ArgumentException:
The type "class openejb.gvtlibrary.EJBUser" has not been enhanced.
>         at org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1610)
>         at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1584)
>         at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:663)
>         at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:563)
>         at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:488)
>         at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:290)
>         at org.apache.openjpa.kernel.BrokerImpl.newObjectId(BrokerImpl.java:1089)
>         at org.apache.openjpa.kernel.DelegatingBroker.newObjectId(DelegatingBroker.java:257)
>         at org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.java:348)
>         at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.find(CMPEntityManagerTxScoped.java:125)
>         at org.apache.openejb.core.cmp.jpa.JpaCmpEngine.loadBean(JpaCmpEngine.java:171)
>         at org.apache.openejb.core.cmp.CmpContainer.findByPrimaryKey(CmpContainer.java:687)
>         at org.apache.openejb.core.cmp.CmpContainer.invoke(CmpContainer.java:284)
>         at org.apache.openejb.core.entity.EntityEjbHomeHandler.findX(EntityEjbHomeHandler.java:57)
>         at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:160)
>         at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:230)
>         at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
>         at $Proxy51.findByPrimaryKey(Unknown Source)
>         at javaUtility.EjbUtility.getUser(EjbUtility.java:105)
>         at servlets.WelcomeServlet.doPost(WelcomeServlet.java:71)
>         at servlets.GVTServlet.service(GVTServlet.java:89)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>         at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
>         at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:351)
>         at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:801)
> org.apache.openejb.InvalidateReferenceException: java.rmi.RemoteException: The bean encountered
a non-application exception.; nested exception is:
>         <1.0.0-SNAPSHOT-SNAPSHOT fatal user error> org.apache.openjpa.persistence.ArgumentException:
The type "class openejb.gvtlibrary.EJBUser" has not been enhanced.: The bean encountered a
non-application exception.; nested exception is:
>         <1.0.0-SNAPSHOT-SNAPSHOT fatal user error> org.apache.openjpa.persistence.ArgumentException:
The type "class openejb.gvtlibrary.EJBUser" has not been enhanced.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message