He,
I have created a custom connector for uploading file trought WS using httpclient.
I don’t impart external jar in my connector, I use only defaut jar like httpclient-4.3.6 and httpcore-4.3.3.
Thoses jar is used by default Rest POST and GET connector.
When i’m runing a process with my custom connector, i get this error:
org.bonitasoft.engine.core.connector.exception.SConnectorException: PROCESS_DEFINITION_ID=5810112512257646492 | PROCESS_NAME=C-ProcessQuality | PROCESS_VERSION=1.3 | PROCESS_INSTANCE_ID=42050 | ROOT_PROCESS_INSTANCE_ID=42050 | FLOW_NODE_DEFINITION_ID=7977920864858041647 | FLOW_NODE_INSTANCE_ID=860723 | FLOW_NODE_NAME=Update document Word dans DS | CONNECTOR_IMPLEMENTATION_CLASS_NAME=updateWordDocumentToDS | CONNECTOR_INSTANCE_ID=840130 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.http.entity.mime.MultipartEntityBuilder.addBinaryBody(Ljava/lang/String;Ljava/io/File;Lorg/apache/http/entity/ContentType;Ljava/lang/String;)Lorg/apache/http/entity/mime/MultipartEntityBuilder;" the class loader (instance of org/bonitasoft/engine/classloader/BonitaClassLoader) of the current class, com/ecervo/connector/RestuploadImpl, and the class loader (instance of org/apache/catalina/loader/ParallelWebappClassLoader) for the method's defining class, org/apache/http/entity/mime/MultipartEntityBuilder, have different Class objects for the type org/apache/http/entity/ContentType used in the signature
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:285)
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnector(ConnectorServiceImpl.java:158)
at org.bonitasoft.engine.connector.ConnectorServiceDecorator.executeConnector(ConnectorServiceDecorator.java:114)
at org.bonitasoft.engine.execution.work.ExecuteConnectorWork.work(ExecuteConnectorWork.java:138)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.InSessionBonitaWork.work(InSessionBonitaWork.java:58)
at org.bonitasoft.engine.work.BonitaThreadPoolExecutor.lambda$submit$0(BonitaThreadPoolExecutor.java:90)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.http.entity.mime.MultipartEntityBuilder.addBinaryBody(Ljava/lang/String;Ljava/io/File;Lorg/apache/http/entity/ContentType;Ljava/lang/String;)Lorg/apache/http/entity/mime/MultipartEntityBuilder;" the class loader (instance of org/bonitasoft/engine/classloader/BonitaClassLoader) of the current class, com/ecervo/connector/RestuploadImpl, and the class loader (instance of org/apache/catalina/loader/ParallelWebappClassLoader) for the method's defining class, org/apache/http/entity/mime/MultipartEntityBuilder, have different Class objects for the type org/apache/http/entity/ContentType used in the signature
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:125)
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:279)
... 12 more
Caused by: java.util.concurrent.ExecutionException: java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.http.entity.mime.MultipartEntityBuilder.addBinaryBody(Ljava/lang/String;Ljava/io/File;Lorg/apache/http/entity/ContentType;Ljava/lang/String;)Lorg/apache/http/entity/mime/MultipartEntityBuilder;" the class loader (instance of org/bonitasoft/engine/classloader/BonitaClassLoader) of the current class, com/ecervo/connector/RestuploadImpl, and the class loader (instance of org/apache/catalina/loader/ParallelWebappClassLoader) for the method's defining class, org/apache/http/entity/mime/MultipartEntityBuilder, have different Class objects for the type org/apache/http/entity/ContentType used in the signature
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.getValue(ConnectorExecutorImpl.java:149)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:122)
... 13 more
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.http.entity.mime.MultipartEntityBuilder.addBinaryBody(Ljava/lang/String;Ljava/io/File;Lorg/apache/http/entity/ContentType;Ljava/lang/String;)Lorg/apache/http/entity/mime/MultipartEntityBuilder;" the class loader (instance of org/bonitasoft/engine/classloader/BonitaClassLoader) of the current class, com/ecervo/connector/RestuploadImpl, and the class loader (instance of org/apache/catalina/loader/ParallelWebappClassLoader) for the method's defining class, org/apache/http/entity/mime/MultipartEntityBuilder, have different Class objects for the type org/apache/http/entity/ContentType used in the signature
at com.ecervo.connector.RestuploadImpl.executeBusinessLogic(RestuploadImpl.java:62)
at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:77)
at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:73)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:206)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:176)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more
I allready look in my tomcat server, but no httpclient or httcore are present in the lib directory.
Do you know how to solve this problem?