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/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
03-14-2017 04:51 AM
03-14-2017 05:15 AM
Hi Jakub Rautner ,
I'm a bit confused. You said it works fine for you so I thought you were able to call web service successfully in Activiti context.
There's nothing I can do to help you unless you can share a unit test that demonstrates this issue. In your unit test, it needs to demonstrate how web service is called and the fact that geronimo-jaxws_2.1_spec-1.0.jar is being used.
I believe it is a basic programming task to solve library conflict issue like this. This issue seems not a problem with Activiti but rather a problem with how you implement your web service call in your process.
Hope I make sense,
Thanks,
Thong Huynh
#bp3
03-14-2017 05:41 AM
Hi Thong Huynh
i'm able to call webservice and it's works outside of activiti. I think it s probably problem with implementation of ws ... not with its call.
I try to explain it. I'm using cxf-codegen-plugin to generate java classes from wsdl file. There is class that extends javax.xml.ws.Service class. Outside of alfresco declaration of this class is from default jdk of project. In alfresco repo project declaration of this class is in geronimo jar and i have no influence to change that. Sorry if its out of your area but i have no clue how to solve it.
It's not problem to write unit test for this case but i m not sure if i can published that concrete webservice to public network.
Thank you for your time
Jakub
03-14-2017 09:54 PM
No worries. Happy to help.
Your unit test doesn't have to work with your webservice. You can try the public ones like I did. Web service is web service. They are the same. If your unit test works with the public ones but not with your web service then it's likely your own web service has some problem.
Thanks,
Thong
Explore our Alfresco products with the links below. Use labels to filter content by product module.