Search code examples
web-servicesjbpmbusiness-process-management

NoSuchMethodError WSDLReader.readWSDL in JBPM WorkItemHandler


I'm working with JBPM 5.4 and using the console-server rest services available to manage the workflow of the processes.

I've also successfully tested a dummy WorkItemHandler that just get 2 values and return the sum of them, just to see a simple process working. That was fine.

However, as I was testing a WorkItemHandler to invoke a external Web Service, the following error appeared:

 Caused by: java.lang.NoSuchMethodError: javax.wsdl.xml.WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c/dom/Element;)Ljavax/wsdl/Definition;
    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:237) [cxf-rt-core-2.4.4.jar:2.4.4]
    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186) [cxf-rt-core-2.4.4.jar:2.4.4]

What I did:

I used the cxf-codegen-plugin version 2.4.4 (wich is the same version of cxf in the lib of console-server.war) to generate the java code from a wsdl.

        <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-codegen-plugin</artifactId>
            <version>2.4.4</version>
            <executions>
                <execution>
                    <id>generate-sources</id>
                    <phase>generate-sources</phase>
                    <configuration>
                        <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
                        <wsdlOptions>
                            <wsdlOption>
                                <wsdl>${basedir}/src/main/resources/wsdl/adm/exampleService.wsdl</wsdl>
                            </wsdlOption>
                        </wsdlOptions>
                    </configuration>
                    <goals>
                        <goal>wsdl2java</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

The code is generated just fine.

I copied the work item jar file in the lib folder of the console-server project, as I have done before with a dummy WorkItemHandler.

I have also checked the cxf(2.4.4) and wsdl4j(1.6.2) versions inside de lib folder of console-server project. In fact, WSDLReader contains the "missing" method in that jar version of wsdl4j.

Where I am:

I understand that somehow the class called it is not from that version, but I can't imagine how that happens.

Anyone have a clue what to do?

I'm using the jboss that comes with jbpm installer, I have changed nothing.

Thanks!


Solution

  • I found the problem. I will document here in case someone stumbles accross this in the future:

    JBPM 5.4 - Project gwt-console-server.war Inside the lib folder there are these 2 jars: wsdl4j.jar and javax.wsdl_1.5.1.v201012040544.jar.

    They have the same classes, but inside the second jar, as it is another version, the class doesnt have the method required.

    So, I simply removed that jar. I imagine it is a mistake for both of them to be together, but if someone knows a reason and I will fall in another issue further, please let me know. For now, it solves the problem.

    Anyway, thanks everyone for the attention, I was struggling for a while with this.

    Regards.