0

I am using MultipartbodyBuilder to send file and metadata from a REST web service client. To use

In my pom file I have added

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpmime</artifactId>
    <version>4.3.2</version>
</dependency>

and also

<Embed-Dependency>
  http-mime
</Embed-Dependency>

I have not added any bundle related to mime to this feature in the applications feature.xml

When I try to install the feature on karaf I get the following error in log files and it goes in Waiting

->net.sf.cglib.core.CodeGenerationException: java.lang.StackOverflowError-->null
2016-08-03 20:10:22,456[SpringOsgiExtenderThread-58]|ERROR|org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean|175-org.apache.cxf.cxf-rt-frontend-jaxrs-2.7.3|net.sf.cglib.core.CodeGenerationException : java.lang.RuntimeException-->net.sf.cglib.core.CodeGenerationException: java.lang.StackOverflowError-->null

I am using karaf osgi so I figured that I need to have a osgi bundle mapped to features.xml http mime is a jar without any bundle. There is a httpclient osgi bundle but it has other dependencies and it breaks my other projects mapped in features xml.

I want to know how to create an osgi bundle using httpmime 4.3.2 jar file. I am new to this so if some guidance and reference will help.

Jose
  • 23
  • 1
  • 7
  • 1
    You're more likely to get help if you can provide a meaningful title, and clarify what you're trying to do. As well, you should tag your question with a specific language. – miken32 Aug 03 '16 at 16:52

1 Answers1

0

There is a karaf feature called wrap. This allows you to use also non OSGI jar files. In your feature.xml you just need to add the following bundle to your feature.

<bundle>wrap:mvn:org.apache.httpcomponents/httpmime/4.3.2</bundle>
Christian
  • 1,664
  • 1
  • 23
  • 43
  • Still get the same error `org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean|175-org.apache.cxf.cxf-rt-frontend-jaxrs-2.7.3|net.sf.cglib.core.CodeGenerationException : java.lang.reflect.InvocationTargetException-->null org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean|175-org.apache.cxf.cxf-rt-frontend-jaxrs-2.7.3|net.sf.cglib.core.CodeGenerationException : java.lang.StackOverflowError-->null |org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean|175-org.apache.cxf.cxf-rt-frontend-jaxrs->net.sf.cglib.core.CodeGenerationException: java.lang.StackOverflowError-->null` – Jose Aug 05 '16 at 12:57
  • Sorry I just answered your question about how to get an OSGI plugin from an existing jar. I didn't look into the error and why it is happening. – Christian Aug 05 '16 at 13:19