You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Krishnakumar B <ww...@gmail.com> on 2006/12/06 14:34:06 UTC

Help with simple JPA application in geronimo

Hi,

I am trying to deploy a simple JPA application in geronimo 2.0. I have
created a WAR that contains a Address class and persistence.xml. A
servlet needs to lookup this JPA and put address details in derby.

The web plan contains

  <nam:persistence-context-ref>
      <nam:persistence-context-ref-name>jpa/address</nam:persistence-context-ref-name>
      <nam:persistence-unit-name>addressjpa</nam:persistence-unit-name>
      <nam:persistence-context-type>transaction-scoped</nam:persistence-context-type>
  </nam:persistence-context-ref>

Deploying this i get errors.

Caused by: org.apache.xmlbeans.XmlException: Invalid deployment
descriptor: [error: cvc-elt.2: Element
'abstract-naming-entry@http://geronimo.apache.org/xml/ns/naming-1.2'
is abstract and cannot be used in an instance]
Descriptor: <xml-fragment
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2"
xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
  <nam:persistence-context-ref-name>jpa/address</nam:persistence-context-ref-name>
  <nam:persistence-unit-name>addressjpa</nam:persistence-unit-name>
  <nam:persistence-context-type>transaction-scoped</nam:persistence-context-type>
</xml-fragment>

Is this correct? Can i use JPA from a web application? Any pointers as
to how to write the geronimo plans?

Regards
Krish