3 Replies Latest reply on Nov 23, 2014 10:09 AM by david-brighton

    JBoss AS 7.1.1 and Derby integration

    david-brighton

      Hi

      I am running Jboss AS 7.1.1 with an Apache Derby based application, the Derby version is 10.11.1.1. The application is built with Java 6 but when I start Jboss I get the following error

       

      Failed to define class org.apache.derby.iapi.services.io.FilePermissionServiceImpl in Module "deployment.dexEtl.war:main" from Service Module Loader: java.lang.UnsupportedClassVersionError: org/apache/derby/iapi/services/io/FilePermissionServiceImpl : Unsupported major.minor version 51.0

       

      The unsupported major version suggests that the Derby class has been compiled using Java 7 however JBoss is starting with Java 6 as expected.

       

      JAVA: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java


      The application runs fine in Tomcat so I was wondering if there is a Jboss module I should exclude from the classloader using the jboss-deployment-structure.xml file

       

      Thanks

        • 1. Re: JBoss AS 7.1.1 and Derby integration
          jaysensharma

          Hello,

           

             You will need to run JBoss also using JDK 1.7.   So before running JBoss set the JAVA_HOME inside the "standalone.conf" file  or export the JAVA_HOME variable in the command prompt/terminal before starting JBoss.

           

             This is because the class org/apache/derby/iapi/services/io/FilePermissionServiceImpl is compiled for the target version 1.7 (as mentioned by the major.minor version 51.0 Error)

           

             This issue has nothing to to with tomcat or jboss-deployment-structure.xml.    If you want to double check the same then check your tomcat logs "It must be running on JVM 1.7"

          • 2. Re: JBoss AS 7.1.1 and Derby integration
            david-brighton

            Hi

             

            I am running Snow Leopard on an IMac which includes ONLY Java 6, unfortunately Mac's are not as easy as Windows to upgrade the version of Java so I am stuck with Java6 unless I upgrade the whole OS. 

            • 3. Re: JBoss AS 7.1.1 and Derby integration
              david-brighton

              Hi Jay

              I finally found the answer, in my war file I was including derby.jar, derbyclient.jar, derbynet.jar and derbyrun.jar however, using a JDBC connection to my derby database I only needed to include derbyclient.jar so after removing the others the problem went away.

               

              Looking further at this, when I used the command file FilePermissionServiceImpl.class it gave me

              FilePermissionServiceImpl.class: compiled Java class data, version 51.0

              indicating that this class was indeed compiled with Java7