Using Smooks 1.5.1 in an OSGi environment

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

Using Smooks 1.5.1 in an OSGi environment

ウォーカーイアン
Hi, I'm trying to get Smooks EDIFACT parsing to work with JBoss Fuse, but I'm having a tough time. The messages I'm trying to parse are not UN/EDIFACT messages, so I used EJC to create the Java objects and everything works fine in a non-OSGi environment.

Following directions on this page, I was able to install the Smooks feature into JBoss Fuse.

However, when starting up my own package that uses the EDIFACT parser, I got the following error:

Caused by: org.milyn.cdr.SmooksConfigurationException: Unable to locate Smooks digest configuration '/META-INF/xsd/smooks/edi-1.2.xsd-smooks.xml' for extended resource configuration namespace 'http://www.milyn.org/xsd/smooks/edi-1.2.xsd'. This resource must be available on the classpath at org.milyn.cdr.XMLConfigDigester.assertExtendedConfigOK(XMLConfigDigester.java:616) at org.milyn.cdr.XMLConfigDigester.getExtenededConfigDigester(XMLConfigDigester.java:581) at org.milyn.cdr.XMLConfigDigester.digestExtendedResourceConfig(XMLConfigDigester.java:539) at org.milyn.cdr.XMLConfigDigester.digestV11XSDValidatedConfig(XMLConfigDigester.java:340) at org.milyn.cdr.XMLConfigDigester.digestConfigRecursively(XMLConfigDigester.java:226) at org.milyn.cdr.XMLConfigDigester.digestConfig(XMLConfigDigester.java:184) at org.milyn.cdr.SmooksResourceConfigurationStore.registerResources(SmooksResourceConfigurationStore.java:229) at org.milyn.Smooks.addConfigurations(Smooks.java:340) at org.milyn.Smooks.addConfigurations(Smooks.java:358) at org.milyn.Smooks.<init>(Smooks.java:172) at <classname>.edifact.model.PnrmigFactory.<init>(PnrmigFactory.java:59) at <classname>.edifact.model.PnrmigFactory.getInstance(PnrmigFactory.java:28) at <classname>.fuse.EdifactWorker.<init>(EdifactWorker.java:16) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:532) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)

After a bunch of fiddling around, I finally got past this error by adding "META-INF.xsd,META-INF.xsd.smooks" to the Export-Package section of the milyn-smooks-all-1.5.1.jar/META-INF/MANIFEST.MF.

Now I'm running into another error:

Caused by: org.milyn.cdr.SmooksConfigurationException: Error invoking @Initialize method 'initialize' on class 'org.milyn.javabean.BeanInstanceCreator'.
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:457)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.initialise(Configurator.java:439)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:91)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:66)[244:org.milyn.smooks.osgi:1.5.1]
        <snip>
Caused by: java.lang.NoClassDefFoundError: org/mvel2/integration/VariableResolverFactory
        at org.milyn.javabean.BeanInstanceCreator.initialize(BeanInstanceCreator.java:208)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_22]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.6.0_22]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.6.0_22]
        at java.lang.reflect.Method.invoke(Method.java:616)[:1.6.0_22]
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:453)
        ... 71 more
Caused by: java.lang.ClassNotFoundException: org.mvel2.integration.VariableResolverFactory not found by org.milyn.smooks.osgi [244]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)[:1.6.0_22]
        ... 77 more

Any advice on what I can do to get this working?

Regards,
Ian Walker
Reply | Threaded
Open this post in threaded view
|

Re: Using Smooks 1.5.1 in an OSGi environment

Tom Fennelly
Hi Ian.  I'm afraid you'll need to get help from the JBoss/Fuse people on this.  It sounds like the normal head-wrecking classpath dance you need to do with osgi, and I'm not an osgi expert.

On 02/09/2013 02:14, ウォーカーイアン wrote:
Hi, I'm trying to get Smooks EDIFACT parsing to work with JBoss Fuse, but I'm having a tough time. The messages I'm trying to parse are not UN/EDIFACT messages, so I used EJC to create the Java objects and everything works fine in a non-OSGi environment.

Following directions on this page, I was able to install the Smooks feature into JBoss Fuse.

