SoapFault related issue with Camel upgrade from 2.x to 3.x - apache-camel

When the camel version is upgraded from 2.x to 3.x getting the below issue w.r.t SOAPFault.
Caused by: java.lang.LinkageError: loader constraint violation: loader wants to load interface javax.xml.soap.SOAPFault. A different interface with the same name was previously loaded by "" (instance of org.apache.felix.framework.BundleWiringImpl$BundleClassLoader#607d3823
Tried checking dependencies. Let me know if there are any ways to resolve the above interface loading issue with camel 3.x

Related

WELD-001408: Unsatisfied dependencies for type CdiCamelExtension with qualifiers #Default

We are migrating from EAP 6 to EAP 7 one project that uses Apache Camel. In this project, we are using dependency injection using the CDI 2.0 specification provided by EAP 7. We are migrating from EAP 6.4 which is using CDI 1.X specification. The Apache Camel version that we are using is 2.17.6
We have updated our project with the appropiate changes in the code, but in the moment of deploying the application in the server, we are getting this error, coming from the Camel dependency:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type CdiCamelExtension with qualifiers #Default
at injection point [BackedAnnotatedParameter] Parameter 3 of [BackedAnnotatedMethod] #Produces private static org.apache.camel.cdi.CdiCamelFactory.typeConverter(InjectionPoint, #Any Instance<CamelContext>, CdiCamelExtension)
at org.apache.camel.cdi.CdiCamelFactory.typeConverter(CdiCamelFactory.java:0)
It seems that it is a problem related with Apache Camel, with the 3rd parameter of the signature, that cannot find the way to obtain an object to inject it here.
The camel library camel-cdi-2.17.6jar file that contains the class org.apache.camel.cdi.CdiCamelExtension, and the service configuration in this jar is indicating to use this CdiCamelExtension.
We can see also that within this library the beans.xml file contains:
<beans version="1.0" bean-discovery-mode="all">
<scan>
<exclude name="org.apache.camel.cdi.Main"/>
</scan>
</beans>
With all this, we cannot see why CdiCamelContext cannot be obtained.
Could this be because EAP 7 is using CDI 2.0, and Camel 2.17.6 could not be compatible with this specification? We don't have much experience with Camel, so we are not sure if we could be missing something with it.
Thanks for your help
adding <module name="org.apache.camel" annotations="true" meta-inf="true"/> to global-modules of standalone.xml worked for me.

JavaMail not working in OSGI(ServiceMix/Karaf)

I created a Karaf Instance on a Service Mix(7.0.1) and deployed my bundles into it.
The camel route is starting up properly, but always fails when it should send an email.
With the following exception:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;
I tried several solutions i found from different sources around the web, but cannot actually fix it.
I tried commenting javax.activation out in the jre.properties file of the instance, as well as using a bundle that contains java mail and the osgi friendly version of the activation bundle in the same feature.
Could openJDK be an issue here?
Note: Everything works perfectly fine on a windows/oraclejdk environment, the exception only occurs in a linux/openjdk environment.
My issue stemed from a class loader problem after all and i fixed it by bundling javax.mail/mail/1.4.7 and org.apache.servicemix.specs.activation-api-1.1/2.8.0 in the same bundle.
I also needed to remove every occurence of javax.activation from the jre.properties and config.properties file of the child instance.
I am not sure why it ran per default on a different environment, as in theory the same classloader problems should have occured too, but that might be connected to different JREs being in use.

Could not load extension class org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl

I'm running junit on a class that is configured for cxf. I get this error
Caused by: org.apache.cxf.bus.extension.ExtensionException: Could not load extension class org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl.
when I ask Spring to retrieve the instance on he class. maven dependency includes cxf 2.7.4 (cxf-rt-ws-policy-2.7.4.jar) and I see neethi 3.0.2.jar is also included. Another post mentioned an issue if neethi 2.x was used with cxf 2.x. but this is not my case.
Use mvn dependency:tree to find out which dependency also has the org.apache.neethi:neethi:{version}. In my case it was the org.wso2.carbon.core.
To fix this I added the neethi dependency needed, first in my dependency pom tree.

How to configure custom solr instance to use Morfologik?

I have a custom solr instance running in tomcat. I followed tomcat deployment tutorial in SolrWiki. I want to index my data which are in Polish language and I want to use Morfologik. So i followed http://solr.pl/en/2012/04/02/solr-4-0-and-polish-language-analysis/. I've created lib folder in SOLR_HOME, added all libraries to this folder, changed schema to use solr.MorfologikFilterFactory but i still get such error:
'collection1: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType „text_pl”: Plugin init failure for [schema.xml] analyzer/filter: Error loading class "solr.MorfologikFilterFactory"'
I assume there is a problem with paths. I hope so, because if not it might by quite hard to solve...
Anybody can help me? Thanks!
you can add lib path to the solrconfig.xml - see the xml supplied with example.
are you using the SolrCloud mode or standalone?

LinkageError when calling webservice method

I have an apache servicemix (camel 2.9) route which calls a bean, that in turn makes a SOAP request. The SOAP code is generated via wsdl2java and works fine (cxf 2.4.0). The problem i have is when a SOAP fault is thrown, i get the following issue:
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "javax/xml/soap/SOAPFault"
at javax.xml.ws.soap.SOAPFaultException.<init>(SOAPFaultException.java:28)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)[175:org.apache.cxf.bundle:2.5.0.fuse-7-061]
at $Proxy120.catalogProductAttributeMediaRemove(Unknown Source)
at com.boohoo.magento.MagentoProducts.deleteImageFromProduct(MagentoProducts.java:403)[769:magento-soap-api:1.0.0.SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_29]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_29]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_29]
at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_29]
at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:340)
at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:237)
at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:166)
From a bit of googling (my background is C#) the error seems to be stating that the class has been loaded multiple times, but i dont see see how this is possible since SOAPFaultException isnt one of my classes.
Any ideas?
Cheers.
I found out it was a problem with servicemix config. See: http://fusesource.com/forums/thread.jspa?threadID=4016

Resources