Error invoking @PostConstruct method 'postConstruct' on class 'org.smooks.cartridges.dfdl.parser.DfdlParser'

193 views
Skip to first unread message

Reto Peter

unread,
May 7, 2022, 2:52:29 AM5/7/22
to Smooks Users
I am using smooks within Apache Camel Version 3.16

On my development machine, all works smoothly.
Smooks is reading an EDI-File and does successful convert it to an XML document.

When I build a jar (with Maven) which includes all necessary jar files and run that jar on my deployment machine, then I got the following error:

Error invoking @PostConstruct method 'postConstruct' on class 'org.smooks.cartridges.dfdl.parser.DfdlParser'

My Camel route (simplified)
from("file:{{dir.from.as2}}?preMove=.inprogress&move=.done&delay=1000")
.to("smooks://smooks-ORDERS-D01B-to-EDIXMLORDERS.xml")

Smooks Configuration file:
<?xml version="1.0"?>
<smooks-resource-list xmlns="https://www.smooks.org/xsd/smooks-2.0.xsd"
                      xmlns:core="https://www.smooks.org/xsd/smooks/smooks-core-1.6.xsd"
                      xmlns:edifact="https://www.smooks.org/xsd/smooks/edifact-2.0.xsd">
    <edifact:parser schemaURI="/d01b/EDIFACT-Messages.dfdl.xsd">
        <edifact:messageTypes>
            <edifact:messageType>ORDERS</edifact:messageType>
        </edifact:messageTypes>
    </edifact:parser>
    <core:exports>
        <core:result type="org.smooks.io.payload.StringResult"/>
    </core:exports>
</smooks-resource-list>

My Maven pom.xml (regarding smooks)
        <dependency>
          <groupId>org.smooks.cartridges</groupId>
          <artifactId>smooks-camel-cartridge</artifactId>
          <version>2.0.0-RC1</version>
        </dependency>
       
        <dependency>
            <groupId>org.smooks.cartridges.edi</groupId>
            <artifactId>smooks-edifact-cartridge</artifactId>
            <version>2.0.0-RC1</version>
        </dependency>
       
        <dependency>
            <groupId>org.smooks.cartridges.edi</groupId>
            <artifactId>edifact-schemas</artifactId>
            <classifier>d01b</classifier>
            <version>2.0.0-RC1</version>
        </dependency>

I saw some other post explaining that this is a problem with Scala version. I checked the content of my jar (produced by Mavern) and saw that my Scala versions are up to date, same as on my development machine.

Any idea what I could try?

regards
Reto
smooks-ORDERS-D01B-to-EDIXMLORDERS.xml
pom.xml

Reto Peter

unread,
May 9, 2022, 12:06:58 AM5/9/22
to Smooks Users
I solve the issue by myself.
The problem is that all lib have been inside one executable FAT jar. And smooks cannot handle it. The lib's must be referenced as external library *.jar files, then it works.

Reply all
Reply to author
Forward
0 new messages