Pregunta

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!

¿Fue útil?

Solución

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.

Otros consejos

I would guess that, if you do have a jar with the correct version of WSDLReader in your classpath, that you might have another jar in your classpath that also contains an (incorrect) version of the same class. Note that this might be in your own war, but for example also in the server lib folder etc.

You can also exclude the wsdl4j.jar dependency in your pom file.

        <dependency>
            <groupId>axis</groupId>
            <artifactId>axis</artifactId>
            <version>1.4</version>
            <type>jar</type>
            <exclusions>
                <exclusion>
                    <groupId>axis</groupId>
                    <artifactId>axis-wsdl4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

This is happening as the same class is found in two jar files. You can check the same in your local workspace to find in which jar files "javax.wsdl.xml.WSDLReader" class is present. Then keep only relevant jar file in your classpath. In my case this file was present in given below two jar files:

  1. eclipse-birt-javax.wsdl_1.5.1.v201012040544.jar
  2. wsdl4j-1.6.2.jar

Hence I removed the irrelevant eclipse-birt-javax.wsdl_1.5.1.v201012040544.jar from classpath and then it worked.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top