[
https://issues.apache.org/jira/browse/GERONIMO-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485049
]
Jay D. McHugh commented on GERONIMO-3017:
-----------------------------------------
Even though the persistence.xml file is found and appears to be getting parsed,
the entity classes do not seem to be getting properly processed.
They are counted and the geronimo log indicates that the classes are being
enhanced - but:
When an entity manager tries to actually use them, they report that they have
never been enhanced.
<snippet of log at deploy time>
location:
file:/opt/geronimo-tomcat6-jee5-2.0-SNAPSHOT/repository/palm/trees/1.1/trees-1.1.war/WEB-INF/classes/META-INF/persistence.xml
base:
file:/opt/geronimo-tomcat6-jee5-2.0-SNAPSHOT/repository/palm/trees/1.1/trees-1.1.war/
base.len: 85
pos: 0
endPos: 85
relative should be location(85, 85)
13 TRACE [RMI TCP Connection(16)-127.0.0.1] openjpa.Runtime - Setting the
following properties from "?" into configuration: {openjpa.DataCache=false,
openjpa.jdbc.DBDictionary=mysql(SupportsSubselect=true),
openjpa.FetchBatchSize=0, openjpa.ConnectionUserName=plcData,
openjpa.Optimistic=true, openjpa.ConnectionPassword=plcPassword,
openjpa.MetaDataFactory=Types=com.pubint.ejb.entity.Attrib;com.pubint.ejb.entity.AttribValue;com.pubint.ejb.entity.Component;com.pubint.ejb.entity.ComponentClass;com.pubint.ejb.entity.Customer;com.pubint.ejb.entity.Generic;com.pubint.ejb.entity.GenericComponent;com.pubint.ejb.entity.GenericDetail;com.pubint.ejb.entity.Option;com.pubint.ejb.entity.OptionDetail;com.pubint.ejb.entity.ProductCategory;com.pubint.ejb.entity.ProductLine;com.pubint.ejb.entity.ProductGroup;com.pubint.ejb.entity.Project;com.pubint.ejb.entity.ProjectDetail;com.pubint.ejb.entity.SysConfig;com.pubint.ejb.entity.User;com.pubint.ejb.entity.Vendor;com.pubint.ejb.entity.XAttribValue;com.pubint.ejb.entity.XCatLine;com.pubint.ejb.entity.XClassAttrib;com.pubint.ejb.entity.XCompAttrib;com.pubint.ejb.entity.XGCompAttrib;com.pubint.ejb.entity.XGenericDetail;com.pubint.ejb.entity.XLineGroup;com.pubint.ejb.entity.XOptionDetail;com.pubint.ejb.entity.XProjCustomer;com.pubint.ejb.entity.XProjDetail;com.pubint.ejb.entity.XScheduleDetail;com.pubint.ejb.entity.XVendContact,
javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl,
openjpa.ConnectionURL=jdbc:mysql:/localhost:3306/plc,
openjpa.TransactionMode=managed, openjpa.RestoreState=all, [EMAIL PROTECTED],
openjpa.OrphanedKeyAction=log, openjpa.NontransactionalRead=true,
openjpa.Log=DefaultLevel=TRACE, openjpa.AutoDetach=close,
openjpa.DetachState=all, openjpa.Multithreaded=true,
openjpa.ConnectionDriverName=com.mysql.jdbc.Driver, openjpa.MaxFetchDepth=1}
1450 INFO [RMI TCP Connection(16)-127.0.0.1] openjpa.MetaData - Found 30
classes with metadata in 1183 milliseconds.
0 TRACE [RMI TCP Connection(16)-127.0.0.1] openjpa.Runtime - Setting the
following properties from "?" into configuration: {openjpa.DataCache=false,
openjpa.jdbc.DBDictionary=mysql(SupportsSubselect=true),
openjpa.FetchBatchSize=0, openjpa.BrokerFactory=jdbc,
openjpa.ConnectionUserName=user, openjpa.Optimistic=true,
openjpa.ConnectionPassword=password,
openjpa.MetaDataFactory=Types=com.pubint.ejb.entity.Attrib;com.pubint.ejb.entity.AttribValue;com.pubint.ejb.entity.Component;com.pubint.ejb.entity.ComponentClass;com.pubint.ejb.entity.Customer;com.pubint.ejb.entity.Generic;com.pubint.ejb.entity.GenericComponent;com.pubint.ejb.entity.GenericDetail;com.pubint.ejb.entity.Option;com.pubint.ejb.entity.OptionDetail;com.pubint.ejb.entity.ProductCategory;com.pubint.ejb.entity.ProductLine;com.pubint.ejb.entity.ProductGroup;com.pubint.ejb.entity.Project;com.pubint.ejb.entity.ProjectDetail;com.pubint.ejb.entity.SysConfig;com.pubint.ejb.entity.User;com.pubint.ejb.entity.Vendor;com.pubint.ejb.entity.XAttribValue;com.pubint.ejb.entity.XCatLine;com.pubint.ejb.entity.XClassAttrib;com.pubint.ejb.entity.XCompAttrib;com.pubint.ejb.entity.XGCompAttrib;com.pubint.ejb.entity.XGenericDetail;com.pubint.ejb.entity.XLineGroup;com.pubint.ejb.entity.XOptionDetail;com.pubint.ejb.entity.XProjCustomer;com.pubint.ejb.entity.XProjDetail;com.pubint.ejb.entity.XScheduleDetail;com.pubint.ejb.entity.XVendContact,
javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl,
openjpa.ConnectionURL=jdbc:mysql:/localhost:3306/plc,
openjpa.TransactionMode=managed, openjpa.RestoreState=all, [EMAIL PROTECTED],
openjpa.OrphanedKeyAction=log, openjpa.NontransactionalRead=true,
openjpa.Log=DefaultLevel=TRACE, openjpa.AutoDetach=close,
openjpa.DetachState=all, openjpa.Multithreaded=true,
openjpa.ConnectionDriverName=com.mysql.jdbc.Driver, openjpa.MaxFetchDepth=1}
</snippet of log at deploy time>
<snippet of log when a servlet containing an entity manager is loaded>
6247 TRACE [http-0.0.0.0-8080-1] openjpa.Enhance -
"com/pubint/ejb/entity/Project" requires runtime enhancement: true
56514 TRACE [http-0.0.0.0-8080-1] openjpa.MetaData - Loading metadata for
"class com.pubint.ejb.entity.Project" under mode "[META][QUERY]".
56514 INFO [http-0.0.0.0-8080-1] openjpa.MetaData - Parsing class
"com.pubint.ejb.entity.Project".
56515 TRACE [http-0.0.0.0-8080-1] openjpa.Enhance - Enhancing type "class
com.pubint.ejb.entity.Project".
56623 WARN [http-0.0.0.0-8080-1] openjpa.Enhance - Type "class
com.pubint.ejb.entity.Project" has no metadata; enhancing as persistence aware.
If you intended for "class com.pubint.ejb.entity.Project" to be
persistence-capable, then this means that OpenJPA could not find any metadata
for "class com.pubint.ejb.entity.Project". This can happen if the directory
containing your metadata is not in your CLASSPATH, or if your metadata files
are not named properly. See the documentation on metadata placement for more
information.
</snippet of log when a servlet containing an entity manager is loaded>
<snippet of log when the servlet attempts to issue a query against the entity
manager>
7476 TRACE [http-0.0.0.0-8080-1] openjpa.MetaData - Loading metadata for
"class com.pubint.ejb.entity.Project" under mode "[META][QUERY]".
7655 INFO [http-0.0.0.0-8080-1] openjpa.MetaData - Parsing class
"com.pubint.ejb.entity.Project".
7656 INFO [http-0.0.0.0-8080-1] openjpa.MetaData - Parsing package
"com.pubint.ejb.entity.Project".
7897 TRACE [http-0.0.0.0-8080-1] openjpa.MetaData - Generating default
metadata for type "com.pubint.ejb.entity.Project".
7897 TRACE [http-0.0.0.0-8080-1] openjpa.MetaData - Using reflection for
metadata generation.
8155 TRACE [http-0.0.0.0-8080-1] openjpa.MetaData - Set persistence-capable
superclass of "com.pubint.ejb.entity.Project" to "null".
8156 TRACE [http-0.0.0.0-8080-1] openjpa.MetaData - Resolving metadata for
"[EMAIL PROTECTED]".
21:06:38,579 ERROR [[Project]] Servlet.service() for servlet Project threw
exception
<4|true|0.9.6-incubating> org.apache.openjpa.persistence.ArgumentException: The
type "class com.pubint.ejb.entity.Project" has not been enhanced.
at
org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1590)
at
org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1564)
at
org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:654)
at
org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:554)
at
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:479)
at
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:283)
at
org.apache.openjpa.kernel.BrokerImpl.newObjectId(BrokerImpl.java:1078)
at
org.apache.openjpa.kernel.DelegatingBroker.newObjectId(DelegatingBroker.java:254)
at
org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.java:319)
at com.pubint.ui.ProjectUI.processXML(ProjectUI.java:529)
at com.pubint.ui.ProjectUI.doProcess(ProjectUI.java:605)
at com.pubint.ui.ProjectUI.doPost(ProjectUI.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
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:228)
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:324)
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:543)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:595)
</snippet of log when the servlet attempts to issue a query against the entity
manager>
> Web Apps (WAR files) that directly contain JPA entities cannot be deployed
> --------------------------------------------------------------------------
>
> Key: GERONIMO-3017
> URL: https://issues.apache.org/jira/browse/GERONIMO-3017
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: persistence
> Affects Versions: 2.0-M5
> Reporter: Jay D. McHugh
> Attachments: geronimo-jira-3017.patch
>
>
> There is still a find and parse problem with persistence.xml in war files.
> It seems to work if you have your jpa entities in a jar file.
> But, if you have a WEB-INF/lib/META-INF/persistence.xml file, it finds it and
> dies with a substring error.
> I have not tested to see if this is a problem for WAR files contained in an
> EAR.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.