6 Replies Latest reply on May 6, 2013 7:27 PM by css181

    OSGI Parsing error on both EAP 6.1.0 Beta and JBoss AS 7.1.1.Final

    css181

      I am attempting to use a number of JBoss products in my project, but there is something wrong with the integration between them.  In attempting to parse an Arquillian test file with Forge's Java Parser on both AS7 and EAP I am getting an OSGI error stating:

      java.lang.SecurityException: class "org.osgi.framework.BundleActivator"'s signer information does not match signer information of other classes in the same package

       

      For ease of recreating and resolving this error, below is a link to a git repo with a project containing a test case that will recreate the error on both AS 7 and EAP 6.1.0 servers.

       

      https://github.com/CavemanCraig/EAPissueProject

       

       

      Also a full stacktrace can be found in the ReadMe of the git repo. 

       

      Note: The file I'm trying to Parse is also within the git repo as specified in the ReadMe.

        • 1. Re: OSGI Parsing error on both EAP 6.1.0 Beta and JBoss AS 7.1.1.Final
          jaikiran

          It looks like the classpath has more than one jar which has those org.osgi.framework.* classes. I've no clue about Forge so can't say what needs to be done here. Perhaps try and find which jars have these classes?

          • 2. Re: OSGI Parsing error on both EAP 6.1.0 Beta and JBoss AS 7.1.1.Final
            lincolnthree

            To clarify. Craig isn't using Forge, he's using just the JavaParser dependency which is basically a thin pure-Java wrapper around the Eclipse JDT: https://github.com/forge/java-parser, so this has nothing to do with the fact that it's Forge, it just happens to be something from the Forge depchain.

             

            Craig is also not using or requiring any OSGi features from the application server, so this exception/problem is purely a roadblock, not something that he needs to be working with since his application does not require an OSGi environment, does not require that any of its JARs be deployed as OSGi modules, and does not depend on any OSGi modules from AS.

             

            Hopefully this helps clarify the issue.

            • 3. Re: OSGI Parsing error on both EAP 6.1.0 Beta and JBoss AS 7.1.1.Final
              ctomc

              Hi,

               

              in that case solution is somewhat simple.

              just disable OSGI subsystem(remove it from standalone.xml) and you are good to go.

               

              I asume that you did upgrade from previous version of App Server as with 7.2/EAP6.1 osgi is not enabled by default anymore.

              To enable it you need to run standalone-osgi.xml

               

              but upgrade from previous version would upgrade configuration to latest, and would still contain OSGI.

               

              other way of doing it is by using standalone.xml that came with app server, not old one...

               

               

              --

              tomaz

              • 4. Re: OSGI Parsing error on both EAP 6.1.0 Beta and JBoss AS 7.1.1.Final
                lincolnthree

                Excellent. For the purposes of clarify, could you show Craig which section of configuration needs to be removed or changed in standalone.xml to disable OSGi? Thanks.

                • 5. Re: OSGI Parsing error on both EAP 6.1.0 Beta and JBoss AS 7.1.1.Final
                  css181

                  I tried going into the standalone.xml file and removed all references to anything related to osgi.  However, the issue still exists.  Is there something else I need to do for AS7.1.1.Final to actually disable osgi?

                   

                  Also, I tried this with EAP 6.1.0 Beta which you had suggested would have osgi disabled by default, but the error was there also.

                   

                   

                  Thanks.

                  • 6. Re: OSGI Parsing error on both EAP 6.1.0 Beta and JBoss AS 7.1.1.Final
                    css181

                    In digging around a little more, this is actually not an AS7/EAP issue.  The issue here stemmed from the JBoss Forge Java Parser adding the osgi-3.4.3.R34x jar which had a BundleActivator class, and Arquillian adding the org.osgi.core-4.2.0 jar which also had a different version of a BundleActivator class.  Since I was running the Arquillian test as testable=false (aka client), the Parser would work on the Server (where Arquillian wasn't scoped), but not in Test.

                     

                    Aslak Knutsen from the Arquillian team let me know that Arqillian doesn't actually need osgi and provided me with a solution in simply excluding it from the remote container profile in my pom like so:

                     

                     



                    <profile>



                    <id>JBOSS_AS_REMOTE_7.X</id>



                    <dependencies>




                    <dependency>





                    <groupId>org.jboss.as</groupId>





                    <artifactId>jboss-as-arquillian-container-remote</artifactId>





                    <version>7.1.1.Final</version>





                      <exclusions>






                    <exclusion>







                    <groupId>org.jboss.arquillian.testenricher</groupId>







                    <artifactId>arquillian-testenricher-osgi</artifactId>






                    </exclusion>





                      </exclusions>





                    <scope>test</scope>




                    </dependency>



                    </dependencies>


                    </profile>

                     

                     

                    This did the trick and now allows me to use the Forge Java Parser even within an Arquillian test.  A big thank you to Aslak and the JBoss team for their help!!!