3 Replies Latest reply on Jun 9, 2013 2:31 AM by ffrench.mathilde

    Exception when adding org.json to JBoss AS7 (EAP-6.1)

    ffrench.mathilde

      Hello guys !

       

      I'm currently trying to add org.json.20090211 to my JBoss environment.

       

      First, as the default package you can find on the web is not OSGI compliant I OSGIfy it with bundlor.sh. Result is attached to that thread.

       

      So my new json bundle is located in my local maven repository : ~/.m2/repository/org/json/json/1.0.0/json-1.0.0.jar. When I deploy it through the JBoss web app there is no problem (checked through the felix web app)...

       

      First problem comes when I reboot my AS7 : then my json bundle can't be activated for some reason I don't understand yet. Bellow the error raised on the jboss console (sorry for the english / french mix, I translate when it's french):

       

      12:21:30,506 INFO  [org.jboss.osgi.framework] (MSC service thread 1-7) JBOSGI011001: Bundle installed: org.json.json:1.0.0

      12:21:30,956 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Déploiement de "json" (runtime-name: "json-1.0.0.jar") [json deployment]

      12:21:30,960 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Rapport de statut de service [status report]

      JBAS014775: Nouvelles dépendances manquantes/non complétées : [new dependencies missing]

      Dépendances service [Service dependency] jbosgi.PersistentBundles.COMPLETE (manquantes)[missing] : [service jbosgi.internal.framework.INIT, service jboss.deployment.unit."json-1.0.0.jar".CONFIGURE_MODULE]

      Dépendances service [Service dependency] jboss.osgi.as.initial.deployments.COMPLETE (manquantes)[missing] : [service jbosgi.PersistentBundles.INSTALL]

       

       

      So here's the first error I would like to understand but as finally I want my JSON bundle to be in the OSGI capabilities this is not the worst one from my point of view...

       

       

      So I removed my json bundle thanks the jboss web app and tried to add it as an osgi capability. As there seems to be dependencies problems I defined this capabilitie with startlevel 4 for test :

       

      <capability name="org.json:json:1.0.0" startlevel="4"/>

       

      Unfortunately I get this new error when I restarted JBoss :

       

      12:30:23,570 INFO  [org.jboss.osgi.repository] (MSC service thread 1-1) JBOSGI020400: Find maven providers for: MavenCoordinates[org.json:json:jar:1.0.0]

      12:30:23,572 ERROR [org.jboss.osgi.repository] (MSC service thread 1-1) JBOSGI020402: Cannot create resource for: MavenCoordinates[org.json:json:jar:1.0.0]: java.lang.IllegalStateException: Cannot create capability from: file:/home/echinopsii/.m2/repository/org/json/json/1.0.0/json-1.0.0.jar

                at org.jboss.osgi.repository.URLResourceBuilderFactory.create(URLResourceBuilderFactory.java:82) [jbosgi-repository-api-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]

                at org.jboss.osgi.repository.core.MavenArtifactRepository.findProviders(MavenArtifactRepository.java:83) [jbosgi-repository-core-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]

                at org.jboss.osgi.repository.spi.AggregatingRepository.findProviders(AggregatingRepository.java:48) [jbosgi-repository-api-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]

                at org.jboss.osgi.repository.spi.AbstractPersistentRepository.findProviders(AbstractPersistentRepository.java:65) [jbosgi-repository-api-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]

                at org.jboss.as.osgi.service.BootstrapBundlesIntegration.getInitialBundleDeployment(BootstrapBundlesIntegration.java:251) [jboss-as-osgi-service-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                at org.jboss.as.osgi.service.BootstrapBundlesIntegration.start(BootstrapBundlesIntegration.java:156) [jboss-as-osgi-service-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

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

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

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

      Caused by: java.lang.IllegalArgumentException: JBOSGI010700: manifest is null

                at org.jboss.osgi.metadata.OSGiMetaDataBuilder.load(OSGiMetaDataBuilder.java:92) [jbosgi-metadata-2.2.0.Final-redhat-1.jar:2.2.0.Final-redhat-1]

                at org.jboss.osgi.repository.URLResourceBuilderFactory.create(URLResourceBuilderFactory.java:79) [jbosgi-repository-api-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]

                ... 10 more

       

       

      At the end, I see that message "manifest is null" so I checked my bundle again to check the MANIFEST.MF generated by bundlor.sh but I didn't see anything wrong. So this is the second error I don't understand and this is the most blocking currently.

       

       

      Any help would be much appreciate. Thank you !

        • 1. Re: Exception when adding org.json to JBoss AS7 (EAP-6.1)
          ffrench.mathilde

          In the previous message bundlor.sh means bundlor. I hope all is clear now Anyway tell me if you need any other input from my side...

          • 2. Re: Exception when adding org.json to JBoss AS7 (EAP-6.1)
            ffrench.mathilde

            I continue to investigate this issue and consequently I pushed the log level to debug. I attached the log files with and without  org.json:json:1.0.0 as a capability and also my standalone.conf files.

             

            I found an interesting output with the debug level : when I deploy my bundle json (which is working) I get the following log messages:

             

            10:28:35,538 DEBUG [org.jboss.osgi.framework] (MSC service thread 1-1) Starting bundle: org.json.json:1.0.0

            10:28:35,538 DEBUG [org.jboss.osgi.framework] (MSC service thread 1-1) Set mode ACTIVE on service: service jbosgi.bundle."org.json.json"."1.0.0".bid20.ACTIVE

            10:28:35,538 INFO  [org.jboss.osgi.framework] (MSC service thread 1-1) JBOSGI011002: Bundle started: org.json.json:1.0.0

            10:28:35,586 DEBUG [org.jboss.security] (MSC service thread 1-4) PBOX000307: Constructing JBossPolicyConfiguration with contextID json-1.0.0.jar

            10:28:35,587 DEBUG [org.jboss.as.security] (MSC service thread 1-4) Cannot create permissions with 'null' metaData for id=json-1.0.0.jar

            10:28:35,611 INFO  [org.jboss.as.server] (HttpManagementService-threads - 3) JBAS018559: Déploiement de "json" (runtime-name: "json-1.0.0.jar")

            10:28:35,611 FINE  [com.sun.net.httpserver] (HttpManagementService-threads - 3) POST /management HTTP/1.1 [200  OK] ()

            10:28:35,625 FINE  [com.sun.net.httpserver] (HttpManagementService-threads - 3) POST /management HTTP/1.1 [200  OK] ()

             

            I've the impression that this "null" metaData should be linked with my last exception error : Caused by: java.lang.IllegalArgumentException: JBOSGI010700: manifest is null.

             

            Anyway I guess there is something wrong here and so I checked again my generated manifest but I don't see any errors ... Is there anybody who can explain me the meaning of this message "Cannot create permissions with 'null' metaData" ?

             

            Thank you

            • 3. Re: Exception when adding org.json to JBoss AS7 (EAP-6.1)
              ffrench.mathilde

              I workarounded this problem by removing org.json dependency and using jackson instead. Anyway I feel I should raise a Jira ticket for this problem. Could anybody have a check and confirm (or not ! ) this is a JBoss issue ?

               

              Thank you