Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] help needed: unmarshal JSON into JaxB objects fails

Hi Falk

Since your package-info does have a namespace specified then you would need to add that pair to your namespace map as you have done and it looks like there is a bug in how default namespaces are applied to JSON attributes.  I've entered a bug and you can use this link to track our progress on that.  https://bugs.eclipse.org/bugs/show_bug.cgi?id=419893

I've attached the zip again with slight modifications  on what you last sent me to show a solution you can use in the meantime until that bug is fixed.  You could use the bindings file approach as shown in the BindingsTester (reads the stats_modified.json) where you'll notice I renamed "type" to "selftype" and that mapping in specified in the bindings file so that the JAXBContext used for JSON could be created with that bindings file.

Denise

On 18/10/2013 7:38 AM, Edelmann, Falk (HP Software) wrote:

Hi Denise,

 

I compared your test program with our setup. Indeed, the trouble causes the @XmlSchema annotation in the package-info.java. We currently use the following annotation for all packages in which our JAXB annotated classes are located:

 

@javax.xml.bind.annotation.XmlSchema(

  namespace = OprResourceBase.NAMESPACE,

  elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED,

  attributeFormDefault = javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,

  xmlns = {

    @javax.xml.bind.annotation.XmlNs(prefix = OprResourceBase.NAMESPACE_PREFIX,

                                     namespaceURI = OprResourceBase.NAMESPACE),

    @javax.xml.bind.annotation.XmlNs(prefix = "xs",

                                     namespaceURI = "http://www.w3.org/2001/XMLSchema")

  }

)

 

If I use it for our test package “test.forum.json”, then XML works but not JSON. If I remove the annotation from the package again, then JSON works but no longer XML. I have no idea how to fix this problem. Attached is our test setup again with a few modifications:

1.      I’ve added the package-info.java file

2.      added two different main functions in class “JSONTester”. One for XML and one for JSON. XML is currently commented out.

3.      added the sample files “stats.json” and “stats.xml” that the two main functions use.

4.      I fixed a few issues in class “OprEvtStatistics” and “OprEvtStatisticsType”

 

I have removed the “org.eclipse.persistence*.jar” files from the zip archive to reduce the size of the file. You just need to copy them in the lib directory to have a working setup (I use Intellij but I guess you can import it into any Java IDE).

 

I really hope that you can find a solution for this problem because we need both XML and JSON support.

 

Many thanks in advance!

 

Best regards

Falk

 

From: denise mahar [mailto:denise.mahar@xxxxxxxxxx]
Sent: Thursday, October 17, 2013 8:13 PM
To: Edelmann, Falk (HP Software)
Cc: eclipselink-users@xxxxxxxxxxx
Subject: Re: [eclipselink-users] help needed: unmarshal JSON into JaxB objects fails

 

Hi Falk

I've attached a zip with a test (JSONTester.java) with the model you sent and input json document (in.json)  that works for me.   Do you possibly have a package-info.java in your model directory that has an @XmlSchema annotation specifying more namespace information?  Otherwise, try out the test and see if it works for you or what is different in the attached test vs. your setup.

Another solution that may work for you is that you can specifiy different mappings to XML and JSON by providing a bindings configuration file when you create the JAXBContext.  This would mean you'd have a separate JAXBContext/Marshaller/Unmarshaller for working with JSON then with XML but you wouldn't have to change any model classes, the only difference would be that you'd provide this bindings file when you create the JAXBContext to work with JSON input.  In that bindings file you could override the @XmlAttribute mapping to something else. In the attached zip there is a BindingsTester.java that gives an idea of how that works and it reads a modified version on the input json.

-Denise

On 17/10/2013 7:13 AM, Edelmann, Falk (HP Software) wrote:

Hi Denise,

 

Your first solution does not work for us because our current JAXB classes are already in an released product and so they cannot be changed. Our customers use them via a REST-based API (send and receive XML to/from the server). We just want to add the JSON-support without modifying the defined XML documents. Therefore, I tried your second solution but I get the following exception during un-marshaling the JSON:

 

javax.xml.bind.UnmarshalException

- with linked exception:

[Exception [EclipseLink-25008] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.XMLMarshalException

Exception Description: A descriptor with default root element event_statistics was not found in the project]

               at org.eclipse.persistence.jaxb.JAXBUnmarshaller.handleXMLMarshalException(JAXBUnmarshaller.java:980)

               at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:189)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               …

 

Do you have an idea how to solve this issue?

 

