Problems with Smooks 1.5.1 and mapping/binding 1.4

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

Problems with Smooks 1.5.1 and mapping/binding 1.4

marco
Hello,

I'm using Smooks to convert unedifact messages to Java. If I use Smooks 1.5.1 and the d99b-mapping and d99b-binding in version 1.4 from maven repository everything works great.

Now I have the requirement to modify the d99b mapping/binding. Therefor I changed the affected xml file in "d99b-mapping-1.4.jar/org_milyn_edi_unedifact/d99b-mapping/1_4/". After that, I used the "milyn-smooks-example-ejc-model-gen" in verison 1.4 with the "maven-ejc-plugin" also in verison 1.4, to generate a new binding jar.

After changing the dependencies of my application to the changed d99b-mapping.jar and the generated d99b-binding.jar, the generated classes contain the change from the xml file. That's ok.

But if I run my application I got the following exception if I convert an edifact message:

org.milyn.cdr.SmooksConfigurationException: Error invoking @Initialize method 'initialize' on class 'org.milyn.smooks.edi.ModelLoader'.
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:457)
        at org.milyn.cdr.annotation.Configurator.initialise(Configurator.java:439)
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:91)
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:66)
        at org.milyn.delivery.JavaContentHandlerFactory.create(JavaContentHandlerFactory.java:69)
        at org.milyn.delivery.ContentDeliveryConfigBuilder$ContentHandlerExtractionStrategy.addCDU(ContentDeliveryConfigBuilder.java:642)
        at org.milyn.delivery.ContentDeliveryConfigBuilder$ContentHandlerExtractionStrategy.applyCDUStrategy(ContentDeliveryConfigBuilder.java:568)
        at org.milyn.delivery.ContentDeliveryConfigBuilder$ContentHandlerExtractionStrategy.applyStrategy(ContentDeliveryConfigBuilder.java:556)
        at org.milyn.delivery.ContentDeliveryConfigBuilder$SmooksResourceConfigurationTableIterator.iterate(ContentDeliveryConfigBuilder.java:730)
        at org.milyn.delivery.ContentDeliveryConfigBuilder$SmooksResourceConfigurationTableIterator.access$300(ContentDeliveryConfigBuilder.java:709)
        at org.milyn.delivery.ContentDeliveryConfigBuilder.extractContentHandlers(ContentDeliveryConfigBuilder.java:494)
        at org.milyn.delivery.ContentDeliveryConfigBuilder.load(ContentDeliveryConfigBuilder.java:356)
        at org.milyn.delivery.ContentDeliveryConfigBuilder.getConfig(ContentDeliveryConfigBuilder.java:147)
        at org.milyn.container.standalone.StandaloneExecutionContext.<init>(StandaloneExecutionContext.java:91)
        at org.milyn.container.standalone.StandaloneExecutionContext.<init>(StandaloneExecutionContext.java:65)
        at org.milyn.Smooks.createExecutionContext(Smooks.java:418)
        at org.milyn.Smooks.createExecutionContext(Smooks.java:376)
        at org.milyn.Smooks.filterSource(Smooks.java:456)
        at org.milyn.edi.unedifact.d99b.D99BInterchangeFactory.fromUNEdifact(D99BInterchangeFactory.java:58)
        at org.milyn.edi.unedifact.d99b.D99BInterchangeFactory.fromUNEdifact(D99BInterchangeFactory.java:40)
        at com.example.services.converter.MyConverterTest.convertEdifactMessage(MyConverterTest.java:32)
        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:601)
        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.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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassCastException: java.io.File cannot be cast to [B
        at org.milyn.edisax.util.EDIUtils.getMappingModelList(EDIUtils.java:197)
        at org.milyn.edisax.util.EDIUtils.loadZippedMappingModels(EDIUtils.java:158)
        at org.milyn.edisax.util.EDIUtils.loadMappingModels(EDIUtils.java:112)
        at org.milyn.smooks.edi.ModelLoader.initialize(ModelLoader.java:52)
        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:601)
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:453)
        ... 44 more

I'm not sure what's wrong after I changed the d99b-mapping-1.4.jar and generated the d99b-binding-1.4.jar with the maven plugin instead of using the unmodified d99b-mapping and d99b-binding jars in version 1.4.

If you need more information, please let me know.

Regards and thanks in advance,

Marco
Reply | Threaded
Open this post in threaded view
|

Re: Problems with Smooks 1.5.1 and mapping/binding 1.4

marco
Hello,

I still have the problem, that I can't use Smooks 1.5.1 with a ejc generated binding.jar (from version 1.4). If I use the original 1.4 binding.jar it works.

Can anyone help please?
Reply | Threaded
Open this post in threaded view
|

Re: Problems with Smooks 1.5.1 and mapping/binding 1.4

ponderMuse
Hi marco,

I am also trying to work with Smooks 1.5.1. To that end, I had to pull down the unedifact GIT project and rebuild the mapping/binding jars using Smooks 1.5+ jars.

PM.