You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Guillaume Nodet <gn...@gmail.com> on 2008/11/10 12:11:47 UTC

Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Did you make sure you have the needed osgi import header for the
missing package.

On Mon, Nov 10, 2008 at 11:36 AM,  <ma...@gmx.at> wrote:
> HI,
>
> I reopened Issue SM-1662 (https://issues.apache.org/activemq/browse/SM-1662) because of an error when sun.misc.BASE64Encoder is only referenced in 3rd party lib and not in SMX stuff.
>
> Do you know how to fix this?
>
> TIA
>
> Regards
> Martin
>
> gnodet wrote:
>>
>> I've just fixed the issue.  Until a new release is available, you'd
>> have to use a snapshot of servicemix-common.
>> We have nightly builds running, the if you wait until tommorow, you
>> should be able to grab the latest jar at
>>
>> http://people.apache.org/repo/m2-snapshot-repository/org/apache/servicemix/servicemix-common/2008.02-SNAPSHOT/
>> You can replace the copy from your
>> [install]/system/org/apache/servicemix/servicemix-common/ folder with
>> the above one (you need to keep the same name as the existing one),
>> delete your [install]/data folder and start again servicemix.
>>
>> On Mon, Oct 27, 2008 at 8:08 AM, Guillaume Nodet <gn...@gmail.com> wrote:
>>> Sorry about the delay.
>>> I've raise a JIRA at
>>> https://issues.apache.org/activemq/browse/SM-1662.  I have a fix ready
>>> for that, but I need to test it to make sure it works.
>>>
>>> On Fri, Oct 24, 2008 at 1:31 PM, Martin Kuhn <ma...@gmx.at> wrote:
>>>>
>>>>
>>>> gnodet wrote:
>>>>>
>>>>> I think this is a bug where the JBI SAs expect the whole JRE to be
>>>>> available, but in OSGi this is not the case.
>>>>> I think I've found a fix, but I'm not sure there is a workaround :-(
>>>>>
>>>>>
>>>>
>>>>
>>>> What does this mean? Is there anything I can do?
>>>>
>>>>
>>>> TIA
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20145109p20149232.html
>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>>
> Quoted from:
> http://www.nabble.com/SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20145109p20185818.html
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Martin Kuhn <ma...@gmx.at>.
With the lastest snapshot it works as expected

Thank you.



gnodet wrote:
> 
> No, if you add <classpath/> it should work with the previous version
> as a work around.
> I've fixed the issue so that if you use tomorrow's snapshot, you
> should not need that extra xml element.
> So it's no #1 and #2, but #1 or #2
> 
> 

-- 
View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20617801.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Guillaume Nodet <gn...@gmail.com>.
No, if you add <classpath/> it should work with the previous version
as a work around.
I've fixed the issue so that if you use tomorrow's snapshot, you
should not need that extra xml element.
So it's no #1 and #2, but #1 or #2

On Thu, Nov 20, 2008 at 9:44 AM, Martin Kuhn <ma...@gmx.at> wrote:
>
>
> gnodet wrote:
>>
>> I've committed a fix for the issue and the SU from your test case
>> works as expected.
>>
>
> Fine, thanks!
>
> For clarification, this means:
>
> 1) waiting until tomorrow and use the current snapshot version from
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/servicemix/servicemix-common/2008.02-SNAPSHOT/
>
> 2) add <classpath/> to my xbean.xml of the SU
>
> I'll test it tommorow.
>
> Thanks
>
>
>
>
> --
> View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20597103.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Martin Kuhn <ma...@gmx.at>.

gnodet wrote:
> 
> I've committed a fix for the issue and the SU from your test case
> works as expected.
> 

Fine, thanks!

For clarification, this means:

1) waiting until tomorrow and use the current snapshot version from
http://people.apache.org/repo/m2-snapshot-repository/org/apache/servicemix/servicemix-common/2008.02-SNAPSHOT/

2) add <classpath/> to my xbean.xml of the SU

I'll test it tommorow.

Thanks




-- 
View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20597103.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Guillaume Nodet <gn...@gmail.com>.
I've committed a fix for the issue and the SU from your test case
works as expected.

