HI Vanshul

Whats the camel version you are using?

Jboss Fuse 6.0.0 supports only camel 2.10 and Fuse 6.1.0 supports camel
2.12. Hence knowing which camel version you are using will help us debug
your issue.

Also check if the maven jar has the package which it says its missing. I
found that package only in the jar hosted at
http://mvnrepository.com/artifact/org.elasticsearch/elasticsearch

In worst case you can deploy this jar into ur deploy folder and write a
dynamic import statement for that package in your maven-bundle plugin.
Once deployed use following Karaf command to check if class is exported at
contain level ->

*exports |grep org.elasticsearch.index.codec.postingsformat*

If its present, then configure the maven-bundle-plugin jar as follows.

Refer below

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>org.w3c.dom,org.tempuri.*,*</Import-Package>
<DynamicImport-Package>*org.elasticsearch.index.codec.postingsformat.**
</DynamicImport-Package>
 </instructions>
<buildDirectory>target</buildDirectory>
</configuration>
</plugin>




Cheers
Reji

On Thu, Jun 11, 2015 at 3:06 PM, Vanshul.Chawla <vanshul.cha...@target.com>
wrote:

> Yes dependency is added. Actually without dependency it will not even
> install the bundle. There we 2 other fixes which were required ie names.txt
> and changing elasticsearch version in a features file which I did.
> Issue is its not as is supported in Fuse 6.1 so that might be an issue. In
> camel it works fine.
>
> Thanks and Regards,
>
> Vanshul Chawla
>
> -----Original Message-----
> From: Reji Mathews [mailto:contactr...@gmail.com]
> Sent: Thursday, June 11, 2015 2:55 PM
> To: users@camel.apache.org
> Subject: Re: Fuse elasticsearch error
>
> Whats the version of camel you are using?
> Have you added the dependency in the POM.xml file.
>
> On Thu, Jun 11, 2015 at 9:11 AM, Vanshul.Chawla <vanshul.cha...@target.com
> >
> wrote:
>
> > Hello,
> >
> > I am trying to do a simple POC on elastic search using Fuse. I have
> > resolved errors for names.txt and snowball and my blueprint gets started.
> > I am getting below error now:
> >
> > Caused by: java.lang.NoClassDefFoundError: Could not initialize class
> > org.elasticsearch.index.codec.postingsformat.PostingFormats
> >
> > My route is
> >
> > <camelContext id="elasticsearch"
> >               xmlns="http://camel.apache.org/schema/blueprint";>
> >               <propertyPlaceholder id="properties5"
> >
> >  location="blueprint:fuse-experian-sendemail-bundle-config5" />
> >               <dataFormats>
> >                      <xmljson id="xmljson" />
> >               </dataFormats>
> >               <route>
> >                      <from uri="file:src/in/elasticsearch" />
> >                      <marshal ref="xmljson" />
> >                      <convertBodyTo type="java.lang.byte[]"
> > charset="utf-16"/>
> >                      <log message="Body inserted to elastic search is
> > ${body}"/>
> >                      <to
> >
> >
> uri="elasticsearch://local?operation=INDEX&amp;indexName=mylog&amp;indexType=data"
> > />
> >                      <log message="Index id from elastic search is
> > ${body} and ${headers}"/>
> >               </route>
> >        </camelContext>
> >
> > I am using an xml file, converting to json and then to byte array and
> > then trying to insert in elastic search.
> >
> > Any clue if something is missing here?
> >
> > Thanks and Regards,
> >
> > Vanshul Chawla
> >
> >
>

Reply via email to