Hello, indeed the xml was missing the prefix declaration, thank you Serkan and Dennis for the quick help,
best regards, wrote: > It looks like this is actually occurring as part of an XSLT transform > step in your processing, and not anything directly related to JiBX. The > error that you're getting on the "owl" prefix is correct for the > document you provided: > > <maintag xmlns="urn:ietf:params:xml:ns:something" message-id="1"> > <data> > <configuration xmlns="http://xml.mysecondnamespace.com/other/" > owl:chdate="1240491432" owl:chtime="2009-04-23 12:57:12 UTC"> > someData > </configuration> > </data> > </maintag> > > The problem is in whatever is generating this XML, since it's missing an > xmlns:owl="..." namespace declaration. Adding the namespace definition > in your JiBX binding is not going to help, since the namespace > declaration needs to actually be present in the XML document. > > - Dennis > > Dennis M. Sosnoski > SOA and Web Services in Java > Training and Consulting > http://www.sosnoski.com - http://www.sosnoski.co.nz > Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 > > > > s...@seq-soft.info wrote: >> Hello, >> >> during unmarshalling process I receive the following error: >> >> [Fatal Error] :1:224: The prefix "owl" for attribute "owl:chdate" >> associated with an element type "configuration" is not bound. >> ERROR: 'The prefix "owl" for attribute "owl:chdate" associated with an >> element type "configuration" is not bound.' >> Error unmarshalling XML to Object >> javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: >> The prefix "owl" for attribute "owl:chdate" associated with an element >> type >> "configuration" is not bound. >> at >> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:720) >> at >> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313) >> at aspen.j2sebackend.util.JiBXUtil.toString(JiBXUtil.java:70) >> at aspen.j2sebackend.util.JiBXUtil.unmarshalDocument(JiBXUtil.java:36) >> at >> aspen.j2sebackend.util.test.JiBXUtilTest.simpleUnmarshal(JiBXUtilTest.java:67) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) >> at >> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) >> at >> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) >> at >> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) >> at >> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) >> at >> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) >> at >> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) >> at >> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) >> at >> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) >> at >> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) >> at >> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) >> at >> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) >> Caused by: org.xml.sax.SAXParseException: The prefix "owl" for attribute >> "owl:chdate" associated with an element type "configuration" is not >> bound. >> at >> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231) >> at >> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:610) >> at >> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708) >> ... 24 more >> >> this error fires off even before the code reaches my custom unmarshaller. >> I >> tried to bound the "owl" prefix for the attribute namespace in the >> following manner: >> >> <mapping flexible="true" ordered="false" >> class="org.something.SuperResponse" ns="urn:ietf:params:xml:ns:something" >> name="rpc-reply"> >> <namespace uri="urn:ietf:params:xml:ns:something" default="elements"/> >> <structure field="subResponse"/> >> </mapping> >> >> <mapping class="org.something.MySubResponse" name="data" >> ns="urn:ietf:params:xml:ns:something"> >> <namespace uri="urn:ietf:params:xml:ns:something" >> default="elements"/> >> <namespace uri="http://xml.mysecondnamespace.com/other/" >> default="attributes" prefix="owl" /> >> <structure ns="http://xml.mysecondnamespace.com/other/" >> field="myModel" >> name="configuration" marshaller="org.something.OwlModelMarshaller" >> unmarshaller="org.something.OwlModelMarshaller" /> >> </mapping> >> >> whereas my XML looks like following >> >> <maintag xmlns="urn:ietf:params:xml:ns:something" message-id="1"> >> <data> >> <configuration xmlns="http://xml.mysecondnamespace.com/other/" >> owl:chdate="1240491432" owl:chtime="2009-04-23 12:57:12 UTC"> >> someData >> </configuration> >> </data> >> </maintag> >> >> Any idea would I am doing wrong? >> >> >> ------------------------------------------------------------------------------ >> Crystal Reports - New Free Runtime and 30 Day Trial >> Check out the new simplified licensign option that enables unlimited >> royalty-free distribution of the report engine for externally facing >> server and web deployment. >> http://p.sf.net/sfu/businessobjects >> _______________________________________________ >> jibx-users mailing list >> jibx-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jibx-users >> >> > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensign option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users