2 Replies Latest reply on Jan 14, 2013 11:18 PM by Tang Yong

    Jboss AS 7.1.1.Final Issue with reading JNDI URI using OSGI Bundle Context.

    Balaji B Newbie

      Hi,

       

           I am working on migrating my application from Jboss 6 to Jboss 7.1.1.Final. My application contains a EAR file and in which we have a WAR File named library.war. This library.war file consists of OSGI bundles placed under WEB-INF/bundles/1 and

        WEB-INF/bundles/2  folders. So at the startup of the library.war the application reads the OSGI bundles placed in bundles folder and intializes OSGI Felix Console required for the application. The Code snippet used for the reading the bundles is

       

      Code Snippet

      ==========

      <Getting Bundles details ..>

      private List<URL> getBundleList1() throws Exception

                {

                          ArrayList<URL> list = new ArrayList<URL>();

                          for(Object object : servletContext.getResourcePaths("/WEB-INF/bundles/1")) {

                                    String name = (String) object;

                                    if(name.endsWith(".jar") || name.endsWith(".war")) {

                                              URL url = servletContext.getResource(name);

                                              if(url != null) {

                                                        list.add(url);

                                              }

                                    }

                          }

       

                          return list;

                }

       

       

      // Installing the Felix Bundles

      for(URL url : getBundleList1()) {

                                    logger.info("Installing bundle [" + url + "]");

                                    Bundle bundle = context.installBundle(url.toExternalForm());

                                    installed1.add(bundle);

                          }

       

      While doing the intialization of bundles we are getting the below error which we didn't used to get in previous version of Jboss AS. Please let us know if any additional settings needed for this code snippet to work. Find the Error trace below.

       

      Error

      -------

      14:50:37,971 INFO [com.hpexstream.lal.launchpad.FrameworkService] (MSC service thread 1-7) Initializing OSGi framework...

      14:50:38,002 INFO [com.hpexstream.lal.launchpad.HostActivator] (MSC service thread 1-7) Starting the host bundle

      14:50:38,034 INFO [com.hpexstream.lal.launchpad.HostActivator] (MSC service thread 1-7) Installing bundle [jndi:/localhost/library/WEB-INF/bundles/1/com.springsource.javax.el-1.0.0.jar]

      14:50:38,049 INFO  [stdout] (MSC service thread 1-7) ERROR: Unable to start system bundle. (org.osgi.framework.BundleException: Unable to cache bundle: jndi:/localhost/library/WEB-INF/bundles/1/com.springsource.javax.el-1.0.0.jar)

       

      14:50:38,049 ERROR [stderr] (MSC service thread 1-7) java.net.MalformedURLException: Unknown protocol: jndi

       

      14:50:38,049 ERROR [stderr] (MSC service thread 1-7) at java.net.URL.<init>(URL.java:601)

       

      14:50:38,065 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.util.SecureAction.createURL(SecureAction.java:238)

       

      14:50:38,065 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:150)

       

      14:50:38,065 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:81)

       

      14:50:38,065 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:59)

       

      14:50:38,065 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:1019)

       

      14:50:38,065 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.cache.BundleArchive.revise(BundleArchive.java:630)

       

      14:50:38,065 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:146)

       

      14:50:38,065 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:169)

       

      14:50:38,080 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.Felix.installBundle(Felix.java:2481)

       

      14:50:38,080 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.Felix.installBundle(Felix.java:2441)

       

      14:50:38,080 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:129)

       

      14:50:38,080 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:107)

       

      14:50:38,080 ERROR [stderr] (MSC service thread 1-7) at com.hpexstream.lal.launchpad.HostActivator.start(HostActivator.java:51)

       

      14:50:38,080 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:633)

       

      14:50:38,080 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.Felix$SystemBundleActivator.start(Felix.java:4277)

       

      14:50:38,080 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:633)

       

      14:50:38,096 ERROR [stderr] (MSC service thread 1-7) at org.apache.felix.framework.Felix.init(Felix.java:734)

       

      14:50:38,096 ERROR [stderr] (MSC service thread 1-7) at com.hpexstream.lal.launchpad.FrameworkService.doStart(FrameworkService.java:92)

       

      14:50:38,096 ERROR [stderr] (MSC service thread 1-7) at com.hpexstream.lal.launchpad.FrameworkService.start(FrameworkService.java:41)

       

      14:50:38,096 ERROR [stderr] (MSC service thread 1-7) at com.hpexstream.lal.launchpad.StartupServlet.init(StartupServlet.java:13)

       

      14:50:38,096 ERROR [stderr] (MSC service thread 1-7) at javax.servlet.GenericServlet.init(GenericServlet.java:242)

       

      14:50:38,096 ERROR [stderr] (MSC service thread 1-7) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202)

       

      14:50:38,096 ERROR [stderr] (MSC service thread 1-7) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102)

       

      14:50:38,096 ERROR [stderr] (MSC service thread 1-7) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655)

       

      14:50:38,112 ERROR [stderr] (MSC service thread 1-7) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873)

       

      14:50:38,112 ERROR [stderr] (MSC service thread 1-7) at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)

       

      14:50:38,112 ERROR [stderr] (MSC service thread 1-7) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

       

      14:50:38,112 ERROR [stderr] (MSC service thread 1-7) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

       

      14:50:38,112 ERROR [stderr] (MSC service thread 1-7) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

       

      14:50:38,112 ERROR [stderr] (MSC service thread 1-7) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

       

      14:50:38,112 ERROR [stderr] (MSC service thread 1-7) at java.lang.Thread.run(Thread.java:662)

       

      14:50:38,127 ERROR [com.hpexstream.lal.launchpad.FrameworkService] (MSC service thread 1-7) Failed to start OSGi framework: java.lang.RuntimeException: Unable to start system bundle.

      at org.apache.felix.framework.Felix.init(Felix.java:741) [org.apache.felix.framework-3.0.1.jar:]

      at com.hpexstream.lal.launchpad.FrameworkService.doStart(FrameworkService.java:92) [classes:]

      at com.hpexstream.lal.launchpad.FrameworkService.start(FrameworkService.java:41) [classes:]

      at com.hpexstream.lal.launchpad.StartupServlet.init(StartupServlet.java:13) [classes:]

      at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]

      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]

      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

       

       

      Regards,

      Balaji B.