xmlbeans om v20 type init exception

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

xmlbeans om v20 type init exception

juergen sorg
hi,

when i parse an om version 2.0 document with the xmlbeans classes from
52n (i think it was from here: https://github.com/52North/common-xml),
then i got the exception below. this xmlbeans problem is already tracked
here

https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjVsIHLp_PQAhWKDcAKHdoFBCMQFggcMAA&url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FXMLBEANS-243&usg=AFQjCNHFWMPm5qBEKiT56GM1GBoovTOWDQ&sig2=1_3MwY8XW6V_H8SlfDz0ww

but there is no solution (and actually this bug tracking server seems to
be down).

i tried with java 1.7 and 1.8 and although with xmlbeans 2.4, 2.5 and
2.6 -> always the same error

thanks in advance for any help

gruss juergen



java.lang.ExceptionInInitializerError
        at
net.opengis.om.x20.OMObservationPropertyType$Factory.newInstance(OMObservationPropertyType.java:324)
        at org.fzj.ibg.xmlbeans.TestOmV2.testLoadTypeProblem(TestOmV2.java:32)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at junit.framework.TestCase.runTest(TestCase.java:176)
        at junit.framework.TestCase.runBare(TestCase.java:141)
        at junit.framework.TestResult$1.protect(TestResult.java:122)
        at junit.framework.TestResult.runProtected(TestResult.java:142)
        at junit.framework.TestResult.run(TestResult.java:125)
        at junit.framework.TestCase.run(TestCase.java:129)
        at junit.framework.TestSuite.runTest(TestSuite.java:252)
        at junit.framework.TestSuite.run(TestSuite.java:247)
        at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131)
        at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: Cannot load
type from typesystem
(schemaorg_apache_xmlbeans.system.s1D09C80E682E31695C3834C0CEA51B2C.omobservationpropertytype76e8type)
- code 14
        at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.finishLoadingType(SchemaTypeSystemImpl.java:2704)
        at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.resolveHandle(SchemaTypeSystemImpl.java:3511)
        at
net.opengis.om.x20.OMObservationPropertyType.<clinit>(OMObservationPropertyType.java:18)
        ... 20 more
Caused by: java.lang.NullPointerException
        at org.apache.xmlbeans.soap.SOAPArrayType.<init>(SOAPArrayType.java:151)
        at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.readSOAPArrayType(SchemaTypeSystemImpl.java:1863)
        at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.loadAttribute(SchemaTypeSystemImpl.java:2926)
        at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.readAttributeData(SchemaTypeSystemImpl.java:2918)
        at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.finishLoadingType(SchemaTypeSystemImpl.java:2535)
        ... 22 more



_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xmlbeans om v20 type init exception

Carsten Hollmann
Hi Juergen,

it is difficult to say why the OM document could not be parsed.

Therefore it would be great if you could provide the XML file of the om
version 2.0 document you would like to parse.

Especially, because close to the NPE statement you find "SOAPArrayType".
So is the OM document wrapped in a SOAP envelope?

As I mentioned before, it would be helpful if you could provide the XML
of the OM document you try to parse.

Best,
Carsten
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: xmlbeans om v20 type init exception

juergen sorg
In reply to this post by juergen sorg
hi carsten,


attached is the document

 > Especially, because close to the NPE statement you find "SOAPArrayType".
 > So is the OM document wrapped in a SOAP envelope?
no - i think this method is used from xmlbeans when loading types from
the typesystem (xsb file in
52n-xml-sos-v20-2.2.0.jar/schemaorg_apache_xmlbeans/system/s1D09C80E682E31695C3834C0CEA51B2C/omprocess...xsb)


gruss juergen


_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines

omV20.dataarray.mulitple.vars.xml (9K) Download Attachment
smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xmlbeans om v20 type init exception

Carsten Hollmann
Hi Juergen,

how did you load and parse the XML document?

I have stored your XML document in a file, load the file as InputStream
an parse the InputStream with

GetObservationResponseDocument.Factory.parse(InputStream);

The I was able to get the single OMObservations from the created
GetObservationResponseDocument.

Best,
Carsten
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: xmlbeans om v20 type init exception

juergen sorg
In reply to this post by juergen sorg
hi carsten,

i got the error when accessing the procedure, like this:

for(ObservationData observationData:
getObsRespType.getObservationDataArray()){
                        ObservedData observation = new ObservedData();
                       
                        OMObservationType obs=observationData.getOMObservation();
                         //here
                        OMProcessPropertyType proc= obs.getProcedure();
                        System.out.println(proc);


gruss juergen




_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xmlbeans om v20 type init exception

Carsten Hollmann
Hi Juergen,

I have tested your code to access the procedure and it works for me.

Maybe it is a problem with your environment or an issue with the
dependencies.

Which Java version do you use?
I have executed the code in a Java 1.8 environment.

Do you use XmlBeans 2.6.0 and the all 52n-xml-... JARs ends with 2.2.0.jar?

Best,
Carsten
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines