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/StringLorg/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
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
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
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
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.