-
1. Re: Element order exception
alesj Apr 17, 2008 12:02 PM (in response to alesj)And the xml content:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="manager"> <jta-data-source>java:/DefaultDS</jta-data-source> <jar-file>persistence.jar</jar-file> <properties> <property name="hibernate" value="create-drop"/> </properties> </persistence-unit> </persistence>
-
2. Re: Element order exception
aloubyansky Apr 17, 2008 6:03 PM (in response to alesj)Here
@XmlType(propOrder={"mappingFiles", "jarFiles", "classes", "properties"}) public class PersistenceUnitMetaData implements Serializable
The only elements (and their order) this type has are listed in the propOrder. There is no jta-data-source at all -
3. Re: Element order exception
alesj Apr 18, 2008 4:21 AM (in response to alesj)"alex.loubyansky@jboss.com" wrote:
Here@XmlType(propOrder={"mappingFiles", "jarFiles", "classes", "properties"}) public class PersistenceUnitMetaData implements Serializable
The only elements (and their order) this type has are listed in the propOrder. There is no jta-data-source at all
Aha, don't know what I was thinking. :-)
I thought you only need to list the ones that are collections of elements.
Which doesn't make sense.
OK, getting this one now:Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Attribute is not bound: element owner {http://java.sun.com/xml/ns/persistence}property, attribute name
The mapping:@XmlElementWrapper(name="properties") @JBossXmlMapEntry(name="property") @JBossXmlMapKeyAttribute(name="name") @JBossXmlMapValueAttribute(name="value") public void setProperties(Map<String, String> properties) { this.properties = properties; }
and the same xml as before. -
4. Re: Element order exception
aloubyansky Apr 18, 2008 5:27 AM (in response to alesj)The attributes are bound to the target namespace. You would see it if you enabled trace. That's a bug. I am committing the tests and the fix to the xb.
-
5. Re: Element order exception
alesj Apr 18, 2008 5:36 AM (in response to alesj)"alex.loubyansky@jboss.com" wrote:
The attributes are bound to the target namespace. You would see it if you enabled trace.
You mean this:11:33:23,625 TRACE [BeanHandler] startElement {http://java.sun.com/xml/ns/persistence}property bean=org.jboss.xb.builder.runtime.DefaultMapEntry parent=org.jboss.metadata.jpa.spec.PersistenceUnitMetaData@6460907
"alex.loubyansky@jboss.com" wrote:
That's a bug. I am committing the tests and the fix to the xb.
I copied the Map usage from your test in JBossXB.
What's different there, so that it works? -
6. Re: Element order exception
aloubyansky Apr 18, 2008 5:56 AM (in response to alesj)Sorry, no, those were not logged. Confused with the @XmlAttribute processing.
For the changes see http://jira.jboss.com/jira/browse/JBXB-139. Specifically jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java -
7. Re: Element order exception
aloubyansky Apr 23, 2008 10:02 AM (in response to alesj)Is there a need to keep the PersistenceMDUnitTestCase in the metadata project?
-
8. Re: Element order exception
alesj Apr 23, 2008 10:25 AM (in response to alesj)Where else to put it?
As I see it, it has the same value as other jee metadata tests.
I want to move away from Hibernate passing me the metadata, e.g. I can use some other EntityManager impl.
And then use the right deployers: simplifying parsing, component deployer (PersistenceMD --> PersistenceUnitMDs) and real (PUMD --> BeanMetaData). -
9. Re: Element order exception
aloubyansky Apr 23, 2008 10:38 AM (in response to alesj)Thanks, that's what I wanted to clarify.
-
10. Re: Element order exception
alesj Apr 25, 2008 9:58 AM (in response to alesj)I need new JBossXB in order for PMD to work.
What is the plan of releasing new JBossXB version and updating its usage in Metadata? -
11. Re: Element order exception
aloubyansky Apr 25, 2008 10:16 AM (in response to alesj)It's "on-demand". I can do it this or next week. Do you need it ASAP?
-
12. Re: Element order exception
alesj Apr 25, 2008 12:02 PM (in response to alesj)"alex.loubyansky@jboss.com" wrote:
Do you need it ASAP?
Not really.
I can work on new PMD deployers on jbossxb snapshot, and only commit the stuff once you update the metadata. -
13. Re: Element order exception
aloubyansky Apr 25, 2008 1:02 PM (in response to alesj)Ok, anyway, I think it won't take long.
The thirdparty change task http://jira.jboss.com/jira/browse/JBMETA-29 -