Bests Regards

Falk

 

From: denise mahar [mailto:denise.mahar@xxxxxxxxxx]
Sent: Wednesday, October 16, 2013 7:59 PM
To: Edelmann, Falk (HP Software)
Cc: eclipselink-users@xxxxxxxxxxx
Subject: Re: [eclipselink-users] help needed: unmarshal JSON into JaxB objects fails

 

Hi Falk

The problem you are hitting is that since your model has inheritance MOXy uses a "type" attribute to represent an inheritance indicator (this is the xsi:type attribute in XML).  If you rename the XMLAttribute attotation on the selfType attribute of OprResourceBase to be something else ie:@XmlAttribute(name = "selfType") instead of "type" then your use case should work and you don't need to set any namespaces on the marshaller/unmarshaller.  In your current config if the JSON unmarshaller doesn't have namespaces set then "type" attribute from selfType conflicts with the type attribute inheritance indicator (since namespaces are ignored) and problems occur.  So the rename will avoid that conflict.

Alternatively, if you do set the namespaces in the namespace prefix map as you have done in your original example then the inheritance indicator if needed would be xsi:type instead of just type and that also avoids the conflict. In this case there is nothing in your model that maps to "http://www.mytesturl.com/2013/software/data_model" so you would not put that entry in the namespace map you'd have just the 2 entries:
   prefixMap["http://www.w3.org/2001/XMLSchema-instance"] = “xsi”;

    prefixMap["http://www.w3.org/2001/XMLSchema"] = “xs”;


Hope that helps,

-Denise


On 16/10/2013 8:49 AM, Edelmann, Falk (HP Software) wrote:

Hi Denise

 

Thank you so much for your response!

 

Attached is a zip archive containing the entire JAXB annotated class hierarchy. I have just removed all unnecessary dependencies and changed the package name to “test” so that you can easily try to reproduce the issue on your dev system. All our marshaling and un-marshaling is done with EclipseLink MOXy. It works fine with XML but, as I said, not for JSON. If I do not set

 

MarshallerProperties.NAMESPACE_PREFIX_MAPPER

MarshallerProperties.JSON_NAMESPACE_SEPARATOR

 

and

 

UnmarshallerProperties.JSON_NAMESPACE_PREFIX_MAPPER

UnmarshallerProperties.JSON_NAMESPACE_SEPARATOR

 

I get the following exception when

 

Object obj = unmarshaller.unmarshal(new StringReader(jsonDoc));

 

is called.

 

javax.xml.bind.UnmarshalException

- with linked exception:

