How to solve NoSuchMethodError when i'm calling webservice from workflow?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2017 08:32 AM
Hello,
i'm trying upload file through webservice client but i m getting this error:
Caused by: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.read(Lorg/w3c/dom/Document;Ljava/lang/String
Lorg/apache/ws/
commons/schema/XmlSchema;
at org.apache.cxf.common.xmlschema.SchemaCollection.read(SchemaCollection.java:133)
at org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:192)
at org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:95)
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:380)
at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:474)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:685)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:536)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:248)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:205)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:155)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:156)
at sk.iway.dms3.UploadUnsignedServiceMain.uploadUnsigned(UploadUnsignedServiceMain.java:141)
at sk.iway.dms3.UploadUnsignedServiceMain.runme(UploadUnsignedServiceMain.java:83)
at com.iway.Test.execute(Test.java:78)
I suspect that there is conflict between org.apache.commons.schema.XmlSchema that is include in alfresco-repository:5.1.e.jar and org.apache.ws.xmlschema.xmlschema-core which i'm using in my webservice client.
Could you give me some advices how to solve this problem. If i run the client it works. but if i call client from workflow service task, i'm getting NoSuchMethodError.
Thank you so much for any help.
Jakub
- Labels:
-
Alfresco Process Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2017 02:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2017 02:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2017 04:04 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2017 05:17 AM
Hi Thong Huynh‌
It's very simple use case. I'm trying to call webservice from workflow. There is one userTask and one serviceTask in workflow. Service task is calling java class where is implemented call to our webservice. When I'm trying call webservice from some main class just like a java class its work. When i try to call ws from service Task i get this error. I try to solve it just localy with embedded tomcat server from alfresco-sdk-parent. Alfresco version is 5.1.e, activiti-cxf version 5.19.0.1 and org.apache.httpcomponents.httpcore version 4.4.5, those are external libraries i'm using.
Is it enough to test it for you?
Thank you for your answer
Jakub Rautner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2017 12:47 PM
Hi Jakub Rautner
Thanks for the details but I'm afraid I would need to see your implementation to answer you why your code isn't working. It could be anything. Without a unit test to demonstrate the issue, I won't be able to answer you why.
I ran a quick unit test to test calling a web service (SOAP) from the Java Service Task and it works as expected. I have attached my unit test log and the process def xml. As you can see in the log, I was able to successfully call the public web service and get back the response.
There are many ways you can call web service from Java Service Task. My unit test uses this library Maven Repository: javax.xml.soap » saaj-api » 1.3.5
Please spend time to write up a unit test that shows your issue and share. That's the most effective way for people to understand your issue and help you.
Thanks,
Thong

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 03:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 04:14 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 04:25 AM
Hi Thong Huynh,
Sorry I wasn't specific. Our webservice works, if im try it in browser or if i'm calling ws from console with client. But in alfresco context it does not work. There is problem with javax.xml.ws.Service class. In our ws classloader takes it from default jdk but in alfresco context it takes this class from geronimo-jaxws_2.1_spec-1.0.jar
Thank you for any advices.
Jakub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 04:36 AM
