0 Replies Latest reply on Apr 24, 2013 1:31 PM by tommybs

    OSGi Bundle-Classpath: manifest entry does not support spaces in classpath specification

    tommybs

      I have 2 WAB bundles, one which deployed perfectly, and one that refused to deploy with a an error that did not come close to indicate what was wrong. I had to extreme compare the two to find the problem: The failing one had spaces in Bundle-Classpath: manifest entry.

       

      I use maven and apaches maven-bundle-plugin. The working one looks like this:

       

           ...

           <Bundle-ClassPath>.,WEB-INF/classes,WEB-INF/lib/vaadin-${vaadin-ver}.jar,WEB-INF/lib/aps-web-tools-${project.version}.jar</BundleClassPath>

           ...

       

      This produces a Bundle-ClassPath looking like this:

       

      Bundle-ClassPath: .,WEB-INF/classes,WEB-INF/lib/vaadin-6.8.1.jar,WEB-I

      NF/lib/aps-web-tools-0.9.2.jar

       

       

      while the failing one looked like this:

       

           ...

           <Bundle-ClassPath>

                .,

                WEB-INF/classes,

                WEB-INF/lib/vaadin-${vaadin-ver}.jar,

                WEB-INF/lib/aps-web-tools-${project.version}.jar

           </Bundle-ClassPath>

           ...

       

      This produces a Bundle-ClassPath looking like this:

       

      Bundle-ClassPath: .,            WEB-INF/classes,            WEB-INF/li

      b/vaadin-6.8.1.jar,            WEB-INF/lib/aps-web-tools-0.9.2.jar

       

      This one fails to deploy with the following error:

       

      19:06:42,192 INFO  [org.jboss.web] (ServerService Thread Pool -- 92) JBAS018210: Register web context: /apsadminweb

      19:06:42,211 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/apsadminweb]] (ServerService Thread Pool -- 92) JBWEB000285: Error configuring application listener of class se.natusoft.osgi.aps.tools.web.vaadin.APSSessionListener: java.lang.ClassNotFoundException: se.natusoft.osgi.aps.tools.web.vaadin.APSSessionListener from [Module "deployment.aps-admin-web-0.9.2.war:main" from Service Module Loader]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.2.0.CR1-redhat-1]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1-redhat-1]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1-redhat-1]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.2.0.CR1-redhat-1]

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.2.0.CR1-redhat-1]

                at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:74) [jboss-as-web-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]

                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3294) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

                at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]

                at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]

                at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]

                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_17]

                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_17]

                at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_17]

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]

                at org.jboss.threads.JBossThread.run(JBossThread.java:122)

       

       

      19:06:42,214 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/apsadminweb]] (ServerService Thread Pool -- 92) JBWEB000286: Skipped installing application listeners due to previous error(s)

      19:06:42,214 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 92) JBWEB001103: Error detected during context /apsadminweb start, will stop it

      19:06:42,215 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 92) MSC000001: Failed to start service jboss.web.deployment.default-host./apsadminweb: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./apsadminweb: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context

                at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)

                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_17]

                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_17]

                at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_17]

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]

                at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context

                at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)

                at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)

                at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)

                ... 7 more

       

       

      19:06:42,292 INFO  [org.jboss.osgi.framework] (MSC service thread 1-12) JBOSGI011002: Bundle started: aps-admin-web:0.9.2

      19:06:42,293 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./apsadminweb: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./apsadminweb: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context

       

       

      Removing the spaces solves the problem. Both Glassfish (uses Felix) and Virgo (uses Equinox) handles this Bundle-ClassPath with spaces without any problem. JBoss seems to use Felix so I assume this is a JBoss problem not a Felix problem. I'm not sure what the OSGi specification says about this.