Hi all,

Above issue comes due to snappy-java loads the native library to java
extension class loader but in our osgi environment parent classloader of
the org.eclipse.osgi.baseadaptor.BaseAdaptor classloader is null (which is
the parent classloader of the snappy-java bundle).  Is that the
default behavior in OSGI ? or is it a bug ?
because of that bundle class loader can't find the native library loaded by
the java extension classloader.

I was able to solve this issue by patching the above snappy-java bundle to
load the native library to bundle classloader it self.

If it is not a bug in osgi environment, shall I commit this patched
snappy-java source to our dependencies?

Thanks,
KasunW


On Fri, Apr 27, 2012 at 8:16 PM, Kasun Weranga <kas...@wso2.com> wrote:

> Hi,
>
> After upgrading to Cassandra 1.1.0, I am facing some issue when starting
> the Cassandra server.
>
> This is the exception
>
> [2012-04-27 19:31:38,740]  INFO {org.apache.cassandra.db.Memtable} -
>  Writing Memtable-go@1431496612(656/820 serialized/live bytes, 12 ops)
> [2012-04-27 19:31:38,745] ERROR
> {org.apache.cassandra.service.AbstractCassandraDaemon} -  Exception in
> thread Thread[FlushWriter:1,5,main]
> java.lang.UnsatisfiedLinkError:
> org.xerial.snappy.SnappyNative.maxCompressedLength(I)I
>  at org.xerial.snappy.SnappyNative.maxCompressedLength(Native Method)
> at org.xerial.snappy.Snappy.maxCompressedLength(Snappy.java:316)
>  at
> org.apache.cassandra.io.compress.SnappyCompressor.initialCompressedBufferLength(SnappyCompressor.java:42)
>  at
> org.apache.cassandra.io.compress.CompressedSequentialWriter.<init>(CompressedSequentialWriter.java:63)
> at
> org.apache.cassandra.io.compress.CompressedSequentialWriter.open(CompressedSequentialWriter.java:34)
>  at
> org.apache.cassandra.io.sstable.SSTableWriter.<init>(SSTableWriter.java:91)
> at
> org.apache.cassandra.db.ColumnFamilyStore.createFlushWriter(ColumnFamilyStore.java:1848)
>  at
> org.apache.cassandra.db.Memtable.writeSortedContents(Memtable.java:281)
> at org.apache.cassandra.db.Memtable.access$600(Memtable.java:48)
>  at org.apache.cassandra.db.Memtable$5.runMayThrow(Memtable.java:318)
> at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:30)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>  at java.lang.Thread.run(Thread.java:619)
>
>
> This issue comes from snappy-java-1.0.4.1 library and it might be because
> it uses a native library (libsnappyjava.so) and there are some issues
> when it try to load that native library in osgi environment.
>
> According to this [1] previously it didn't work with tomcat too. but they
> have done some hack to get it work.
>
> Does anybody know how to overcome this issue?
>
> [1] http://code.google.com/p/snappy-java/issues/detail?id=21
>
>
> Thanks,
> KasunW
>
>
> On Wed, Apr 25, 2012 at 8:31 PM, Shammi Jayasinghe <sha...@wso2.com>wrote:
>
>>
>>
>> On Wed, Apr 25, 2012 at 5:55 PM, Deependra Ariyadewa <d...@wso2.com>wrote:
>>
>>>
>>>
>>> On Wed, Apr 25, 2012 at 2:23 PM, Kasun Weranga <kas...@wso2.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> Shall we do the $subject. That is because currently we are facing some
>>>> issues when trying to integrate Cassandra storage handler (available
>>>> externally) into Hive. Since hive uses libthrift 0.7 and Cassandra 1.0.8
>>>> (current carbon version) uses libthrift 0.6, but the problem is
>>>> cassandra-handler needs to communicate with both hive and cassandra so it
>>>> needs to use only one thrift version.
>>>> We need to fix this issue before our first milestone coming in few
>>>> days.  We can overcome this issue easily by upgrading to new cassandra
>>>> 1.1.0 version because it uses libthrift 0.7.
>>>> Also we can take the advantage of the new improvements coming with the
>>>> new Cassandra release.
>>>> Shall we do it ?
>>>>
>>>
>>> It is good have the latest Cassandra version with 4.0.0 release.
>>>
>>> There are changes done in Cassandra dependency to enable Carbon user
>>> permission scheme which We have to merge with Cassandra 1.1.x. Also we have
>>> to verify dependency library list for possible version conflicts.
>>>
>>> It is good to get feed back from MB developers before do this change.
>>>
>>> +1
>>
>> Thanks
>> Shammi
>>
>>> Thanks,
>>>
>>> Deependra.
>>>
>>>
>>>
>>>> Thanks,
>>>> KasunW
>>>>
>>>>
>>>
>>>
>>> --
>>> Deependra Ariyadewa
>>> WSO2, Inc. http://wso2.com/ http://wso2.org
>>>
>>> email d...@wso2.com; cell +94 71 403 5996 ;
>>> Blog http://risenfall.wordpress.com/
>>> PGP info: KeyID: 'DC627E6F'
>>>
>>>
>>
>>
>> --
>> Best Regards,*
>>
>> Shammi Jayasinghe*
>> Senior Software Engineer; WSO2, Inc.; http://wso2.com,
>> mobile: +94 71 4493085
>>
>>
>>
>
>
> --
> *Kasun Weranga*
> Software Engineer
> **
> *WSO2, Inc.
> *lean.enterprise.middleware.
> mobile : +94 772314602
> <http://sanjeewamalalgoda.blogspot.com/>blog 
> :<http://sanjeewamalalgoda.blogspot.com/>
> http://kasunweranga.blogspot.com/
>



-- 
*Kasun Weranga*
Software Engineer
**
*WSO2, Inc.
*lean.enterprise.middleware.
mobile : +94 772314602
<http://sanjeewamalalgoda.blogspot.com/>blog
:<http://sanjeewamalalgoda.blogspot.com/>
http://kasunweranga.blogspot.com/
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to