You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Rajbir Saini <ra...@yahoo.com> on 2014/10/07 13:07:21 UTC

java.lang.NoClassDefFoundError for javax.security.auth* packages

Hi,

I am using Apache Karaf with JAAS login module. My application throws 
java.lang.NoClassDefFoundError exception. If I import that 
javax.security.auth* packages in my bundle this problem is resolved. As 
these packages are provided by JRE, do I need to import them? I am using 
Karaf 3.0.1.

As I use Maven + Tycho for development, javax.security.auth* packages 
are not available for import and this causes PDE to show errors in 
manifest file.

Regards,

Raj





Re: java.lang.NoClassDefFoundError for javax.security.auth* packages

Posted by Rajbir Saini <ra...@yahoo.com>.
Sorry, I realized that removing javax.security.auth.* will not auto 
export those packages.

The workaround to my problem is to add the javax.security.auth.* to 
org.osgi.framework.bootdelegation thought this is strongly discouraged [1]

[1] 
http://wiki.osgi.org/wiki/Why_does_Eclipse_find_javax.swing_but_not_Felix%3F

Regards,

Raj

On Tuesday 07 October 2014 05:41 PM, Rajbir Saini wrote:
> Thanks JB. I think some thing has changes in the current version of 
> Eclipse and it does not export these packages and they are not 
> available for import in the PDE.
>
> Is there a workaround? What happens if I remove the 
> javax.security.auth* from system packages?
>
> Regards,
>
> Raj
>
> On Tuesday 07 October 2014 05:28 PM, Jean-Baptiste Onofré wrote:
>> Hi Raj,
>>
>> even if the packages are provided by the JRE (and defined in 
>> etc/jre.properties), you have to import it in your bundle: it's what 
>> we name the system packages.
>>
>> Regards
>> JB
>>
>> On 10/07/2014 01:07 PM, Rajbir Saini wrote:
>>> Hi,
>>>
>>> I am using Apache Karaf with JAAS login module. My application throws
>>> java.lang.NoClassDefFoundError exception. If I import that
>>> javax.security.auth* packages in my bundle this problem is resolved. As
>>> these packages are provided by JRE, do I need to import them? I am 
>>> using
>>> Karaf 3.0.1.
>>>
>>> As I use Maven + Tycho for development, javax.security.auth* packages
>>> are not available for import and this causes PDE to show errors in
>>> manifest file.
>>>
>>> Regards,
>>>
>>> Raj
>>>
>>>
>>>
>>>
>>
>
>


Re: java.lang.NoClassDefFoundError for javax.security.auth* packages

Posted by Rajbir Saini <ra...@yahoo.com>.
Thanks JB. I think some thing has changes in the current version of 
Eclipse and it does not export these packages and they are not available 
for import in the PDE.

Is there a workaround? What happens if I remove the javax.security.auth* 
from system packages?

Regards,

Raj

On Tuesday 07 October 2014 05:28 PM, Jean-Baptiste Onofré wrote:
> Hi Raj,
>
> even if the packages are provided by the JRE (and defined in 
> etc/jre.properties), you have to import it in your bundle: it's what 
> we name the system packages.
>
> Regards
> JB
>
> On 10/07/2014 01:07 PM, Rajbir Saini wrote:
>> Hi,
>>
>> I am using Apache Karaf with JAAS login module. My application throws
>> java.lang.NoClassDefFoundError exception. If I import that
>> javax.security.auth* packages in my bundle this problem is resolved. As
>> these packages are provided by JRE, do I need to import them? I am using
>> Karaf 3.0.1.
>>
>> As I use Maven + Tycho for development, javax.security.auth* packages
>> are not available for import and this causes PDE to show errors in
>> manifest file.
>>
>> Regards,
>>
>> Raj
>>
>>
>>
>>
>


Re: java.lang.NoClassDefFoundError for javax.security.auth* packages

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Raj,

even if the packages are provided by the JRE (and defined in 
etc/jre.properties), you have to import it in your bundle: it's what we 
name the system packages.

Regards
JB

On 10/07/2014 01:07 PM, Rajbir Saini wrote:
> Hi,
>
> I am using Apache Karaf with JAAS login module. My application throws
> java.lang.NoClassDefFoundError exception. If I import that
> javax.security.auth* packages in my bundle this problem is resolved. As
> these packages are provided by JRE, do I need to import them? I am using
> Karaf 3.0.1.
>
> As I use Maven + Tycho for development, javax.security.auth* packages
> are not available for import and this causes PDE to show errors in
> manifest file.
>
> Regards,
>
> Raj
>
>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com