You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Elvy <pi...@gmail.com> on 2008/03/06 18:50:07 UTC
Reflection issues
Hi all,
- I'm embedding jbossall-client in my bundle.
- It contains org.jboss.security.ClientLoginModule
- By reflection, javax.security.auth.login.LoginContext (jdk), tries to
instantiate it.
- I get the following error : javax.security.auth.login.LoginException:
classe LoginModule introuvable : org.jboss.security.ClientLoginModule
Can JDK classes use reflection to instantiate classe a bundle provides?
If it can, is there anything special to do?
here's my pom maven-bundle-plugin conf:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Name>Ted Entity Plugin</Bundle-Name>
<Bundle-Version>${pom.version}</Bundle-Version>
<Export-Package>
!com.thalesgroup.ted.plugins.entity.impl,
com.thalesgroup.ted.plugins.entity.api.*,
com.thalesgroup.sc2.jddf.*,
org.jboss.security,
org.jboss.*
</Export-Package>
<Private-Package>com.thalesgroup.ted.plugins.entity.*</Private-Package>
<Import-Package>*;resolution:=optional</Import-Package>
<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Bundle-Activator>com.thalesgroup.ted.plugins.entity.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
-----
Tell me something you don't know!
--
View this message in context: http://www.nabble.com/Reflection-issues-tp15879678p15879678.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Reflection issues
Posted by Karl Pauls <ka...@gmail.com>.
Try to set the context class loader to the classloader that loaded
your bundle i.e.,
ClassLoader ccl = Thread.currentThread().getContextClassLoader();
try
{
Thread.currentThread.setContextClassLoader(getClass().getClassLoader());
// trigger jdk load
}
finally
{
Thread.currentThread().setContextClassLoader(ccl);
}
That should do the trick.
regards,
Karl
On Thu, Mar 6, 2008 at 6:50 PM, Elvy <pi...@gmail.com> wrote:
>
> Hi all,
>
> - I'm embedding jbossall-client in my bundle.
> - It contains org.jboss.security.ClientLoginModule
> - By reflection, javax.security.auth.login.LoginContext (jdk), tries to
> instantiate it.
> - I get the following error : javax.security.auth.login.LoginException:
> classe LoginModule introuvable : org.jboss.security.ClientLoginModule
>
> Can JDK classes use reflection to instantiate classe a bundle provides?
> If it can, is there anything special to do?
>
> here's my pom maven-bundle-plugin conf:
>
> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
> <version>1.4.0</version>
> <extensions>true</extensions>
> <configuration>
> <instructions>
> <Bundle-Name>Ted Entity Plugin</Bundle-Name>
> <Bundle-Version>${pom.version}</Bundle-Version>
> <Export-Package>
> !com.thalesgroup.ted.plugins.entity.impl,
> com.thalesgroup.ted.plugins.entity.api.*,
> com.thalesgroup.sc2.jddf.*,
> org.jboss.security,
> org.jboss.*
> </Export-Package>
>
> <Private-Package>com.thalesgroup.ted.plugins.entity.*</Private-Package>
>
> <Import-Package>*;resolution:=optional</Import-Package>
>
> <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
> <Embed-Transitive>true</Embed-Transitive>
>
> <Bundle-Activator>com.thalesgroup.ted.plugins.entity.Activator</Bundle-Activator>
> </instructions>
> </configuration>
> </plugin>
>
>
>
> -----
> Tell me something you don't know!
> --
> View this message in context: http://www.nabble.com/Reflection-issues-tp15879678p15879678.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
--
Karl Pauls
karlpauls@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org