6 Replies Latest reply on Jan 26, 2009 3:36 AM by Juergen Zimmermann

    UndeclaredThrowableException caused by strange ClassNotFound

    Juergen Zimmermann Master

      I'm trying to use beta 3. However, I get the following stacktrace. Any hint is appreciated.

      DEBUG [org.jboss.kernel.KernelFactory] Starting JBoss Kernel construction...
      DEBUG [org.jboss.kernel.KernelFactory] Completed JBoss Kernel construction. Duration: 220 milliseconds
      DEBUG [jboss.xb.binding.parser.sax.SaxJBossXBParser] Created parser: org.apache.xerces.jaxp.SAXParserImpl@14dd758, isNamespaceAware: true, isValidating: true, isXIncludeAware: true
      DEBUG [jboss.xb.binding.parser.sax.SaxJBossXBParser] http://xml.org/sax/features/validation set to: true
      DEBUG [jboss.xb.binding.parser.sax.SaxJBossXBParser] http://xml.org/sax/features/namespaces set to: true
      DEBUG [jboss.xb.binding.parser.sax.SaxJBossXBParser] http://apache.org/xml/features/validation/dynamic set to: true
      DEBUG [jboss.xb.binding.parser.sax.SaxJBossXBParser] Created parser: org.apache.xerces.jaxp.SAXParserImpl@14dd758, isNamespaceAware: true, isValidating: true, isXIncludeAware: true
      DEBUG [jboss.kernel.plugins.deployment.xml.BeanXMLDeployer] Parsing file:/C:/Users/Public/Documents/eclipse-workspace/testHska/classes/conf/bootstrap-beans.xml took 346 milliseconds
      DEBUG [org.jboss.embedded.adapters.JMXKernel] Created MBeanServer: org.jboss.mx.server.MBeanServerImpl@bbfa5c[ defaultDomain='jboss' ]
      WARN [org.jboss.mx.loading.UnifiedLoaderRepository3] Tried to add non-URLClassLoader. Ignored
      DEBUG [org.jboss.system.ServiceController] Controller MBean online
      DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Added stage Not Installed before null
      DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Added stage Parse before ControllerState@116318b{PreInstall}
      DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Added stage Describe before ControllerState@116318b{PreInstall}
      DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Added stage ClassLoader before ControllerState@116318b{PreInstall}
      DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Added stage PostClassLoader before ControllerState@116318b{PreInstall}
      DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Added stage Real before ControllerState@116318b{PreInstall}
      DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Added stage Installed before ControllerState@116318b{PreInstall}
      DEBUG [jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl] Added structure deployer org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure@b48b11
      DEBUG [jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl] Added structure deployer org.jboss.deployers.vfs.plugins.structure.jar.JARStructure@1342545
      DEBUG [jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl] Added structure deployer org.jboss.deployers.vfs.plugins.structure.file.FileStructure@db3331 (proxied by org.jboss.deployers.vfs.plugins.structure.file.AOPContainerProxy$0@fe0fd9)
      ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Described: name=BeanDeployer state=PreInstall
      java.lang.RuntimeException: java.lang.reflect.UndeclaredThrowableException
       at org.jboss.aop.util.ClassInfoMethodHashing.methodHash(ClassInfoMethodHashing.java:70)
       at org.jboss.aop.util.ClassInfoMethodHashing.addDeclaredMethods(ClassInfoMethodHashing.java:169)
       at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:182)
       at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
       at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
       at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
       at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
       at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
       at org.jboss.aop.util.ClassInfoMethodHashing.getMethodMap(ClassInfoMethodHashing.java:188)
       at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getMethodAnnotationDependencies(AOPDependencyBuilder.java:197)
       at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getAnnotationDependencies(AOPDependencyBuilder.java:152)
       at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getDependencies(AOPDependencyBuilder.java:130)
       at org.jboss.classadapter.plugins.BasicClassAdapter.getDependencies(BasicClassAdapter.java:80)
       at org.jboss.beans.info.plugins.AbstractBeanInfo.getDependencies(AbstractBeanInfo.java:211)
       at org.jboss.kernel.plugins.dependency.DescribeAction.installActionInternal(DescribeAction.java:53)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
       at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
       at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
       at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
       at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
       at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
       at de.hska.test.util.DeployUtil.main(DeployUtil.java:126)
      Caused by: java.lang.reflect.UndeclaredThrowableException
       at org.jboss.reflect.plugins.ArrayInfoImpl.getType(ArrayInfoImpl.java:103)
       at org.jboss.reflect.plugins.ClassInfoImpl.isArray(ClassInfoImpl.java:495)
       at org.jboss.aop.util.ClassInfoMethodHashing.getTypeString(ClassInfoMethodHashing.java:149)
       at org.jboss.aop.util.ClassInfoMethodHashing.methodHash(ClassInfoMethodHashing.java:53)
       ... 35 more
      Caused by: java.lang.ClassNotFoundException: [Ljava.lang.Class;
       at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
       at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.resolveComplexTypeInfo(IntrospectionTypeInfoFactoryImpl.java:367)
       at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getTypeInfo(IntrospectionTypeInfoFactoryImpl.java:344)
       at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory.getTypeInfo(IntrospectionTypeInfoFactory.java:54)
       at org.jboss.reflect.plugins.ArrayInfoImpl.getType(ArrayInfoImpl.java:99)
       ... 38 more


        • 1. Re: UndeclaredThrowableException caused by strange ClassNotF
          J-C jc Apprentice

          Start container with the system prop -Dsun.lang.ClassLoader.allowArraySyntax=true

          From what I remember this is an issue with jdk 1.6

          • 2. Re: UndeclaredThrowableException caused by strange ClassNotF
            Juergen Zimmermann Master

            This option doesn't help: the exception is still there. As I recall the option above was for JBossAS.

            • 3. Re: UndeclaredThrowableException caused by strange ClassNotF
              jaikiran pai Master

              Which JDK version do you use? And how did you pass that JVM argument?

              • 4. Re: UndeclaredThrowableException caused by strange ClassNotF
                Juergen Zimmermann Master

                 

                Which JDK version do you use?

                1.6.0_11

                And how did you pass that JVM argument?

                mvn -Dsun.lang.ClassLoader.allowArraySyntax=true test

                • 5. Re: UndeclaredThrowableException caused by strange ClassNotF
                  J-C jc Apprentice

                  If you use maven you should try to configure surefire plugin

                  <plugin>
                   <artifactId>maven-surefire-plugin</artifactId>
                   <configuration>
                   <argLine>
                   -Dsun.lang.ClassLoader.allowArraySyntax=true
                   </argLine>
                   </configuration>
                   </plugin>




                  • 6. Re: UndeclaredThrowableException caused by strange ClassNotF
                    Juergen Zimmermann Master

                    Looking at org.jboss.ejb3.embedded.resolvers.EmbeddedDataSourceDependencyResolver.resolveDataSourceSupplier() in line 34 shows this code:

                    public String resolveDataSourceSupplier(String jndiName)
                    {
                     throw new RuntimeException("NYI");
                    }


                    The source code can be found at e.g. http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/embedded/src/main/java/org/jboss/ejb3/embedded/resolvers/EmbeddedDataSourceDependencyResolver.java

                    Here is the stacktrace from the log file:
                    2009-01-26 09:28:04,752 ERROR org.jboss.kernel.plugins.dependency.AbstractKernelController - Error installing to Real: name=vfsfile:/C:/Users/ziju0001/Documents/HS-Karlsruhe/softwareentwicklung-2/todo/embedded-jboss/embedded-jboss-maven/hska/target/classes/ state=PreReal mode=Manual requiredState=Real
                    org.jboss.deployers.spi.DeploymentException: Error during deploy: persistence.unit:unitName=#hskaPersistence
                     at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
                     at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                     at org.jboss.deployers.plugins.main.MainDeployerImpl.deploy(MainDeployerImpl.java:414)
                     at org.jboss.ejb3.embedded.JBossEJBContainer.deployMain(JBossEJBContainer.java:144)
                     at org.jboss.ejb3.embedded.JBossEJBContainer.deployModules(JBossEJBContainer.java:156)
                     at org.jboss.ejb3.embedded.JBossEJBContainer.<init>(JBossEJBContainer.java:92)
                     at org.jboss.ejb3.embedded.JBossEJBContainerProvider.createEJBContainer(JBossEJBContainerProvider.java:56)
                     at javax.ejb.EJBContainer.createEJBContainer(EJBContainer.java:99)
                     at de.hska.test.KundenverwaltungTest.test1(KundenverwaltungTest.java:48)
                     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.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
                     at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
                     at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
                     at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
                     at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
                     at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
                     at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
                     at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
                     at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
                     at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
                     at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
                     at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
                     at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
                     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: java.lang.RuntimeException: NYI
                     at org.jboss.ejb3.embedded.resolvers.EmbeddedDataSourceDependencyResolver.resolveDataSourceSupplier(EmbeddedDataSourceDependencyResolver.java:34)
                     at org.jboss.jpa.deployers.PersistenceUnitDeployer.addDependencies(PersistenceUnitDeployer.java:79)
                     at org.jboss.jpa.deployers.PersistenceUnitDeployer.deploy(PersistenceUnitDeployer.java:116)
                     at org.jboss.jpa.deployers.PersistenceUnitDeployer.deploy(PersistenceUnitDeployer.java:51)
                     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                     at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                     ... 45 more