Hi,

It looks like the mysql JDBC driver is trying to load the class. Coud it
be that the driver is using the thread context class loader to look for
the classes ?

In this case, you might want to set the thread context class loader to
the bundle's class loader before calling into JDBC (and don't forget to
reset the thread context class loader before returning from the activate
method (best in a finally clause):

HTH

Regards
Felix

Miguel schrieb:
> Hi,
> I am facing a issue regarding getting GWT within an OSGi framework.
> I try to connect the gwt server part with a OSGi component, and this GWT
> server  bundle use another OSGi database component.
> The problem is that when I start gwt server bundle I get the followin error:
> 
> [SCR Component Actor] ERROR com.as.gwtserver -
> [com.as.server.gwt.component] The activate method has thrown an exception
> java.lang.NoClassDefFoundError: javax/naming/RefAddr
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:169)
> at com.mysql.jdbc.ConnectionProperties.class$(ConnectionProperties.java:546)
> at
> com.mysql.jdbc.ConnectionProperties.<clinit>(ConnectionProperties.java:560)
> at
> com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
> [...]
> 
> Caused by: java.lang.ClassNotFoundException: javax.naming.RefAddr
> 
> 
> But, If you have a look into the manifest file of the gwt server bundle,
> everything seems to be ok:
> 
> Import-Package: com.as.bbdd,
> javax.naming,
> 
> osgi> bundle 37
> com.as.gwtserver_1.0.0 [37]
> [...]
> Imported packages
> 
>     javax.naming; version="0.0.0"<org.eclipse.osgi_3.5.0.v20090520 [0]>
> 
> 
> I have imported javax.naming but it keeps on saying me that it can not
> find the class.
> I have also try using -Dosgi.parentClassloader=ext but I get the same error,
> 
> can anybody help me?
> thank you very much.
> 
> Miguel
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to