You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by ramesh chandra <ta...@gmail.com> on 2012/06/25 23:16:56 UTC
adding dependency as a system package
I am getting this error
Caused by: java.lang.NoClassDefFoundError:
org/apache/thrift/transport/TTransportException
........
Caused by: java.lang.ClassNotFoundException:
org.apache.thrift.transport.TTransportException not found by
me.prettyprint.hector [193]
I have provided all the required dependencies, but for some reason ,
there is one '*libthrift*' that can not be found by the server during
runtime.
I am not sure if what I attempted below is right and please correct me
if there is a right way.
in the config.properties file , I added
org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
also I copied the jar in apache-karaf-2.2.7/lib folder
this did not help, but I am not sure what is the right way to make karaf
aware of libthrift.
I also tried to install it as a bundle, but it did not help.
What I am trying to accomplish is to add org.apache.thrift / libthrift
to this list on System.getProperty("java.class.path")
/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
Any help would be appreciated
regards,
Ramesh
Re: adding dependency as a system package
Posted by David Jencks <da...@yahoo.com>.
AFAIK the Import-Service header is deprecated and not used for anything by anyone.
david jencks
On Jun 27, 2012, at 8:14 AM, ramesh chandra wrote:
> On 06/25/2012 05:33 PM, ramesh chandra wrote:
>> On 06/25/2012 05:11 PM, David Jencks wrote:
>>>
>>> On Jun 25, 2012, at 5:16 PM, ramesh chandra wrote:
>>>
>>>> I am getting this error
>>>>
>>>> Caused by: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportException
>>>> ........
>>>>
>>>> Caused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransportException not found by me.prettyprint.hector [193]
>>>>
>>>> I have provided all the required dependencies, but for some reason , there is one 'libthrift' that can not be found by the server during runtime.
>>>>
>>>> I am not sure if what I attempted below is right and please correct me if there is a right way.
>>>>
>>>> in the config.properties file , I added
>>>> org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
>>>>
>>>> also I copied the jar in apache-karaf-2.2.7/lib folder
>>>>
>>>> this did not help, but I am not sure what is the right way to make karaf aware of libthrift.
>>>>
>>>> I also tried to install it as a bundle, but it did not help.
>>>>
>>>> What I am trying to accomplish is to add org.apache.thrift / libthrift
>>>>
>>>> to this list on System.getProperty("java.class.path")
>>>>
>>>
>>> um, why?
>>>
>>> does hector code do some bizarre classloading ritual rather than new TTransportException(...)?
>>>
>>> Since you are having so much trouble, I'd advise you to construct a bundle that includes both the hector code and the thrift code. There are lots of examples of repackaging-to-bundles maven projects in geronimo/bundles and servicemix. You can also study bnd documentation and examples to see how to use Private-Package and/or Include-Resource headers to get bnd to include packages from the thrift bundle.
>>>
>>> You might also show us the manifests from your attempts to wrap these bundles.
>>>
>>> thanks
>>> david jencks
>>>
>>>>
>>>> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Any help would be appreciated
>>>>
>>>> regards,
>>>> Ramesh
>>>>
>>>>
>>>
>> Thanks David
>> You are right. For now, I am trying to wrap and install as bundle all the dependencies in Hector as it is the only way to not see that error I guess :)
>> But soon I will try to create a common bundle will all dependencies resolved.
>>
>> regards,
>> Ramesh
>>
> On the bundle importing service
> I see
> Import-Service =
> com.tableters.alpha.invite.dao.ReqDAO;multiple:=false
>
> what could be the reason for multiple:=false ?
>
Re: adding dependency as a system package
Posted by ramesh chandra <ta...@gmail.com>.
On 06/25/2012 05:33 PM, ramesh chandra wrote:
> On 06/25/2012 05:11 PM, David Jencks wrote:
>>
>> On Jun 25, 2012, at 5:16 PM, ramesh chandra wrote:
>>
>>> I am getting this error
>>>
>>> Caused by: java.lang.NoClassDefFoundError:
>>> org/apache/thrift/transport/TTransportException
>>> ........
>>>
>>> Caused by: java.lang.ClassNotFoundException:
>>> org.apache.thrift.transport.TTransportException not found by
>>> me.prettyprint.hector [193]
>>>
>>> I have provided all the required dependencies, but for some reason ,
>>> there is one '*libthrift*' that can not be found by the server
>>> during runtime.
>>>
>>> I am not sure if what I attempted below is right and please correct
>>> me if there is a right way.
>>>
>>> in the config.properties file , I added
>>> org.osgi.framework.system.packages.extra=libthrift-0.6.1;
>>> version="0.6.1"
>>>
>>> also I copied the jar in apache-karaf-2.2.7/lib folder
>>>
>>> this did not help, but I am not sure what is the right way to make
>>> karaf aware of libthrift.
>>>
>>> I also tried to install it as a bundle, but it did not help.
>>>
>>> What I am trying to accomplish is to add org.apache.thrift / libthrift
>>>
>>> to this list on System.getProperty("java.class.path")
>>>
>>
>> um, why?
>>
>> does hector code do some bizarre classloading ritual rather than
>> new TTransportException(...)?
>>
>> Since you are having so much trouble, I'd advise you to construct a
>> bundle that includes both the hector code and the thrift code. There
>> are lots of examples of repackaging-to-bundles maven projects in
>> geronimo/bundles and servicemix. You can also study bnd
>> documentation and examples to see how to use Private-Package and/or
>> Include-Resource headers to get bnd to include packages from the
>> thrift bundle.
>>
>> You might also show us the manifests from your attempts to wrap these
>> bundles.
>>
>> thanks
>> david jencks
>>
>>>
>>> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>>>
>>>
>>>
>>>
>>>
>>>
>>> Any help would be appreciated
>>>
>>> regards,
>>> Ramesh
>>>
>>>
>>
> Thanks David
> You are right. For now, I am trying to wrap and install as bundle all
> the dependencies in Hector as it is the only way to not see that error
> I guess :)
> But soon I will try to create a common bundle will all dependencies
> resolved.
>
> regards,
> Ramesh
>
On the bundle importing service
I see
Import-Service =
com.tableters.alpha.invite.dao.ReqDAO;multiple:=false
what could be the reason for *multiple:=false* ?
Re: adding dependency as a system package
Posted by ramesh chandra <ta...@gmail.com>.
On 06/25/2012 05:11 PM, David Jencks wrote:
>
> On Jun 25, 2012, at 5:16 PM, ramesh chandra wrote:
>
>> I am getting this error
>>
>> Caused by: java.lang.NoClassDefFoundError:
>> org/apache/thrift/transport/TTransportException
>> ........
>>
>> Caused by: java.lang.ClassNotFoundException:
>> org.apache.thrift.transport.TTransportException not found by
>> me.prettyprint.hector [193]
>>
>> I have provided all the required dependencies, but for some reason ,
>> there is one '*libthrift*' that can not be found by the server during
>> runtime.
>>
>> I am not sure if what I attempted below is right and please correct
>> me if there is a right way.
>>
>> in the config.properties file , I added
>> org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
>>
>> also I copied the jar in apache-karaf-2.2.7/lib folder
>>
>> this did not help, but I am not sure what is the right way to make
>> karaf aware of libthrift.
>>
>> I also tried to install it as a bundle, but it did not help.
>>
>> What I am trying to accomplish is to add org.apache.thrift / libthrift
>>
>> to this list on System.getProperty("java.class.path")
>>
>
> um, why?
>
> does hector code do some bizarre classloading ritual rather than
> new TTransportException(...)?
>
> Since you are having so much trouble, I'd advise you to construct a
> bundle that includes both the hector code and the thrift code. There
> are lots of examples of repackaging-to-bundles maven projects in
> geronimo/bundles and servicemix. You can also study bnd documentation
> and examples to see how to use Private-Package and/or Include-Resource
> headers to get bnd to include packages from the thrift bundle.
>
> You might also show us the manifests from your attempts to wrap these
> bundles.
>
> thanks
> david jencks
>
>>
>> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>>
>>
>>
>>
>>
>>
>> Any help would be appreciated
>>
>> regards,
>> Ramesh
>>
>>
>
Thanks David
You are right. For now, I am trying to wrap and install as bundle all
the dependencies in Hector as it is the only way to not see that error I
guess :)
But soon I will try to create a common bundle will all dependencies
resolved.
regards,
Ramesh
Re: adding dependency as a system package
Posted by David Jencks <da...@yahoo.com>.
On Jun 25, 2012, at 5:16 PM, ramesh chandra wrote:
> I am getting this error
>
> Caused by: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportException
> ........
>
> Caused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransportException not found by me.prettyprint.hector [193]
>
> I have provided all the required dependencies, but for some reason , there is one 'libthrift' that can not be found by the server during runtime.
>
> I am not sure if what I attempted below is right and please correct me if there is a right way.
>
> in the config.properties file , I added
> org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
>
> also I copied the jar in apache-karaf-2.2.7/lib folder
>
> this did not help, but I am not sure what is the right way to make karaf aware of libthrift.
>
> I also tried to install it as a bundle, but it did not help.
>
> What I am trying to accomplish is to add org.apache.thrift / libthrift
>
> to this list on System.getProperty("java.class.path")
>
um, why?
does hector code do some bizarre classloading ritual rather than new TTransportException(...)?
Since you are having so much trouble, I'd advise you to construct a bundle that includes both the hector code and the thrift code. There are lots of examples of repackaging-to-bundles maven projects in geronimo/bundles and servicemix. You can also study bnd documentation and examples to see how to use Private-Package and/or Include-Resource headers to get bnd to include packages from the thrift bundle.
You might also show us the manifests from your attempts to wrap these bundles.
thanks
david jencks
>
> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>
>
>
>
>
> Any help would be appreciated
>
> regards,
> Ramesh
>
>
Re: adding dependency as a system package
Posted by Johan Edstrom <se...@gmail.com>.
David,
Pure and utter laziness - I put everything together I need for a full cassandra node
and I can re-use the same properties defaults as I stole them from the karaf build :)
I did this in wild panic one evening because I needed the full bundle to deploy while hiding all the jars.
In the end of the day the BND would do the exact same thing.
I think we do a / did a very similar thing with the servicemix Jetty6 bundles.
On Jun 25, 2012, at 4:55 PM, David Jencks wrote:
> Hi Johan,
>
> I think he'll need the parent pom's maven-bundle-plugin configuration to make sense of the properties.
>
> I don't understand the shade plugin very well, are you actually changing package names here or just putting a lot of jars together into one?
> If the latter, why do you need the shade plugin rather than just using bnd?
>
> hoping to learn :-)
>
> thanks
> david jencks
>
> On Jun 25, 2012, at 6:49 PM, Johan Edstrom wrote:
>
>> If I remember correctly, that is a split package.
>> I think I posted a shade earlier, here is a complete bundle
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>> <parent>
>> <artifactId>bundles</artifactId>
>> <groupId>com.savoirtech</groupId>
>> <version>1.0-SNAPSHOT</version>
>> </parent>
>> <modelVersion>4.0.0</modelVersion>
>> <artifactId>cassandra-all</artifactId>
>> <packaging>bundle</packaging>
>> <dependencies>
>> <dependency>
>> <groupId>org.apache.cassandra</groupId>
>> <artifactId>apache-cassandra</artifactId>
>> <version>${cassandra.version}</version>
>> <type>pom</type>
>> </dependency>
>> <dependency>
>> <groupId>org.apache.cassandra</groupId>
>> <artifactId>cassandra-all</artifactId>
>> <version>${cassandra.version}</version>
>> <exclusions>
>> <exclusion>
>> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
>> <artifactId>concurrentlinkedhashmap-lru</artifactId>
>> </exclusion>
>> </exclusions>
>> </dependency>
>> <dependency>
>> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
>> <artifactId>concurrentlinkedhashmap-lru</artifactId>
>> <version>1.3</version>
>> </dependency>
>> </dependencies>
>> <build>
>> <plugins>
>> <plugin>
>> <artifactId>maven-shade-plugin</artifactId>
>> <executions>
>> <execution>
>> <phase>package</phase>
>> <goals>
>> <goal>shade</goal>
>> </goals>
>> <configuration>
>> <artifactSet>
>> <includes>
>> <include>${pkgGroupId}:${pkgArtifactId}</include>
>> </includes>
>> </artifactSet>
>> <filters>
>> <filter>
>> <artifact>${pkgGroupId}:${pkgArtifactId}</artifact>
>> <excludes>
>> <exclude>**</exclude>
>> </excludes>
>> </filter>
>> </filters>
>> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
>> <createDependencyReducedPom>false</createDependencyReducedPom>
>> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
>> </configuration>
>> </execution>
>> </executions>
>> </plugin>
>> </plugins>
>> </build>
>> <properties>
>> <pkgVersion>${cassandra.version}</pkgVersion>
>> <pkgArtifactId>cassandra-all</pkgArtifactId>
>> <savoirtech.osgi.import>
>> !javax.inject,
>> !javax.mail.internet,
>> !jline,
>> !joptsimple,
>> !junit.framework,
>> !sun.misc,
>> com.google.inject.internal*;resolution:=optional,
>> com.sun.jna ;resolution:=optional,
>> com.thoughtworks.paranamer;resolution:=optional,
>> edu.emory.mathcs.backport.java.util;resolution:=optional,
>> javax.servlet*;resolution:=optional,
>> kaffe*;resolution:=optional,
>> org.apache.commons.httpclient*;resolution:=optional,
>> org.apache.commons.jxpath*;resolution:=optional,
>> org.apache.env*;resolution:=optional,
>> org.apache.hadoop*;resolution:=optional,
>> org.apache.http*;resolution:=optional,
>> org.apache.log*;resolution:=optional,
>> org.apache.pig*;resolution:=optional,
>> org.apache.tools.ant*;resolution:=optional,,
>> org.jboss.netty*;resolution:=optional,
>> org.mortbay*;resolution:=optional,
>> *
>> </savoirtech.osgi.import>
>> <savoirtech.osgi.export>
>> org.apache.cassandra*;version=1.1.1,
>> org.apache.thrift*;-split-package:=merge-first,
>> </savoirtech.osgi.export>
>> <savoirtech.osgi.private.pkg>
>> antlr*,
>> com.google.inject.internal*,
>> com.ning.compress.lzf,
>> com.sun.jna,
>> org.yaml*,
>> org.cliffc.high_scale_lib*,
>> com.google*,
>> com.googlecode*,
>> com.googlecode.concurrentlinkedhashmap,
>> edu.stanford.ppl.concurrent*,
>> org.apache.avro*,
>> org.codehaus.jackson*,
>> org.antlr*,
>> org.apache.commons*;-split-package:=merge-first,
>> org.github*,
>> org.xerial*,
>> com.yammer*
>> </savoirtech.osgi.private.pkg>
>> <savoirtech.osgi.embed>concurrentlinkedhashmap-lru,cassandra-all</savoirtech.osgi.embed>
>> <pkgGroupId>cassandra-all</pkgGroupId>
>> </properties>
>> </project>
>>
>>
>> On Jun 25, 2012, at 3:16 PM, ramesh chandra wrote:
>>
>>> I am getting this error
>>>
>>> Caused by: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportException
>>> ........
>>>
>>> Caused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransportException not found by me.prettyprint.hector [193]
>>>
>>> I have provided all the required dependencies, but for some reason , there is one 'libthrift' that can not be found by the server during runtime.
>>>
>>> I am not sure if what I attempted below is right and please correct me if there is a right way.
>>>
>>> in the config.properties file , I added
>>> org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
>>>
>>> also I copied the jar in apache-karaf-2.2.7/lib folder
>>>
>>> this did not help, but I am not sure what is the right way to make karaf aware of libthrift.
>>>
>>> I also tried to install it as a bundle, but it did not help.
>>>
>>> What I am trying to accomplish is to add org.apache.thrift / libthrift
>>>
>>> to this list on System.getProperty("java.class.path")
>>>
>>>
>>> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>>>
>>>
>>>
>>>
>>>
>>> Any help would be appreciated
>>>
>>> regards,
>>> Ramesh
>>>
>>>
>>
>
Re: adding dependency as a system package
Posted by ramesh chandra <ta...@gmail.com>.
On 06/25/2012 06:13 PM, Johan Edstrom wrote:
> The other missing pieces here probably are :
>
> Starting Cassandra :
>
> System.setProperty("cassandra.config", "file:///Users/joed/opensource/le-esb/esb/target/esb-1.0-SNAPSHOT/etc/cassandra.yaml");
> System.setProperty("cassandra.rpc_port", "9160");
> System.setProperty("cassandra-foreground", "true"); //If this isn't true you hose the console on karaf.
>
> cassandraThread = new Thread(new DataBaseDaemon());
> cassandraThread.setDaemon(true);
> cassandraThread.start();
>
> You probably also need to extend the abstractcassandra daemon / copy it over/override
>
> (Which was the reason I shaded I think, I could add/modify/change stuff)
>
> /je
>
>
> On Jun 25, 2012, at 4:55 PM, David Jencks wrote:
>
>> Hi Johan,
>>
>> I think he'll need the parent pom's maven-bundle-plugin configuration to make sense of the properties.
>>
>> I don't understand the shade plugin very well, are you actually changing package names here or just putting a lot of jars together into one?
>> If the latter, why do you need the shade plugin rather than just using bnd?
>>
>> hoping to learn :-)
>>
>> thanks
>> david jencks
>>
>> On Jun 25, 2012, at 6:49 PM, Johan Edstrom wrote:
>>
>>> If I remember correctly, that is a split package.
>>> I think I posted a shade earlier, here is a complete bundle
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>> <parent>
>>> <artifactId>bundles</artifactId>
>>> <groupId>com.savoirtech</groupId>
>>> <version>1.0-SNAPSHOT</version>
>>> </parent>
>>> <modelVersion>4.0.0</modelVersion>
>>> <artifactId>cassandra-all</artifactId>
>>> <packaging>bundle</packaging>
>>> <dependencies>
>>> <dependency>
>>> <groupId>org.apache.cassandra</groupId>
>>> <artifactId>apache-cassandra</artifactId>
>>> <version>${cassandra.version}</version>
>>> <type>pom</type>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.apache.cassandra</groupId>
>>> <artifactId>cassandra-all</artifactId>
>>> <version>${cassandra.version}</version>
>>> <exclusions>
>>> <exclusion>
>>> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
>>> <artifactId>concurrentlinkedhashmap-lru</artifactId>
>>> </exclusion>
>>> </exclusions>
>>> </dependency>
>>> <dependency>
>>> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
>>> <artifactId>concurrentlinkedhashmap-lru</artifactId>
>>> <version>1.3</version>
>>> </dependency>
>>> </dependencies>
>>> <build>
>>> <plugins>
>>> <plugin>
>>> <artifactId>maven-shade-plugin</artifactId>
>>> <executions>
>>> <execution>
>>> <phase>package</phase>
>>> <goals>
>>> <goal>shade</goal>
>>> </goals>
>>> <configuration>
>>> <artifactSet>
>>> <includes>
>>> <include>${pkgGroupId}:${pkgArtifactId}</include>
>>> </includes>
>>> </artifactSet>
>>> <filters>
>>> <filter>
>>> <artifact>${pkgGroupId}:${pkgArtifactId}</artifact>
>>> <excludes>
>>> <exclude>**</exclude>
>>> </excludes>
>>> </filter>
>>> </filters>
>>> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
>>> <createDependencyReducedPom>false</createDependencyReducedPom>
>>> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
>>> </configuration>
>>> </execution>
>>> </executions>
>>> </plugin>
>>> </plugins>
>>> </build>
>>> <properties>
>>> <pkgVersion>${cassandra.version}</pkgVersion>
>>> <pkgArtifactId>cassandra-all</pkgArtifactId>
>>> <savoirtech.osgi.import>
>>> !javax.inject,
>>> !javax.mail.internet,
>>> !jline,
>>> !joptsimple,
>>> !junit.framework,
>>> !sun.misc,
>>> com.google.inject.internal*;resolution:=optional,
>>> com.sun.jna ;resolution:=optional,
>>> com.thoughtworks.paranamer;resolution:=optional,
>>> edu.emory.mathcs.backport.java.util;resolution:=optional,
>>> javax.servlet*;resolution:=optional,
>>> kaffe*;resolution:=optional,
>>> org.apache.commons.httpclient*;resolution:=optional,
>>> org.apache.commons.jxpath*;resolution:=optional,
>>> org.apache.env*;resolution:=optional,
>>> org.apache.hadoop*;resolution:=optional,
>>> org.apache.http*;resolution:=optional,
>>> org.apache.log*;resolution:=optional,
>>> org.apache.pig*;resolution:=optional,
>>> org.apache.tools.ant*;resolution:=optional,,
>>> org.jboss.netty*;resolution:=optional,
>>> org.mortbay*;resolution:=optional,
>>> *
>>> </savoirtech.osgi.import>
>>> <savoirtech.osgi.export>
>>> org.apache.cassandra*;version=1.1.1,
>>> org.apache.thrift*;-split-package:=merge-first,
>>> </savoirtech.osgi.export>
>>> <savoirtech.osgi.private.pkg>
>>> antlr*,
>>> com.google.inject.internal*,
>>> com.ning.compress.lzf,
>>> com.sun.jna,
>>> org.yaml*,
>>> org.cliffc.high_scale_lib*,
>>> com.google*,
>>> com.googlecode*,
>>> com.googlecode.concurrentlinkedhashmap,
>>> edu.stanford.ppl.concurrent*,
>>> org.apache.avro*,
>>> org.codehaus.jackson*,
>>> org.antlr*,
>>> org.apache.commons*;-split-package:=merge-first,
>>> org.github*,
>>> org.xerial*,
>>> com.yammer*
>>> </savoirtech.osgi.private.pkg>
>>> <savoirtech.osgi.embed>concurrentlinkedhashmap-lru,cassandra-all</savoirtech.osgi.embed>
>>> <pkgGroupId>cassandra-all</pkgGroupId>
>>> </properties>
>>> </project>
>>>
>>>
>>> On Jun 25, 2012, at 3:16 PM, ramesh chandra wrote:
>>>
>>>> I am getting this error
>>>>
>>>> Caused by: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportException
>>>> ........
>>>>
>>>> Caused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransportException not found by me.prettyprint.hector [193]
>>>>
>>>> I have provided all the required dependencies, but for some reason , there is one 'libthrift' that can not be found by the server during runtime.
>>>>
>>>> I am not sure if what I attempted below is right and please correct me if there is a right way.
>>>>
>>>> in the config.properties file , I added
>>>> org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
>>>>
>>>> also I copied the jar in apache-karaf-2.2.7/lib folder
>>>>
>>>> this did not help, but I am not sure what is the right way to make karaf aware of libthrift.
>>>>
>>>> I also tried to install it as a bundle, but it did not help.
>>>>
>>>> What I am trying to accomplish is to add org.apache.thrift / libthrift
>>>>
>>>> to this list on System.getProperty("java.class.path")
>>>>
>>>>
>>>> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Any help would be appreciated
>>>>
>>>> regards,
>>>> Ramesh
>>>>
>>>>
Hi Johan,
Appreciate your help. I tried the shade you provided before , but I
couldn't make it work right.
Now that I have the complete bundle, I think it would be much helpful.
I am a little confused with Starting cassandra part. Have you been using
just Thrift or any client library ?
regards,
Ramesh
Re: adding dependency as a system package
Posted by ramesh chandra <ta...@gmail.com>.
On 06/25/2012 06:13 PM, Johan Edstrom wrote:
> The other missing pieces here probably are :
>
> Starting Cassandra :
>
> System.setProperty("cassandra.config", "file:///Users/joed/opensource/le-esb/esb/target/esb-1.0-SNAPSHOT/etc/cassandra.yaml");
> System.setProperty("cassandra.rpc_port", "9160");
> System.setProperty("cassandra-foreground", "true"); //If this isn't true you hose the console on karaf.
>
> cassandraThread = new Thread(new DataBaseDaemon());
> cassandraThread.setDaemon(true);
> cassandraThread.start();
>
> You probably also need to extend the abstractcassandra daemon / copy it over/override
>
> (Which was the reason I shaded I think, I could add/modify/change stuff)
>
> /je
>
>
> On Jun 25, 2012, at 4:55 PM, David Jencks wrote:
>
>> Hi Johan,
>>
>> I think he'll need the parent pom's maven-bundle-plugin configuration to make sense of the properties.
>>
>> I don't understand the shade plugin very well, are you actually changing package names here or just putting a lot of jars together into one?
>> If the latter, why do you need the shade plugin rather than just using bnd?
>>
>> hoping to learn :-)
>>
>> thanks
>> david jencks
>>
>> On Jun 25, 2012, at 6:49 PM, Johan Edstrom wrote:
>>
>>> If I remember correctly, that is a split package.
>>> I think I posted a shade earlier, here is a complete bundle
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>> <parent>
>>> <artifactId>bundles</artifactId>
>>> <groupId>com.savoirtech</groupId>
>>> <version>1.0-SNAPSHOT</version>
>>> </parent>
>>> <modelVersion>4.0.0</modelVersion>
>>> <artifactId>cassandra-all</artifactId>
>>> <packaging>bundle</packaging>
>>> <dependencies>
>>> <dependency>
>>> <groupId>org.apache.cassandra</groupId>
>>> <artifactId>apache-cassandra</artifactId>
>>> <version>${cassandra.version}</version>
>>> <type>pom</type>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.apache.cassandra</groupId>
>>> <artifactId>cassandra-all</artifactId>
>>> <version>${cassandra.version}</version>
>>> <exclusions>
>>> <exclusion>
>>> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
>>> <artifactId>concurrentlinkedhashmap-lru</artifactId>
>>> </exclusion>
>>> </exclusions>
>>> </dependency>
>>> <dependency>
>>> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
>>> <artifactId>concurrentlinkedhashmap-lru</artifactId>
>>> <version>1.3</version>
>>> </dependency>
>>> </dependencies>
>>> <build>
>>> <plugins>
>>> <plugin>
>>> <artifactId>maven-shade-plugin</artifactId>
>>> <executions>
>>> <execution>
>>> <phase>package</phase>
>>> <goals>
>>> <goal>shade</goal>
>>> </goals>
>>> <configuration>
>>> <artifactSet>
>>> <includes>
>>> <include>${pkgGroupId}:${pkgArtifactId}</include>
>>> </includes>
>>> </artifactSet>
>>> <filters>
>>> <filter>
>>> <artifact>${pkgGroupId}:${pkgArtifactId}</artifact>
>>> <excludes>
>>> <exclude>**</exclude>
>>> </excludes>
>>> </filter>
>>> </filters>
>>> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
>>> <createDependencyReducedPom>false</createDependencyReducedPom>
>>> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
>>> </configuration>
>>> </execution>
>>> </executions>
>>> </plugin>
>>> </plugins>
>>> </build>
>>> <properties>
>>> <pkgVersion>${cassandra.version}</pkgVersion>
>>> <pkgArtifactId>cassandra-all</pkgArtifactId>
>>> <savoirtech.osgi.import>
>>> !javax.inject,
>>> !javax.mail.internet,
>>> !jline,
>>> !joptsimple,
>>> !junit.framework,
>>> !sun.misc,
>>> com.google.inject.internal*;resolution:=optional,
>>> com.sun.jna ;resolution:=optional,
>>> com.thoughtworks.paranamer;resolution:=optional,
>>> edu.emory.mathcs.backport.java.util;resolution:=optional,
>>> javax.servlet*;resolution:=optional,
>>> kaffe*;resolution:=optional,
>>> org.apache.commons.httpclient*;resolution:=optional,
>>> org.apache.commons.jxpath*;resolution:=optional,
>>> org.apache.env*;resolution:=optional,
>>> org.apache.hadoop*;resolution:=optional,
>>> org.apache.http*;resolution:=optional,
>>> org.apache.log*;resolution:=optional,
>>> org.apache.pig*;resolution:=optional,
>>> org.apache.tools.ant*;resolution:=optional,,
>>> org.jboss.netty*;resolution:=optional,
>>> org.mortbay*;resolution:=optional,
>>> *
>>> </savoirtech.osgi.import>
>>> <savoirtech.osgi.export>
>>> org.apache.cassandra*;version=1.1.1,
>>> org.apache.thrift*;-split-package:=merge-first,
>>> </savoirtech.osgi.export>
>>> <savoirtech.osgi.private.pkg>
>>> antlr*,
>>> com.google.inject.internal*,
>>> com.ning.compress.lzf,
>>> com.sun.jna,
>>> org.yaml*,
>>> org.cliffc.high_scale_lib*,
>>> com.google*,
>>> com.googlecode*,
>>> com.googlecode.concurrentlinkedhashmap,
>>> edu.stanford.ppl.concurrent*,
>>> org.apache.avro*,
>>> org.codehaus.jackson*,
>>> org.antlr*,
>>> org.apache.commons*;-split-package:=merge-first,
>>> org.github*,
>>> org.xerial*,
>>> com.yammer*
>>> </savoirtech.osgi.private.pkg>
>>> <savoirtech.osgi.embed>concurrentlinkedhashmap-lru,cassandra-all</savoirtech.osgi.embed>
>>> <pkgGroupId>cassandra-all</pkgGroupId>
>>> </properties>
>>> </project>
>>>
>>>
>>> On Jun 25, 2012, at 3:16 PM, ramesh chandra wrote:
>>>
>>>> I am getting this error
>>>>
>>>> Caused by: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportException
>>>> ........
>>>>
>>>> Caused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransportException not found by me.prettyprint.hector [193]
>>>>
>>>> I have provided all the required dependencies, but for some reason , there is one 'libthrift' that can not be found by the server during runtime.
>>>>
>>>> I am not sure if what I attempted below is right and please correct me if there is a right way.
>>>>
>>>> in the config.properties file , I added
>>>> org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
>>>>
>>>> also I copied the jar in apache-karaf-2.2.7/lib folder
>>>>
>>>> this did not help, but I am not sure what is the right way to make karaf aware of libthrift.
>>>>
>>>> I also tried to install it as a bundle, but it did not help.
>>>>
>>>> What I am trying to accomplish is to add org.apache.thrift / libthrift
>>>>
>>>> to this list on System.getProperty("java.class.path")
>>>>
>>>>
>>>> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Any help would be appreciated
>>>>
>>>> regards,
>>>> Ramesh
>>>>
>>>>
Solution:
Just in case if you happen to user Hector for your OSGI bundle and you
are getting classnotfound error messages,
there are the artifacts that you would need to pass as a bundle (tested
only with Karaf)
hector-core (1.0.0.5)
org.apache.thrift_libthrift_0.6.1 (0)
org.apache.httpcomponents_httpclient_4.2 (0)
org.apache.httpcomponents_httpcore_4.2 (0)
org.apache.avro_avro_1.6.3 (0)
Commons CLI (1.2)
org.apache.cassandra_cassandra-thrift_1.0.9 (0)
org.apache.cassandra_cassandra-clientutil_1.0.9 (0)
How to bundle ?
Wrapping up external artifact/library as an OSGI bundle for Karaf install
osgi:install wrap:mvn:Group/Artifact/version
example: osgi:install wrap:mvn:me.prettyprint/hector-core/1.0-5
Hope this will help someone
best regards
Ramesh
Re: adding dependency as a system package
Posted by Johan Edstrom <se...@gmail.com>.
The other missing pieces here probably are :
Starting Cassandra :
System.setProperty("cassandra.config", "file:///Users/joed/opensource/le-esb/esb/target/esb-1.0-SNAPSHOT/etc/cassandra.yaml");
System.setProperty("cassandra.rpc_port", "9160");
System.setProperty("cassandra-foreground", "true"); //If this isn't true you hose the console on karaf.
cassandraThread = new Thread(new DataBaseDaemon());
cassandraThread.setDaemon(true);
cassandraThread.start();
You probably also need to extend the abstractcassandra daemon / copy it over/override
(Which was the reason I shaded I think, I could add/modify/change stuff)
/je
On Jun 25, 2012, at 4:55 PM, David Jencks wrote:
> Hi Johan,
>
> I think he'll need the parent pom's maven-bundle-plugin configuration to make sense of the properties.
>
> I don't understand the shade plugin very well, are you actually changing package names here or just putting a lot of jars together into one?
> If the latter, why do you need the shade plugin rather than just using bnd?
>
> hoping to learn :-)
>
> thanks
> david jencks
>
> On Jun 25, 2012, at 6:49 PM, Johan Edstrom wrote:
>
>> If I remember correctly, that is a split package.
>> I think I posted a shade earlier, here is a complete bundle
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>> <parent>
>> <artifactId>bundles</artifactId>
>> <groupId>com.savoirtech</groupId>
>> <version>1.0-SNAPSHOT</version>
>> </parent>
>> <modelVersion>4.0.0</modelVersion>
>> <artifactId>cassandra-all</artifactId>
>> <packaging>bundle</packaging>
>> <dependencies>
>> <dependency>
>> <groupId>org.apache.cassandra</groupId>
>> <artifactId>apache-cassandra</artifactId>
>> <version>${cassandra.version}</version>
>> <type>pom</type>
>> </dependency>
>> <dependency>
>> <groupId>org.apache.cassandra</groupId>
>> <artifactId>cassandra-all</artifactId>
>> <version>${cassandra.version}</version>
>> <exclusions>
>> <exclusion>
>> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
>> <artifactId>concurrentlinkedhashmap-lru</artifactId>
>> </exclusion>
>> </exclusions>
>> </dependency>
>> <dependency>
>> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
>> <artifactId>concurrentlinkedhashmap-lru</artifactId>
>> <version>1.3</version>
>> </dependency>
>> </dependencies>
>> <build>
>> <plugins>
>> <plugin>
>> <artifactId>maven-shade-plugin</artifactId>
>> <executions>
>> <execution>
>> <phase>package</phase>
>> <goals>
>> <goal>shade</goal>
>> </goals>
>> <configuration>
>> <artifactSet>
>> <includes>
>> <include>${pkgGroupId}:${pkgArtifactId}</include>
>> </includes>
>> </artifactSet>
>> <filters>
>> <filter>
>> <artifact>${pkgGroupId}:${pkgArtifactId}</artifact>
>> <excludes>
>> <exclude>**</exclude>
>> </excludes>
>> </filter>
>> </filters>
>> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
>> <createDependencyReducedPom>false</createDependencyReducedPom>
>> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
>> </configuration>
>> </execution>
>> </executions>
>> </plugin>
>> </plugins>
>> </build>
>> <properties>
>> <pkgVersion>${cassandra.version}</pkgVersion>
>> <pkgArtifactId>cassandra-all</pkgArtifactId>
>> <savoirtech.osgi.import>
>> !javax.inject,
>> !javax.mail.internet,
>> !jline,
>> !joptsimple,
>> !junit.framework,
>> !sun.misc,
>> com.google.inject.internal*;resolution:=optional,
>> com.sun.jna ;resolution:=optional,
>> com.thoughtworks.paranamer;resolution:=optional,
>> edu.emory.mathcs.backport.java.util;resolution:=optional,
>> javax.servlet*;resolution:=optional,
>> kaffe*;resolution:=optional,
>> org.apache.commons.httpclient*;resolution:=optional,
>> org.apache.commons.jxpath*;resolution:=optional,
>> org.apache.env*;resolution:=optional,
>> org.apache.hadoop*;resolution:=optional,
>> org.apache.http*;resolution:=optional,
>> org.apache.log*;resolution:=optional,
>> org.apache.pig*;resolution:=optional,
>> org.apache.tools.ant*;resolution:=optional,,
>> org.jboss.netty*;resolution:=optional,
>> org.mortbay*;resolution:=optional,
>> *
>> </savoirtech.osgi.import>
>> <savoirtech.osgi.export>
>> org.apache.cassandra*;version=1.1.1,
>> org.apache.thrift*;-split-package:=merge-first,
>> </savoirtech.osgi.export>
>> <savoirtech.osgi.private.pkg>
>> antlr*,
>> com.google.inject.internal*,
>> com.ning.compress.lzf,
>> com.sun.jna,
>> org.yaml*,
>> org.cliffc.high_scale_lib*,
>> com.google*,
>> com.googlecode*,
>> com.googlecode.concurrentlinkedhashmap,
>> edu.stanford.ppl.concurrent*,
>> org.apache.avro*,
>> org.codehaus.jackson*,
>> org.antlr*,
>> org.apache.commons*;-split-package:=merge-first,
>> org.github*,
>> org.xerial*,
>> com.yammer*
>> </savoirtech.osgi.private.pkg>
>> <savoirtech.osgi.embed>concurrentlinkedhashmap-lru,cassandra-all</savoirtech.osgi.embed>
>> <pkgGroupId>cassandra-all</pkgGroupId>
>> </properties>
>> </project>
>>
>>
>> On Jun 25, 2012, at 3:16 PM, ramesh chandra wrote:
>>
>>> I am getting this error
>>>
>>> Caused by: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportException
>>> ........
>>>
>>> Caused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransportException not found by me.prettyprint.hector [193]
>>>
>>> I have provided all the required dependencies, but for some reason , there is one 'libthrift' that can not be found by the server during runtime.
>>>
>>> I am not sure if what I attempted below is right and please correct me if there is a right way.
>>>
>>> in the config.properties file , I added
>>> org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
>>>
>>> also I copied the jar in apache-karaf-2.2.7/lib folder
>>>
>>> this did not help, but I am not sure what is the right way to make karaf aware of libthrift.
>>>
>>> I also tried to install it as a bundle, but it did not help.
>>>
>>> What I am trying to accomplish is to add org.apache.thrift / libthrift
>>>
>>> to this list on System.getProperty("java.class.path")
>>>
>>>
>>> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>>>
>>>
>>>
>>>
>>>
>>> Any help would be appreciated
>>>
>>> regards,
>>> Ramesh
>>>
>>>
>>
>
Re: adding dependency as a system package
Posted by David Jencks <da...@yahoo.com>.
Hi Johan,
I think he'll need the parent pom's maven-bundle-plugin configuration to make sense of the properties.
I don't understand the shade plugin very well, are you actually changing package names here or just putting a lot of jars together into one?
If the latter, why do you need the shade plugin rather than just using bnd?
hoping to learn :-)
thanks
david jencks
On Jun 25, 2012, at 6:49 PM, Johan Edstrom wrote:
> If I remember correctly, that is a split package.
> I think I posted a shade earlier, here is a complete bundle
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <parent>
> <artifactId>bundles</artifactId>
> <groupId>com.savoirtech</groupId>
> <version>1.0-SNAPSHOT</version>
> </parent>
> <modelVersion>4.0.0</modelVersion>
> <artifactId>cassandra-all</artifactId>
> <packaging>bundle</packaging>
> <dependencies>
> <dependency>
> <groupId>org.apache.cassandra</groupId>
> <artifactId>apache-cassandra</artifactId>
> <version>${cassandra.version}</version>
> <type>pom</type>
> </dependency>
> <dependency>
> <groupId>org.apache.cassandra</groupId>
> <artifactId>cassandra-all</artifactId>
> <version>${cassandra.version}</version>
> <exclusions>
> <exclusion>
> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
> <artifactId>concurrentlinkedhashmap-lru</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> <dependency>
> <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
> <artifactId>concurrentlinkedhashmap-lru</artifactId>
> <version>1.3</version>
> </dependency>
> </dependencies>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-shade-plugin</artifactId>
> <executions>
> <execution>
> <phase>package</phase>
> <goals>
> <goal>shade</goal>
> </goals>
> <configuration>
> <artifactSet>
> <includes>
> <include>${pkgGroupId}:${pkgArtifactId}</include>
> </includes>
> </artifactSet>
> <filters>
> <filter>
> <artifact>${pkgGroupId}:${pkgArtifactId}</artifact>
> <excludes>
> <exclude>**</exclude>
> </excludes>
> </filter>
> </filters>
> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
> <createDependencyReducedPom>false</createDependencyReducedPom>
> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
> </configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> <properties>
> <pkgVersion>${cassandra.version}</pkgVersion>
> <pkgArtifactId>cassandra-all</pkgArtifactId>
> <savoirtech.osgi.import>
> !javax.inject,
> !javax.mail.internet,
> !jline,
> !joptsimple,
> !junit.framework,
> !sun.misc,
> com.google.inject.internal*;resolution:=optional,
> com.sun.jna ;resolution:=optional,
> com.thoughtworks.paranamer;resolution:=optional,
> edu.emory.mathcs.backport.java.util;resolution:=optional,
> javax.servlet*;resolution:=optional,
> kaffe*;resolution:=optional,
> org.apache.commons.httpclient*;resolution:=optional,
> org.apache.commons.jxpath*;resolution:=optional,
> org.apache.env*;resolution:=optional,
> org.apache.hadoop*;resolution:=optional,
> org.apache.http*;resolution:=optional,
> org.apache.log*;resolution:=optional,
> org.apache.pig*;resolution:=optional,
> org.apache.tools.ant*;resolution:=optional,,
> org.jboss.netty*;resolution:=optional,
> org.mortbay*;resolution:=optional,
> *
> </savoirtech.osgi.import>
> <savoirtech.osgi.export>
> org.apache.cassandra*;version=1.1.1,
> org.apache.thrift*;-split-package:=merge-first,
> </savoirtech.osgi.export>
> <savoirtech.osgi.private.pkg>
> antlr*,
> com.google.inject.internal*,
> com.ning.compress.lzf,
> com.sun.jna,
> org.yaml*,
> org.cliffc.high_scale_lib*,
> com.google*,
> com.googlecode*,
> com.googlecode.concurrentlinkedhashmap,
> edu.stanford.ppl.concurrent*,
> org.apache.avro*,
> org.codehaus.jackson*,
> org.antlr*,
> org.apache.commons*;-split-package:=merge-first,
> org.github*,
> org.xerial*,
> com.yammer*
> </savoirtech.osgi.private.pkg>
> <savoirtech.osgi.embed>concurrentlinkedhashmap-lru,cassandra-all</savoirtech.osgi.embed>
> <pkgGroupId>cassandra-all</pkgGroupId>
> </properties>
> </project>
>
>
> On Jun 25, 2012, at 3:16 PM, ramesh chandra wrote:
>
>> I am getting this error
>>
>> Caused by: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportException
>> ........
>>
>> Caused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransportException not found by me.prettyprint.hector [193]
>>
>> I have provided all the required dependencies, but for some reason , there is one 'libthrift' that can not be found by the server during runtime.
>>
>> I am not sure if what I attempted below is right and please correct me if there is a right way.
>>
>> in the config.properties file , I added
>> org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
>>
>> also I copied the jar in apache-karaf-2.2.7/lib folder
>>
>> this did not help, but I am not sure what is the right way to make karaf aware of libthrift.
>>
>> I also tried to install it as a bundle, but it did not help.
>>
>> What I am trying to accomplish is to add org.apache.thrift / libthrift
>>
>> to this list on System.getProperty("java.class.path")
>>
>>
>> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>>
>>
>>
>>
>>
>> Any help would be appreciated
>>
>> regards,
>> Ramesh
>>
>>
>
Re: adding dependency as a system package
Posted by Johan Edstrom <se...@gmail.com>.
If I remember correctly, that is a split package.
I think I posted a shade earlier, here is a complete bundle
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>bundles</artifactId>
<groupId>com.savoirtech</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cassandra-all</artifactId>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>apache-cassandra</artifactId>
<version>${cassandra.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-all</artifactId>
<version>${cassandra.version}</version>
<exclusions>
<exclusion>
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
<artifactId>concurrentlinkedhashmap-lru</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
<artifactId>concurrentlinkedhashmap-lru</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>${pkgGroupId}:${pkgArtifactId}</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>${pkgGroupId}:${pkgArtifactId}</artifact>
<excludes>
<exclude>**</exclude>
</excludes>
</filter>
</filters>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<createDependencyReducedPom>false</createDependencyReducedPom>
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<pkgVersion>${cassandra.version}</pkgVersion>
<pkgArtifactId>cassandra-all</pkgArtifactId>
<savoirtech.osgi.import>
!javax.inject,
!javax.mail.internet,
!jline,
!joptsimple,
!junit.framework,
!sun.misc,
com.google.inject.internal*;resolution:=optional,
com.sun.jna ;resolution:=optional,
com.thoughtworks.paranamer;resolution:=optional,
edu.emory.mathcs.backport.java.util;resolution:=optional,
javax.servlet*;resolution:=optional,
kaffe*;resolution:=optional,
org.apache.commons.httpclient*;resolution:=optional,
org.apache.commons.jxpath*;resolution:=optional,
org.apache.env*;resolution:=optional,
org.apache.hadoop*;resolution:=optional,
org.apache.http*;resolution:=optional,
org.apache.log*;resolution:=optional,
org.apache.pig*;resolution:=optional,
org.apache.tools.ant*;resolution:=optional,,
org.jboss.netty*;resolution:=optional,
org.mortbay*;resolution:=optional,
*
</savoirtech.osgi.import>
<savoirtech.osgi.export>
org.apache.cassandra*;version=1.1.1,
org.apache.thrift*;-split-package:=merge-first,
</savoirtech.osgi.export>
<savoirtech.osgi.private.pkg>
antlr*,
com.google.inject.internal*,
com.ning.compress.lzf,
com.sun.jna,
org.yaml*,
org.cliffc.high_scale_lib*,
com.google*,
com.googlecode*,
com.googlecode.concurrentlinkedhashmap,
edu.stanford.ppl.concurrent*,
org.apache.avro*,
org.codehaus.jackson*,
org.antlr*,
org.apache.commons*;-split-package:=merge-first,
org.github*,
org.xerial*,
com.yammer*
</savoirtech.osgi.private.pkg>
<savoirtech.osgi.embed>concurrentlinkedhashmap-lru,cassandra-all</savoirtech.osgi.embed>
<pkgGroupId>cassandra-all</pkgGroupId>
</properties>
</project>
On Jun 25, 2012, at 3:16 PM, ramesh chandra wrote:
> I am getting this error
>
> Caused by: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportException
> ........
>
> Caused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransportException not found by me.prettyprint.hector [193]
>
> I have provided all the required dependencies, but for some reason , there is one 'libthrift' that can not be found by the server during runtime.
>
> I am not sure if what I attempted below is right and please correct me if there is a right way.
>
> in the config.properties file , I added
> org.osgi.framework.system.packages.extra=libthrift-0.6.1; version="0.6.1"
>
> also I copied the jar in apache-karaf-2.2.7/lib folder
>
> this did not help, but I am not sure what is the right way to make karaf aware of libthrift.
>
> I also tried to install it as a bundle, but it did not help.
>
> What I am trying to accomplish is to add org.apache.thrift / libthrift
>
> to this list on System.getProperty("java.class.path")
>
>
> /home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf-jaas-boot.jar:/home/ramesh/Documents/osgiFramework/apache-karaf-2.2.7/lib/karaf.jar
>
>
>
>
>
> Any help would be appreciated
>
> regards,
> Ramesh
>
>