[Exception [EclipseLink-43] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DescriptorException

Exception Description: Missing class for indicator field value [urn:x-hp:2009:software:data_model:opr:type:event_statistics] of type [class java.lang.String].

Descriptor: XMLDescriptor(com.hp.opr.api.ws.model.admin.eventprocessing.OprEvtStatistics --> [DatabaseTable(event_statistics), DatabaseTable(resource_base)])]

               at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:191)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

               at EventStatisticsControllerTests.testUnmashallJson(EventStatisticsControllerTests.groovy:146)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

               at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

               at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

               at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

               at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

               at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)

               at org.codehaus.groovy.grails.test.junit4.runner.GrailsTestEnvironmentStatement$_evaluate_closure1.doCall(GrailsTestEnvironmentStatement.groovy:35)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)

               at org.codehaus.groovy.grails.test.junit4.runner.GrailsTestEnvironmentStatement$_evaluate_closure1.doCall(GrailsTestEnvironmentStatement.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:271)

               at groovy.lang.Closure$call$0.call(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)

               at org.codehaus.groovy.grails.test.support.GrailsTestInterceptor.wrap(GrailsTestInterceptor.groovy:52)

               at org.codehaus.groovy.grails.test.support.GrailsTestInterceptor$wrap.call(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

               at org.codehaus.groovy.grails.test.junit4.runner.GrailsTestEnvironmentStatement.evaluate(GrailsTestEnvironmentStatement.groovy:34)

               at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

               at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

               at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

               at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

               at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

               at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

               at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

               at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

               at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

               at org.junit.runners.Suite.runChild(Suite.java:128)

               at org.junit.runners.Suite.runChild(Suite.java:24)

               at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

               at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

               at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

               at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

               at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

               at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

               at org.codehaus.groovy.grails.test.junit4.JUnit4GrailsTestType.doRun(JUnit4GrailsTestType.groovy:109)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)

               at org.codehaus.groovy.grails.test.support.GrailsTestTypeSupport.run(GrailsTestTypeSupport.groovy:122)

               at org.codehaus.groovy.grails.test.GrailsTestType$run.call(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

               at _GrailsTest$_run_closure4.doCall(_GrailsTest.groovy:276)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:155)

               at _GrailsTest$_run_closure4.call(_GrailsTest.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1104)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1060)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:706)

               at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)

               at groovy.lang.Script.invokeMethod(Script.java:78)

               at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1123)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1017)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:155)

               at _GrailsTest$_run_closure2.doCall(_GrailsTest.groovy:233)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:289)

               at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1194)

               at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1170)

               at org.codehaus.groovy.runtime.dgm$119.invoke(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:270)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

               at _GrailsTest$_run_closure1_closure21.doCall(_GrailsTest.groovy:190)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.Closure.call(Closure.java:276)

               at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry(DefaultGroovyMethods.java:2310)

               at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1223)

               at org.codehaus.groovy.runtime.dgm$120.invoke(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:270)

               at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

               at _GrailsTest$_run_closure1.doCall(_GrailsTest.groovy:177)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)

               at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:127)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:289)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)

               at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:127)

               at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

               at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)

               at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:271)

               at groovy.lang.Closure$call$0.call(Unknown Source)

               at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)

               at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1003)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:706)

               at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)

               at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1123)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1017)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:159)

               at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)

               at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:271)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1104)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1060)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:706)

               at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)

               at groovy.lang.Script.invokeMethod(Script.java:78)

               at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1123)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1017)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)

               at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:127)

               at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:147)

               at TestApp$_run_closure1.doCall(TestApp.groovy:101)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)

               at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:127)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:289)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)

               at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:127)

               at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

               at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)

               at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:271)

               at groovy.lang.Closure$call$0.call(Unknown Source)

               at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)

               at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1003)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:706)

               at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)

               at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1123)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1017)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:159)

               at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)

               at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:271)

               at groovy.lang.Closure$call$0.call(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)

               at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:289)

               at groovy.lang.Closure$call.call(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

               at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)

               at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.Closure.call(Closure.java:276)

               at groovy.lang.Closure.call(Closure.java:271)

               at groovy.lang.Closure$call$0.call(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)

               at gant.Gant.withBuildListeners(Gant.groovy:427)

               at gant.Gant.this$2$withBuildListeners(Gant.groovy)

               at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)

               at gant.Gant.dispatch(Gant.groovy:415)

               at gant.Gant.this$2$dispatch(Gant.groovy)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)

               at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)

               at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)

               at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:708)

               at gant.Gant.invokeMethod(Gant.groovy)

               at groovy.lang.GroovyObject$invokeMethod.callCurrent(Unknown Source)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:155)

               at gant.Gant.executeTargets(Gant.groovy:590)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)

               at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)

               at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)

               at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:155)

               at gant.Gant.executeTargets(Gant.groovy:589)

               at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeWithGantInstance(GrailsScriptRunner.java:656)

               at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsScript(GrailsScriptRunner.java:578)

               at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:318)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.execute(GrailsBuildHelper.java:124)

               at org.grails.maven.plugin.AbstractGrailsMojo.runGrails(AbstractGrailsMojo.java:277)

               at org.grails.maven.plugin.GrailsExecMojo.execute(GrailsExecMojo.java:51)

               at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)

               at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)

               at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

               at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

               at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)

               at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)

               at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)

               at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)

               at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

               at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

               at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

               at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

               at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)

               at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)

               at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)

               at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

               at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

Caused by: Exception [EclipseLink-43] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DescriptorException

Exception Description: Missing class for indicator field value [urn:x-hp:2009:software:data_model:opr:type:event_statistics] of type [class java.lang.String].

Descriptor: XMLDescriptor(com.hp.opr.api.ws.model.admin.eventprocessing.OprEvtStatistics --> [DatabaseTable(event_statistics), DatabaseTable(resource_base)])

               at org.eclipse.persistence.exceptions.DescriptorException.missingClassForIndicatorFieldValue(DescriptorException.java:940)

               at org.eclipse.persistence.internal.oxm.QNameInheritancePolicy.classFromRow(QNameInheritancePolicy.java:266)

               at org.eclipse.persistence.descriptors.InheritancePolicy.classFromRow(InheritancePolicy.java:1)

               at org.eclipse.persistence.internal.oxm.record.SAXUnmarshallerHandler.startElement(SAXUnmarshallerHandler.java:242)

               at org.eclipse.persistence.internal.oxm.record.json.JSONReader.parse(JSONReader.java:302)

               at org.eclipse.persistence.internal.oxm.record.json.JSONReader.parseRoot(JSONReader.java:166)

               at org.eclipse.persistence.internal.oxm.record.json.JSONReader.parse(JSONReader.java:125)

               at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:895)

               at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:386)

               at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:626)

               at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:435)

               at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:176)

               ... 498 more

 

