Topic
  • 6 replies
  • Latest Post - ‏2012-02-06T07:13:38Z by steven_screen
SystemAdmin
SystemAdmin
2233 Posts

Pinned topic No available bundle exports package 'javax.naming'

‏2011-10-06T13:31:40Z |
My environment: WASCEv3, Windows XP
I created a web application bundle which is using jndi lookup for a osgi service deployed by another bundle.
In the MANIFEST.XML i imported javax.naming and javax.naming.spi, but the GEP plugin marks these two packages as error.
See the attached picture.

If i do not import these packages the code does not work and fails with ClassNotFoundException.

I think the bundle is fine and this is only a GEP problem. Can someone confirm this ?

tamguru
Updated on 2012-02-06T07:13:38Z at 2012-02-06T07:13:38Z by steven_screen
  • JohnYiXiao
    JohnYiXiao
    5 Posts

    Re: No available bundle exports package 'javax.naming'

    ‏2011-10-08T01:43:28Z  
    Hi, I think the package javax.naming and javax.naming.spi could not be found in your project's classpath either in OSGI Dependencies or lib directory, you can try to add the jar files which contain the packages into the project's classpath to solve the problem.
  • SystemAdmin
    SystemAdmin
    2233 Posts

    Re: No available bundle exports package 'javax.naming'

    ‏2011-10-10T07:11:22Z  
    Hi, I think the package javax.naming and javax.naming.spi could not be found in your project's classpath either in OSGI Dependencies or lib directory, you can try to add the jar files which contain the packages into the project's classpath to solve the problem.
    javax.naming and javax.naming.spi are part of jdk6 (see pic) which is included in the jre system library.
    That is why i am thinking its a plugin problem.
  • Forrest_Xia
    Forrest_Xia
    82 Posts

    Re: No available bundle exports package 'javax.naming'

    ‏2011-10-10T16:39:33Z  
    what tools you are using to develop your web application bundle?

    GEP/WEP works together with an free OSGi tool "IBM Rational Development Tools for OSGi Applications" to manage the OSGi enterprise programming model artifacts.

    You can get more information on this link:
    http://www.ibm.com/developerworks/rational/downloads/10/rationaldevtoolsforosgiapplications.html
  • JohnYiXiao
    JohnYiXiao
    5 Posts

    Re: No available bundle exports package 'javax.naming'

    ‏2011-10-11T05:56:31Z  
    javax.naming and javax.naming.spi are part of jdk6 (see pic) which is included in the jre system library.
    That is why i am thinking its a plugin problem.
    I think you need not import the javax.naming.spi explicitly, as the osgi framework would use system classloade to load the classes in that package.
    If you really want to import the packages manually, you need to have a bundle that contains all the packages.
  • SystemAdmin
    SystemAdmin
    2233 Posts

    Re: No available bundle exports package 'javax.naming'

    ‏2011-10-11T06:42:45Z  
    what tools you are using to develop your web application bundle?

    GEP/WEP works together with an free OSGi tool "IBM Rational Development Tools for OSGi Applications" to manage the OSGi enterprise programming model artifacts.

    You can get more information on this link:
    http://www.ibm.com/developerworks/rational/downloads/10/rationaldevtoolsforosgiapplications.html
    see attachment
  • steven_screen
    steven_screen
    1 Post

    Re: No available bundle exports package 'javax.naming'

    ‏2012-02-06T07:13:38Z  
    see attachment
    etc/config.properties

    1. javax.transaction is needed to avoid class loader constraint violation when using javax.sql
    org.osgi.framework.bootdelegation=sun.,com.sun.,javax.naming, javax.naming.* ....