However, when starting up my own package that uses the EDIFACT parser, I got the following error:

Caused by: org.milyn.cdr.SmooksConfigurationException: Unable to locate Smooks digest configuration '/META-INF/xsd/smooks/edi-1.2.xsd-smooks.xml' for extended resource configuration namespace 'http://www.milyn.org/xsd/smooks/edi-1.2.xsd'. This resource must be available on the classpath at org.milyn.cdr.XMLConfigDigester.assertExtendedConfigOK(XMLConfigDigester.java:616) at org.milyn.cdr.XMLConfigDigester.getExtenededConfigDigester(XMLConfigDigester.java:581) at org.milyn.cdr.XMLConfigDigester.digestExtendedResourceConfig(XMLConfigDigester.java:539) at org.milyn.cdr.XMLConfigDigester.digestV11XSDValidatedConfig(XMLConfigDigester.java:340) at org.milyn.cdr.XMLConfigDigester.digestConfigRecursively(XMLConfigDigester.java:226) at org.milyn.cdr.XMLConfigDigester.digestConfig(XMLConfigDigester.java:184) at org.milyn.cdr.SmooksResourceConfigurationStore.registerResources(SmooksResourceConfigurationStore.java:229) at org.milyn.Smooks.addConfigurations(Smooks.java:340) at org.milyn.Smooks.addConfigurations(Smooks.java:358) at org.milyn.Smooks.<init>(Smooks.java:172) at <classname>.edifact.model.PnrmigFactory.<init>(PnrmigFactory.java:59) at <classname>.edifact.model.PnrmigFactory.getInstance(PnrmigFactory.java:28) at <classname>.fuse.EdifactWorker.<init>(EdifactWorker.java:16) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:532) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)

After a bunch of fiddling around, I finally got past this error by adding "META-INF.xsd,META-INF.xsd.smooks" to the Export-Package section of the milyn-smooks-all-1.5.1.jar/META-INF/MANIFEST.MF.

Now I'm running into another error:

Caused by: org.milyn.cdr.SmooksConfigurationException: Error invoking @Initialize method 'initialize' on class 'org.milyn.javabean.BeanInstanceCreator'.
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:457)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.initialise(Configurator.java:439)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:91)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:66)[244:org.milyn.smooks.osgi:1.5.1]
        <snip>
Caused by: java.lang.NoClassDefFoundError: org/mvel2/integration/VariableResolverFactory
        at org.milyn.javabean.BeanInstanceCreator.initialize(BeanInstanceCreator.java:208)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_22]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.6.0_22]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.6.0_22]
        at java.lang.reflect.Method.invoke(Method.java:616)[:1.6.0_22]
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:453)
        ... 71 more
Caused by: java.lang.ClassNotFoundException: org.mvel2.integration.VariableResolverFactory not found by org.milyn.smooks.osgi [244]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)[:1.6.0_22]
        ... 77 more

Any advice on what I can do to get this working?

Regards,
Ian Walker

Reply | Threaded
Open this post in threaded view
|

Re: Using Smooks 1.5.1 in an OSGi environment

ウォーカーイアン
Hi Tom. Thanks for the email. I finally got EDIFACT parsing to work in JBoss Fuse so in the event someone else is struggling with the same issue I'll explain what I did.

1) Added META-INF.xsd, META-INF.xsd.smooks to the Export-Package section in milyn-smooks-all-1.5.1.jar/META-INF/MANIFEST.MF.

2) In my project's pom.xml, I added the following classes to the Import-Package section:

META-INF.xsd.smooks,org.milyn.smooks.edi,org.mvel2,org.mvel2.integration,org.mvel2.compiler

After doing the above, I was able to parse my EDIFACT message within JBoss Fuse 6.

Regards,
Ian Walker



On Mon, Sep 2, 2013 at 5:52 PM, Tom Fennelly <[hidden email]> wrote:
Hi Ian.  I'm afraid you'll need to get help from the JBoss/Fuse people on this.  It sounds like the normal head-wrecking classpath dance you need to do with osgi, and I'm not an osgi expert.