On Thu, Nov 20, 2008 at 8:39 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> I've been able to reproduce the issue.  I need to debug the problem now.
>
> On Fri, Nov 14, 2008 at 2:29 PM, Martin Kuhn <ma...@gmx.at> wrote:
>>
>>
>> gnodet wrote:
>>>
>>> If your 3thd party library is embedded in the SU, it will have the
>>> same classloader as the classes you wrote.
>>> So I don't really see why this would fail.   Could you set up a test
>>> case and attach it to a JIRA issue so that I can reproduce the issue ?
>>>
>>
>>
>> I attached a really simple test case to the issue
>> (https://issues.apache.org/activemq/browse/SM-1662) which leads to
>> NoClassDefFoundError
>> (Environment: Fuse 4.0.2 with updated
>> servicemix-common-2008.01.0.0-fuse.jar, WinXP, JDK 1.6 (build 1.6.0_10-b33))
>> --
>> View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20500505.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Guillaume Nodet <gn...@gmail.com>.
I've been able to reproduce the issue.  I need to debug the problem now.

On Fri, Nov 14, 2008 at 2:29 PM, Martin Kuhn <ma...@gmx.at> wrote:
>
>
> gnodet wrote:
>>
>> If your 3thd party library is embedded in the SU, it will have the
>> same classloader as the classes you wrote.
>> So I don't really see why this would fail.   Could you set up a test
>> case and attach it to a JIRA issue so that I can reproduce the issue ?
>>
>
>
> I attached a really simple test case to the issue
> (https://issues.apache.org/activemq/browse/SM-1662) which leads to
> NoClassDefFoundError
> (Environment: Fuse 4.0.2 with updated
> servicemix-common-2008.01.0.0-fuse.jar, WinXP, JDK 1.6 (build 1.6.0_10-b33))
> --
> View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20500505.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Martin Kuhn <ma...@gmx.at>.

gnodet wrote:
> 
> If your 3thd party library is embedded in the SU, it will have the
> same classloader as the classes you wrote.
> So I don't really see why this would fail.   Could you set up a test
> case and attach it to a JIRA issue so that I can reproduce the issue ?
> 


I attached a really simple test case to the issue
(https://issues.apache.org/activemq/browse/SM-1662) which leads to
NoClassDefFoundError 
(Environment: Fuse 4.0.2 with updated
servicemix-common-2008.01.0.0-fuse.jar, WinXP, JDK 1.6 (build 1.6.0_10-b33))
-- 
View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20500505.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Guillaume Nodet <gn...@gmail.com>.
If your 3thd party library is embedded in the SU, it will have the
same classloader as the classes you wrote.
So I don't really see why this would fail.   Could you set up a test
case and attach it to a JIRA issue so that I can reproduce the issue ?

On Thu, Nov 13, 2008 at 7:53 AM, Martin Kuhn <ma...@gmx.at> wrote:
>
>
> gnodet wrote:
>>
>> Did you make sure you have the needed osgi import header for the
>> missing package.
>>
>
> It is a commercial library we bought from a software company.
>
> The only thing I did was to define the lib in our maven repository and to
> define a dependency in the Maven pom file.
>
> I have NO osgi specific def's in my SA and SU's. The whole stuff is based on
> the SMX Maven archetypes. So the SA contains a SU which contains a jar file
> of the 3rd party jar file.
>
> BTW, it would be really nice to find documentation what  the differences
> between the different things are
> (in the examples there are three camel examples, camel, camel-nmr,
> camel-osgi -> I've no idea what are the differenences and in what situation
> I use should use it)
>
> From my point of view I want to use infrastructural things of SMX (most
> important loosely coupling of components, and hot deployment capabilities).
> And it is very impressive what SMX provides from a technical point of view.
> But the experience with SMX is really painfull and frustrating. Even the
> simplest things don't work for me without spending much time.
> Furthermore it came to two problems where SMX guys (like you) have to fix
> errors.
>
> I would really like to have a book or something  which explains things but
> the material I read until now helped not so much.
> E.g. camel for routing -> you need much imaginativeness to grasp how to code
> it in reality.
>
> --
> View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20475646.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Martin Kuhn <ma...@gmx.at>.

gnodet wrote:
> 
> Did you make sure you have the needed osgi import header for the
> missing package.
> 

It is a commercial library we bought from a software company. 

The only thing I did was to define the lib in our maven repository and to
define a dependency in the Maven pom file.

I have NO osgi specific def's in my SA and SU's. The whole stuff is based on
the SMX Maven archetypes. So the SA contains a SU which contains a jar file
of the 3rd party jar file.

BTW, it would be really nice to find documentation what  the differences
between the different things are 
(in the examples there are three camel examples, camel, camel-nmr,
camel-osgi -> I've no idea what are the differenences and in what situation
I use should use it)

>From my point of view I want to use infrastructural things of SMX (most
important loosely coupling of components, and hot deployment capabilities).
And it is very impressive what SMX provides from a technical point of view.
But the experience with SMX is really painfull and frustrating. Even the
simplest things don't work for me without spending much time.
Furthermore it came to two problems where SMX guys (like you) have to fix
errors.

I would really like to have a book or something  which explains things but
the material I read until now helped not so much.
E.g. camel for routing -> you need much imaginativeness to grasp how to code
it in reality.

-- 
View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20475646.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Guillaume Nodet <gn...@gmail.com>.
Which third party uses it and how did you deploy it in osgi ?

On Tue, Nov 11, 2008 at 8:10 AM, Martin Kuhn <ma...@gmx.at> wrote:
>
>
> gnodet wrote:
>>
>> Did you make sure you have the needed osgi import header for the
>> missing package.
>>
>
> No, I have no import header for the missing package. I don't know how to
> define the needed import header for the missing package. Is there an example
> or documentation??????
>
> The funny thing is that when I use sun.misc.Base64Encoder directly in my SMX
> bean it works with your fix. But when a 3rd party lib use it I get the
> java.lang.NoClassDefFoundError.
>
>
>
> --
> View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20434548.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: SM4: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder !!

Posted by Martin Kuhn <ma...@gmx.at>.

gnodet wrote:
> 
> Did you make sure you have the needed osgi import header for the
> missing package.
> 

No, I have no import header for the missing package. I don't know how to
define the needed import header for the missing package. Is there an example
or documentation??????

The funny thing is that when I use sun.misc.Base64Encoder directly in my SMX
bean it works with your fix. But when a 3rd party lib use it I get the
java.lang.NoClassDefFoundError.



-- 
View this message in context: http://www.nabble.com/Re%3A-SM4%3A-java.lang.NoClassDefFoundError%3A-sun-misc-BASE64Encoder-%21%21-tp20418115p20434548.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.