You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Huylebroeck Johan <Jo...@i8c.be> on 2012/07/05 08:31:29 UTC

PersistenceDescriptorParserImpl and handling namespaces in persistence.xml

Hello,
I'm using aries-jpa 0.3 with service mix. If I use a persistence.xml where the elements are prefixed by a namespace as in:
<pers:persistence xmlns:pers="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<http://java.sun.com/xml/ns/persistence%20http:/java.sun.com/xml/ns/persistence/persistence_1_0.xsd>"
   version="1.0">

  <pers:persistence-unit name="alpha">
    <pers:properties>
      <pers:property name="javax.persistence.jdbc.driver" value="alpha.db.class"/>
      <pers:property name="javax.persistence.jdbc.url" value="jdbc:alpha:url"/>
      <pers:property name="javax.persistence.jdbc.user" value="alan"/>
      <pers:property name="javax.persistence.jdbc.password" value="4l4n"/>
    </pers:properties>
  </pers:persistence-unit>

</pers:persistence>

It is rejected by the PersistenceDescriptorParser, AFAIK using a prefix is valid and should be accepted.

If it is indeed a bug and not 'works as intended' I believe it can easily be fixed by making the parser namespace-aware.
I can send you a patch with tests if you are interested.

Cheers,

Johan Huylebroeck

http://www.i8c.be/integr8-consulting


RE: PersistenceDescriptorParserImpl and handling namespaces in persistence.xml

Posted by Huylebroeck Johan <Jo...@i8c.be>.
Hi,
I created a jira ticket (ARIES-872) like you suggested and included my patch with tests.

Regards,

Johan

From: timothyjward@hotmail.com [mailto:timothyjward@hotmail.com] On Behalf Of Timothy Ward
Sent: dinsdag 10 juli 2012 11:17
To: user@aries.apache.org; Huylebroeck Johan
Subject: RE: PersistenceDescriptorParserImpl and handling namespaces in persistence.xml

Hi Johan,

We always welcome patches and bugs! If you would like to contribute then the best way would be to raise a bug against the JPA component of Aries in JIRA http://issues.apache.org/jira - it would be great if you could include your test case, and even better if your patch includes unit tests to prevent it regressing in the future!

Regards,

Tim
________________________________
From: Johan.Huylebroeck@i8c.be<ma...@i8c.be>
To: user@aries.apache.org<ma...@aries.apache.org>
Date: Thu, 5 Jul 2012 08:31:29 +0200
Subject: PersistenceDescriptorParserImpl and handling namespaces in persistence.xml
Hello,
I'm using aries-jpa 0.3 with service mix. If I use a persistence.xml where the elements are prefixed by a namespace as in:
<pers:persistence xmlns:pers="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<http://java.sun.com/xml/ns/persistence%20http:/java.sun.com/xml/ns/persistence/persistence_1_0.xsd>"
   version="1.0">

  <pers:persistence-unit name="alpha">
    <pers:properties>
      <pers:property name="javax.persistence.jdbc.driver" value="alpha.db.class"/>
      <pers:property name="javax.persistence.jdbc.url" value="jdbc:alpha:url"/>
      <pers:property name="javax.persistence.jdbc.user" value="alan"/>
      <pers:property name="javax.persistence.jdbc.password" value="4l4n"/>
    </pers:properties>
  </pers:persistence-unit>

</pers:persistence>

It is rejected by the PersistenceDescriptorParser, AFAIK using a prefix is valid and should be accepted.

If it is indeed a bug and not 'works as intended' I believe it can easily be fixed by making the parser namespace-aware.
I can send you a patch with tests if you are interested.

Cheers,

Johan Huylebroeck

http://www.i8c.be/integr8-consulting


RE: PersistenceDescriptorParserImpl and handling namespaces in persistence.xml

Posted by Timothy Ward <ti...@apache.org>.
Hi Johan,

We always welcome patches and bugs! If you would like to contribute then the best way would be to raise a bug against the JPA component of Aries in JIRA http://issues.apache.org/jira - it would be great if you could include your test case, and even better if your patch includes unit tests to prevent it regressing in the future!

Regards,

Tim

From: Johan.Huylebroeck@i8c.be
To: user@aries.apache.org
Date: Thu, 5 Jul 2012 08:31:29 +0200
Subject: PersistenceDescriptorParserImpl and handling namespaces in persistence.xml

Hello,I’m using aries-jpa 0.3 with service mix. If I use a persistence.xml where the elements are prefixed by a namespace as in:<pers:persistence xmlns:pers="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">   <pers:persistence-unit name="alpha">    <pers:properties>      <pers:property name="javax.persistence.jdbc.driver" value="alpha.db.class"/>      <pers:property name="javax.persistence.jdbc.url" value="jdbc:alpha:url"/>      <pers:property name="javax.persistence.jdbc.user" value="alan"/>      <pers:property name="javax.persistence.jdbc.password" value="4l4n"/>    </pers:properties>  </pers:persistence-unit> </pers:persistence> It is rejected by the PersistenceDescriptorParser, AFAIK using a prefix is valid and should be accepted. If it is indeed a bug and not ‘works as intended’ I believe it can easily be fixed by making the parser namespace-aware. I can send you a patch with tests if you are interested. Cheers, Johan Huylebroeck http://www.i8c.be/integr8-consulting