On 02/09/2013 02:14, ウォーカーイアン wrote:
Hi, I'm trying to get Smooks EDIFACT parsing to work with JBoss Fuse, but I'm having a tough time. The messages I'm trying to parse are not UN/EDIFACT messages, so I used EJC to create the Java objects and everything works fine in a non-OSGi environment.

Following directions on this page, I was able to install the Smooks feature into JBoss Fuse.

However, when starting up my own package that uses the EDIFACT parser, I got the following error:

Caused by: org.milyn.cdr.SmooksConfigurationException: Unable to locate Smooks digest configuration '/META-INF/xsd/smooks/edi-1.2.xsd-smooks.xml' for extended resource configuration namespace 'http://www.milyn.org/xsd/smooks/edi-1.2.xsd'. This resource must be available on the classpath at org.milyn.cdr.XMLConfigDigester.assertExtendedConfigOK(XMLConfigDigester.java:616) at org.milyn.cdr.XMLConfigDigester.getExtenededConfigDigester(XMLConfigDigester.java:581) at org.milyn.cdr.XMLConfigDigester.digestExtendedResourceConfig(XMLConfigDigester.java:539) at org.milyn.cdr.XMLConfigDigester.digestV11XSDValidatedConfig(XMLConfigDigester.java:340) at org.milyn.cdr.XMLConfigDigester.digestConfigRecursively(XMLConfigDigester.java:226) at org.milyn.cdr.XMLConfigDigester.digestConfig(XMLConfigDigester.java:184) at org.milyn.cdr.SmooksResourceConfigurationStore.registerResources(SmooksResourceConfigurationStore.java:229) at org.milyn.Smooks.addConfigurations(Smooks.java:340) at org.milyn.Smooks.addConfigurations(Smooks.java:358) at org.milyn.Smooks.<init>(Smooks.java:172) at <classname>.edifact.model.PnrmigFactory.<init>(PnrmigFactory.java:59) at <classname>.edifact.model.PnrmigFactory.getInstance(PnrmigFactory.java:28) at <classname>.fuse.EdifactWorker.<init>(EdifactWorker.java:16) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:532) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)

After a bunch of fiddling around, I finally got past this error by adding "META-INF.xsd,META-INF.xsd.smooks" to the Export-Package section of the milyn-smooks-all-1.5.1.jar/META-INF/MANIFEST.MF.

Now I'm running into another error:

Caused by: org.milyn.cdr.SmooksConfigurationException: Error invoking @Initialize method 'initialize' on class 'org.milyn.javabean.BeanInstanceCreator'.
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:457)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.initialise(Configurator.java:439)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:91)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:66)[244:org.milyn.smooks.osgi:1.5.1]
        <snip>
Caused by: java.lang.NoClassDefFoundError: org/mvel2/integration/VariableResolverFactory
        at org.milyn.javabean.BeanInstanceCreator.initialize(BeanInstanceCreator.java:208)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_22]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.6.0_22]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.6.0_22]
        at java.lang.reflect.Method.invoke(Method.java:616)[:1.6.0_22]
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:453)
        ... 71 more
Caused by: java.lang.ClassNotFoundException: org.mvel2.integration.VariableResolverFactory not found by org.milyn.smooks.osgi [244]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)[:1.6.0_22]
        ... 77 more

Any advice on what I can do to get this working?

Regards,
Ian Walker




--
(株) JALインフォテック
エアライン事業部 システム運用・基盤事業部
システム基盤部 基盤アプリケーショングループ (JTD)

ウォーカー イアン
Tel: 03-5445-7291
Reply | Threaded
Open this post in threaded view
|

Re: Using Smooks 1.5.1 in an OSGi environment

Tom Fennelly
That's great.  Thanks Ian.


On 05/09/2013 04:33, ウォーカーイアン wrote:
Hi Tom. Thanks for the email. I finally got EDIFACT parsing to work in JBoss Fuse so in the event someone else is struggling with the same issue I'll explain what I did.

1) Added META-INF.xsd, META-INF.xsd.smooks to the Export-Package section in milyn-smooks-all-1.5.1.jar/META-INF/MANIFEST.MF.

2) In my project's pom.xml, I added the following classes to the Import-Package section:

META-INF.xsd.smooks,org.milyn.smooks.edi,org.mvel2,org.mvel2.integration,org.mvel2.compiler

After doing the above, I was able to parse my EDIFACT message within JBoss Fuse 6.

Regards,
Ian Walker



On Mon, Sep 2, 2013 at 5:52 PM, Tom Fennelly <[hidden email]> wrote:
Hi Ian.  I'm afraid you'll need to get help from the JBoss/Fuse people on this.  It sounds like the normal head-wrecking classpath dance you need to do with osgi, and I'm not an osgi expert.


On 02/09/2013 02:14, ウォーカーイアン wrote:
Hi, I'm trying to get Smooks EDIFACT parsing to work with JBoss Fuse, but I'm having a tough time. The messages I'm trying to parse are not UN/EDIFACT messages, so I used EJC to create the Java objects and everything works fine in a non-OSGi environment.

Following directions on this page, I was able to install the Smooks feature into JBoss Fuse.

However, when starting up my own package that uses the EDIFACT parser, I got the following error:

Caused by: org.milyn.cdr.SmooksConfigurationException: Unable to locate Smooks digest configuration '/META-INF/xsd/smooks/edi-1.2.xsd-smooks.xml' for extended resource configuration namespace 'http://www.milyn.org/xsd/smooks/edi-1.2.xsd'. This resource must be available on the classpath at org.milyn.cdr.XMLConfigDigester.assertExtendedConfigOK(XMLConfigDigester.java:616) at org.milyn.cdr.XMLConfigDigester.getExtenededConfigDigester(XMLConfigDigester.java:581) at org.milyn.cdr.XMLConfigDigester.digestExtendedResourceConfig(XMLConfigDigester.java:539) at org.milyn.cdr.XMLConfigDigester.digestV11XSDValidatedConfig(XMLConfigDigester.java:340) at org.milyn.cdr.XMLConfigDigester.digestConfigRecursively(XMLConfigDigester.java:226) at org.milyn.cdr.XMLConfigDigester.digestConfig(XMLConfigDigester.java:184) at org.milyn.cdr.SmooksResourceConfigurationStore.registerResources(SmooksResourceConfigurationStore.java:229) at org.milyn.Smooks.addConfigurations(Smooks.java:340) at org.milyn.Smooks.addConfigurations(Smooks.java:358) at org.milyn.Smooks.<init>(Smooks.java:172) at <classname>.edifact.model.PnrmigFactory.<init>(PnrmigFactory.java:59) at <classname>.edifact.model.PnrmigFactory.getInstance(PnrmigFactory.java:28) at <classname>.fuse.EdifactWorker.<init>(EdifactWorker.java:16) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:532) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)

After a bunch of fiddling around, I finally got past this error by adding "META-INF.xsd,META-INF.xsd.smooks" to the Export-Package section of the milyn-smooks-all-1.5.1.jar/META-INF/MANIFEST.MF.

Now I'm running into another error:

Caused by: org.milyn.cdr.SmooksConfigurationException: Error invoking @Initialize method 'initialize' on class 'org.milyn.javabean.BeanInstanceCreator'.
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:457)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.initialise(Configurator.java:439)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:91)[244:org.milyn.smooks.osgi:1.5.1]
        at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:66)[244:org.milyn.smooks.osgi:1.5.1]
        <snip>
Caused by: java.lang.NoClassDefFoundError: org/mvel2/integration/VariableResolverFactory
        at org.milyn.javabean.BeanInstanceCreator.initialize(BeanInstanceCreator.java:208)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_22]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.6.0_22]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.6.0_22]
        at java.lang.reflect.Method.invoke(Method.java:616)[:1.6.0_22]
        at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:453)
        ... 71 more
Caused by: java.lang.ClassNotFoundException: org.mvel2.integration.VariableResolverFactory not found by org.milyn.smooks.osgi [244]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)[:1.6.0_22]
        ... 77 more

Any advice on what I can do to get this working?

Regards,
Ian Walker




--
(株) JALインフォテック
エアライン事業部 システム運用・基盤事業部
システム基盤部 基盤アプリケーショングループ (JTD)

ウォーカー イアン
Tel: 03-5445-7291