0 Replies Latest reply on Mar 27, 2008 12:23 PM by gumnaam suri

    javaee-api-5.jar causes Problems

    gumnaam suri Newbie

      In my maven project I have a dependency on

       <dependency>
       <groupId>javaee</groupId>
       <artifactId>javaee-api</artifactId>
       <version>5</version>
       <scope>provided</scope>
       </dependency>
      

      But this causes problems for the Embedded JBoss to Bootstrap as part of a Unit test.
      Here's the message
      Failed to bootstrap
      java.lang.RuntimeException: Failed to bootstrap
       at org.jboss.embedded.junit.BaseTestCase.bootstrap(BaseTestCase.java:103)
       at org.jboss.embedded.junit.BaseTestCase.access$000(BaseTestCase.java:47)
       at org.jboss.embedded.junit.BaseTestCase$1.setUp(BaseTestCase.java:126)
       at junit.extensions.TestSetup$1.protect(TestSetup.java:18)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.extensions.TestSetup.run(TestSetup.java:23)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
       at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
       at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
       at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
       at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
      Caused by: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
      EJB2xDeployer
       -> JNDIBasedSecurityManagement{Configured:**ERROR**}
      UserTransactionBinding
       -> UserTransaction{Configured:**ERROR**}
      UserTransactionBinding2
       -> UserTransaction{Configured:**ERROR**}
      jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory
       -> jboss.messaging:service=PostOffice{Start:Configured}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
       -> jboss.messaging:service=Connector,transport=bisocket{Create:** NOT FOUND **}
       -> jboss.messaging:service=PostOffice{Create:Configured}
       -> jboss.messaging:service=Connector,transport=bisocket{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
      jboss.messaging.connectionfactory:service=ClusteredConnectionFactory
       -> jboss.messaging:service=Connector,transport=bisocket{Start:** NOT FOUND **}
       -> jboss.messaging:service=PostOffice{Start:Configured}
       -> jboss.messaging:service=Connector,transport=bisocket{Create:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
       -> jboss.messaging:service=PostOffice{Create:Configured}
      jboss.messaging.connectionfactory:service=ConnectionFactory
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
       -> jboss.messaging:service=Connector,transport=bisocket{Start:** NOT FOUND **}
       -> jboss.messaging:service=Connector,transport=bisocket{Create:** NOT FOUND **}
       -> jboss.messaging:service=PostOffice{Create:Configured}
       -> jboss.messaging:service=PostOffice{Start:Configured}
      jboss.messaging:service=JMSUserManager
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Start:** NOT FOUND **}
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:** NOT FOUND **}
       -> jboss:service=TransactionManager{Start:** NOT FOUND **}
       -> jboss:service=TransactionManager{Create:** NOT FOUND **}
      jboss.messaging:service=PersistenceManager
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:** NOT FOUND **}
       -> jboss:service=TransactionManager{Start:** NOT FOUND **}
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Start:** NOT FOUND **}
       -> jboss:service=TransactionManager{Create:** NOT FOUND **}
      jboss.messaging:service=PostOffice
       -> jboss:service=TransactionManager{Create:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Start:** NOT FOUND **}
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:** NOT FOUND **}
       -> jboss:service=TransactionManager{Start:** NOT FOUND **}
      jboss.mq:service=DestinationManager
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
      *** CONTEXTS IN ERROR: Name -> Error
      jboss.messaging:service=ServerPeer -> ** NOT FOUND **
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/jboss-xa-jdbc.rar -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/messaging/jms-ds.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/resource/ResourceException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/hsqldb-ds.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/resource/ResourceException
      jboss:service=TransactionManager -> ** NOT FOUND **
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/messaging/remoting-service.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/jms/JMSException
      jboss.jca:name=DefaultDS,service=DataSourceBinding -> ** NOT FOUND **
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/jboss-local-jdbc.rar/ -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      jboss.messaging:service=Connector,transport=bisocket -> ** NOT FOUND **
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/messaging/destinations-service.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/jms/IllegalStateException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/messaging/messaging-service.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/jms/JMSSecurityException
      SecurityDomainObjectFactory -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      JNDIBasedSecurityManagement -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      UserTransaction -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/transaction/SystemException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/jms-ra.rar -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/conf/jboss-service.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContext
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
       at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:149)
       at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
       at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
       at org.jboss.embedded.junit.BaseTestCase.bootstrap(BaseTestCase.java:99)
       ... 19 more
      Caused by: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
      EJB2xDeployer
       -> JNDIBasedSecurityManagement{Configured:**ERROR**}
      UserTransactionBinding
       -> UserTransaction{Configured:**ERROR**}
      UserTransactionBinding2
       -> UserTransaction{Configured:**ERROR**}
      jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory
       -> jboss.messaging:service=PostOffice{Start:Configured}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
       -> jboss.messaging:service=Connector,transport=bisocket{Create:** NOT FOUND **}
       -> jboss.messaging:service=PostOffice{Create:Configured}
       -> jboss.messaging:service=Connector,transport=bisocket{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
      jboss.messaging.connectionfactory:service=ClusteredConnectionFactory
       -> jboss.messaging:service=Connector,transport=bisocket{Start:** NOT FOUND **}
       -> jboss.messaging:service=PostOffice{Start:Configured}
       -> jboss.messaging:service=Connector,transport=bisocket{Create:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
       -> jboss.messaging:service=PostOffice{Create:Configured}
      jboss.messaging.connectionfactory:service=ConnectionFactory
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
       -> jboss.messaging:service=Connector,transport=bisocket{Start:** NOT FOUND **}
       -> jboss.messaging:service=Connector,transport=bisocket{Create:** NOT FOUND **}
       -> jboss.messaging:service=PostOffice{Create:Configured}
       -> jboss.messaging:service=PostOffice{Start:Configured}
      jboss.messaging:service=JMSUserManager
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Start:** NOT FOUND **}
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:** NOT FOUND **}
       -> jboss:service=TransactionManager{Start:** NOT FOUND **}
       -> jboss:service=TransactionManager{Create:** NOT FOUND **}
      jboss.messaging:service=PersistenceManager
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:** NOT FOUND **}
       -> jboss:service=TransactionManager{Start:** NOT FOUND **}
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Start:** NOT FOUND **}
       -> jboss:service=TransactionManager{Create:** NOT FOUND **}
      jboss.messaging:service=PostOffice
       -> jboss:service=TransactionManager{Create:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Start:** NOT FOUND **}
       -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:** NOT FOUND **}
       -> jboss:service=TransactionManager{Start:** NOT FOUND **}
      jboss.mq:service=DestinationManager
       -> jboss.messaging:service=ServerPeer{Start:** NOT FOUND **}
       -> jboss.messaging:service=ServerPeer{Create:** NOT FOUND **}
      *** CONTEXTS IN ERROR: Name -> Error
      jboss.messaging:service=ServerPeer -> ** NOT FOUND **
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/jboss-xa-jdbc.rar -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/messaging/jms-ds.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/resource/ResourceException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/hsqldb-ds.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/resource/ResourceException
      jboss:service=TransactionManager -> ** NOT FOUND **
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/messaging/remoting-service.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/jms/JMSException
      jboss.jca:name=DefaultDS,service=DataSourceBinding -> ** NOT FOUND **
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/jboss-local-jdbc.rar/ -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      jboss.messaging:service=Connector,transport=bisocket -> ** NOT FOUND **
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/messaging/destinations-service.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/jms/IllegalStateException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/messaging/messaging-service.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/jms/JMSSecurityException
      SecurityDomainObjectFactory -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      JNDIBasedSecurityManagement -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      UserTransaction -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/transaction/SystemException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/deploy/jms-ra.rar -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContextException
      vfsfile:/C:/VerizonBusiness/Code/ejbTest/target/test-classes/conf/jboss-service.xml -> java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/security/jacc/PolicyContext
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
       at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:149)
       at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
       at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
       at org.jboss.embedded.junit.BaseTestCase.bootstrap(BaseTestCase.java:99)
       ... 19 more
      
      


      If i remove this dependency , then every thing works fine, on account of javax.* being present in one of the Embedded JBoss supplied files.
      But for that I need to set the scope of Embedded Jboss jars to either
      compile/provided/system.
      But I really want to restrict the Embedded JBoss file dependencies to TEST scope, so I need the javaee-api dependency for compilation.

      Any suggestions ?