I hope this helps to find the root cause J

 

Best Regards

Falk

 

From: denise mahar [mailto:denise.mahar@xxxxxxxxxx]
Sent: Tuesday, October 15, 2013 10:41 PM
To: Edelmann, Falk (HP Software)
Cc: eclipselink-users@xxxxxxxxxxx
Subject: Re: [eclipselink-users] help needed: unmarshal JSON into JaxB objects fails

 

Hi

What happens if you don't set the JSON_NAMESPACE_PREFIX_MAPPER property at all and remove the "urn:x-hp:2009:software:data_model:opr:type:" part of the @type attributes so that everything is just "@type":"event_statistic_record" or is the JSON input fixed?  I'm not sure where the urn:x-hp:2009:software:data_model:opr:type in the document maps to so if you could also include OprResourceBase.java, OprEvtStatisticRecord.java and if have a package-info in your package that might help so I can reproduce the issue you are seeing.  Was the JSON in your example created by MOXy or something else...just wondering if marshaling is working for  or if it's just an unmarshal problem?

Thanks
Denise





 

From: Edelmann, Falk (HP Software) [mailto:falk.edelmann@xxxxxx]
Sent: Monday, October 14, 2013 10:31 AM
To: eclipselink-users@xxxxxxxxxxx
Subject: [eclipselink-users] help needed: unmarshal JSON into JaxB objects fails

 

Hallo,

 

It seems that the current version of EclipseLink MOXy (version 2.5.1) has an issue with un-marshaling JSON documents where the prefix of default namespace is set to empty String. I have set up everything to marshal JAXB objects into XML/JSON documents as well as to un-marshal XML/JSON documents into JAXB objects. Everything works except for the un-marshaling of large JSON documents (objects containing arrays of nested objects) if the default namespace prefix is set to an empty string. We do not want a namespace prefix for our object properties as it much easier to access these properties in our HTML UIs via _javascript_. Our un-marshal code looks as following at the moment:

 

public final static Map<String, String> getNamespacePrefixes() {

    Map<String, String> prefixMap = new HashMap<String, String>();

 

    prefixMap["http://www.mytesturl.com/2013/software/data_model"] = “”;  // if we set this to a non-empty string, it works. Why is this needed?

    prefixMap["http://www.w3.org/2001/XMLSchema-instance"] = “xsi”;

    prefixMap["http://www.w3.org/2001/XMLSchema"] = “xs”;

 

    return prefixMap;

}

 

unmarshaller = jaxbContext.createUnmarshaller();

unmarshaller.setProperty(UnmarshallerProperties.AUTO_DETECT_MEDIA_TYPE, Boolean.TRUE);

unmarshaller.setProperty(UnmarshallerProperties.JSON_ATTRIBUTE_PREFIX, "@");

unmarshaller.setProperty(UnmarshallerProperties.JSON_NAMESPACE_PREFIX_MAPPER, getNamespacePrefixes());

unmarshaller.setProperty(UnmarshallerProperties.JSON_NAMESPACE_SEPARATOR, ‘:’);

unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT, Boolean.TRUE);

unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE, MediaType.APPLICATION_JSON);

 

// String jsonDoc =  // get the json as a string

Object obj = unmarshaller.unmarshal(new StringReader(jsonDoc));

OprResourceBase jaxbObject = (OprResourceBase)(obj instanceof JAXBElement ? obj.value : obj);

 

with “OprResourceBase” as the base class for all our JAXB annotated classes.

 

This code works only for simple objects (that is, objects that have only properties of type string, date, number, or boolean). However, as soon as the objects contain other objects and especially arrays of objects, the un-marshaled object is not correct, that is, the call to the “unmarshal” method returns without an exception but the returned object contains invalid data. For example,

The following sample JSON document is not correctly un-marshaled:

 

