On 21 April 2010 03:36, Shrivallabh Deshmukh <[email protected]> wrote:
> Once I did that, it started cribbing for sun internal packages. Isnt there > a > simpler method to ensure that all jdk classes are available by default? > the standard set of public packages in the JDK is automatically exported by the system bundle, but to make them visible in your client bundle you need to import them (except the java.* packages which are always visible to everyone) this is so you can choose between the JDK provided javax libraries and alternative implementations/versions of them - otherwise everyone would be forced to use the JDK implementation (which could be back-level / broken) but if you're not worried about using other versions of these packages you could always add them to the "org.osgi.framework.bootdelegation" property which then means you wouldn't need to add imports for them: "org.osgi.framework.bootdelegation=javax.*,sun.*,com.sun.*" note: the reason you saw the message about internal sun packages is probably because you added the jsse.jar to the bundle classpath, which meant its content was loaded by the bundle classloader and was therefore limited to only see what the bundle contained/imported - if you add "javax.net.ssl" to the bundle imports, or use the bootdelegation approach then you shouldn't see this error because the jsse.jar will be loaded by the extension class loader (as in classic java) and will be able to see the internal sun packages from the JDK HTH > On Wed, Apr 21, 2010 at 12:34 AM, Ali Naddaf <[email protected]> wrote: > > > I believe you need to import javax.* packages explicitly; only java.* > > packages are visible by default. > > > > Ali. > > > > > > On 4/20/2010 1:59 PM, Shrivallabh Deshmukh wrote: > > > >> My plugin uses the webservices api which relies on creating an https > >> connection. > >> > >> > >> > >> The bundle class loader cannot resolve the classes present with the jre > >> (jsse jar) > >> > >> > >> > >> java.lang.NoClassDefFoundError: javax/net/ssl/HostnameVerifier > >> > >> > >> > >> > >> > >> I tried adding jsse.jar explicitly using the manifest (duplicate classes > >> loaded by the classloader), then it began to crib about internal sun > >> packages. > >> > >> > >> > >> Any idea why this could be happening? Is there any reason why the bundle > >> class loader would not see these classes? > >> > >> > >> > >> Regards > >> > >> > >> Shrivallabh > >> > >> > >> > > > -- Cheers, Stuart