{

   "event_statistics" : {

      "@type" : "urn:x-hp:2009:software:data_model:opr:type:event_statistics",

      "@version" : "1.0",

      "start" : "2012-11-17T12:00:00",

      "end" : "2013-06-05T12:00:00",

      "statistic" : [ {

         "@type" : "urn:x-hp:2009:software:data_model:opr:type:event_statistic_record",

         "@version" : "1.0",

         "start" : "2013-02-06T12:00:00",

         "interval" : 86400000,

         "type" : "RECEIVED",

         "value" : 7,

         "server" : "DPS"

      }, {

         "@type" : "urn:x-hp:2009:software:data_model:opr:type:event_statistic_record",

         "@version" : "1.0",

         "start" : "2013-02-07T12:00:00",

         "interval" : 86400000,

         "type" : "RECEIVED",

         "value" : 14,

         "server" : "DPS"

      }, {

         "@type" : "urn:x-hp:2009:software:data_model:opr:type:event_statistic_record",

         "@version" : "1.0",

         "start" : "2013-02-08T12:00:00",

         "interval" : 86400000,

         "type" : "RECEIVED",

         "value" : 21,

         "server" : "DPS"

      }, {

         "@type" : "urn:x-hp:2009:software:data_model:opr:type:event_statistic_record",

         "@version" : "1.0",

         "start" : "2013-02-09T12:00:00",

         "interval" : 86400000,

         "type" : "RECEIVED",

         "value" : 28,

         "server" : "DPS"

      },

      ...    

      ]

   }

}

 

The corresponding JAXB annotated Java class looks as following:

 

@XmlAccessorType(XmlAccessType.NONE)

@XmlRootElement(name = OprEvtStatistics.XML_NAME)

@XmlType(name = OprEvtStatistics.XML_TYPE,

         propOrder = {"startDate", "endDate", "statistics", "aggregation", "any"})

public final class OprEvtStatistics extends OprResourceBase

{

  private static final long serialVersionUID = -7981235285649760399L;

 

  public static final String VERSION = "1.0";

  public static final String XML_NAME = "event_statistics";

  public static final String XML_TYPE = XML_NAME + "_type";

  public static final String TYPE = OprResourceBase.BASE_TYPE + XML_NAME;

  public static final String BASE_REF_TYPE = OprResourceBase.BASE_REF_TYPE + XML_NAME + ":";

  public static final URI TYPE_URI = URI.create(TYPE);

 

  private Date m_startDate;

  private Date m_endDate;

  private List<OprEvtStatisticRecord> m_stats;

  private OprEvtAggregation m_aggregation;

 

  private List<Object> m_any;

  private Map<QName, Object> m_anyAttribute;

 

  public OprEvtStatistics()

  {

    super(TYPE_URI, VERSION);

  }

 

  @XmlAnyElement(lax = true)

  public List<Object> getAny()

  {

    return m_any;

  }

 

  @Override

  public void setAny(List<Object> any)

  {

    m_any = any;

  }

 

  @XmlAnyAttribute

  public Map<QName, Object> getAnyAttribute()

  {

    return m_anyAttribute;

  }

 

  @Override

  public void setAnyAttribute(Map<QName, Object> anyAttribute)

  {

    m_anyAttribute = anyAttribute;

  }

 

  @XmlElement(name = "start")

  public Date getStartDate()

  {

    return m_startDate;

  }

 

  public void setStartDate(Date value)

  {

    this.m_startDate = value;

  }

 

  @XmlElement(name = "end")

  public Date getEndDate()

  {

    return m_endDate;

  }

 

  public void setEndDate(Date value)

  {

    this.m_endDate = value;

  }

 

  @XmlElement(name = "statistic")

  public List<OprEvtStatisticRecord> getStatistics()

  {

    return m_stats;

  }

 

  public void setStatistics(List<OprEvtStatisticRecord> value)

  {

    this.m_stats = value;

  }

 

  @XmlElement(name = "aggregation")

  public OprEvtAggregation getAggregation()

  {

    return m_aggregation;

  }

 

  public void setAggregation(OprEvtAggregation value)

  {

    this.m_aggregation = value;

  }

 

  …

}

 

After un-marshaling the above JSON document, I get a JAXB object with start and end date correctly set but the array of statistics (property “statistic”) is empty. Instead, this arrays is stored in property “any” and the elements of this arrays also contain only incomplete data. If I use a prefix for the default namespace, however, everything works as expected.

 

So, can someone help? Did I miss anything in the EclipseLink MOXy documentation? Or is it a known issue that will be fixed in a future release?

 

 

 


Attachment: test.zip
Description: Zip compressed data


Back to the top