views:

639

answers:

2

Hi,

While deploying a mavenized application consisting of a parent project, ejb jar project and a web project I have following stack trace in Jboss As ,5.1.0.GA.

I checked that I have the dependency for jboss-el-1.0_02.CR4.jar and the library also contains the class org/jboss/el/util/ReflectionUtil.

Any ideas ? If required, I will also post the pom files of all the projects. They are based on the seam-refimpl project mentioned in the seam FAQ section.

Here the link http://code.google.com/p/seam-maven-refimpl

regards, ramgalo

org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.el.referenceCache
        at org.jboss.seam.Component.newInstance(Component.java:2144)
        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
        at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:116)
        at org.jboss.seam.init.Initialization.init(Initialization.java:740)
        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
        at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
        at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
        at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
        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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
        at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
        at $Proxy38.start(Unknown Source)
        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
        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:348)
        at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        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.system.ServiceController.doChange(ServiceController.java:688)
        at org.jboss.system.ServiceController.start(ServiceController.java:460)
        at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
        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)
        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.doInstallParentFirst(DeployersImpl.java:1210)
        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:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        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.process(MainDeployerImpl.java:702)
        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: exception invoking: start
        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)
        at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
        at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
        at org.jboss.seam.Component.newInstance(Component.java:2132)
        ... 70 more
Caused by: java.lang.reflect.InvocationTargetException
        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.jboss.seam.util.Reflections.invoke(Reflections.java:22)
        at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
        at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
        at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
        at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
        at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
        at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
        at org.jboss.seam.el.JBossELReferenceCache_$$_javassist_seam_0.start(JBossELReferenceCache_$$_javassist_seam_0.java)
        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.jboss.seam.util.Reflections.invoke(Reflections.java:22)
        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
        ... 73 more
Caused by: java.lang.NoClassDefFoundError: org/jboss/el/util/ReflectionUtil
        at org.jboss.seam.el.JBossELReferenceCache.start(JBossELReferenceCache.java:18)
        ... 94 more
Caused by: java.lang.ClassNotFoundException: org.jboss.el.util.ReflectionUtil from BaseClassLoader@1a591e2{VFSClassLoaderPolicy@10cbb6f{name=vfszip:/home/hardik/apps/jboss-5.1.0.GA/server/default/deploy/SeamCalculator.ear/ domain=ClassLoaderDomain@88bec9{name=seam.jboss.org:loader=SeamCalculator parentPolicy=AFTER_BUT_JAVA_BEFORE parent=ClassLoaderDomain@628704{DefaultDomain}} roots=[MemoryContextHandler@15048449[path= context=vfsmemory://3j001-2eqc8x-g552fg9t-1-g556hj7b-2zg real=vfsmemory://3j001-2eqc8x-g552fg9t-1-g556hj7b-2zg], DelegatingHandler@19542132[path= context=file:/home/hardik/apps/jboss-5.1.0.GA/server/default/tmp/3j001-2eqc8x-g552fg9t-1-g556hj0b-2zf/SeamCalculator.ear real=vfszip:/home/hardik/apps/jboss-5.1.0.GA/server/default/tmp/3j001-2eqc8x-g552fg9t-1-g556hj0b-2zf/SeamCalculator.ear], DelegatingHandler@13839876[path=ejb-jar-1.0-SNAPSHOT.jar context=file:/home/hardik/apps/jboss-5.1.0.GA/server/default/tmp/3j001-2eqc8x-g552fg9t-1-g556hj0b-2zf/SeamCalculator.ear real=file:/home/hardik/apps/jboss-5.1.0.GA/server/default/tmp/3j001-2eqc8x-g552fg9t-1-g556hj0b-2zf/SeamCalculator.ear/ejb-jar-1.0-SNAPSHOT.jar], DelegatingHandler@7483658[path=jboss-seam-2.2.0.GA.jar context=file:/home/hardik/apps/jboss-5.1.0.GA/server/default/tmp/3j001-2eqc8x-g552fg9t-1-g556hj0b-2zf/SeamCalculator.ear real=file:/home/hardik/apps/jboss-5.1.0.GA/server/default/tmp/3j001-2eqc8x-g552fg9t-1-g556hj0b-2zf/SeamCalculator.ear/jboss-seam-2.2.0.GA.jar], DelegatingHandler@15830241[path= context=file:/home/hardik/apps/jboss-5.1.0.GA/server/default/deployers/seam.deployer/lib-int/jboss-seam-int-jbossas.jar real=vfszip:/home/hardik/apps/jboss-5.1.0.GA/server/default/deployers/seam.deployer/lib-int/jboss-seam-int-jbossas.jar]] delegates=null exported=[, org.jboss.seam.mock, jboss-el-1.0_02.CR4.jar.org.jboss.el.parser, org.jboss.seam.theme, org.jboss.seam.security.crypto, jboss-el-1.0_02.CR4.jar.org.jboss.el.lang, org.jboss.seam.security.management, org.jboss.seam.contexts, org.jboss.seam.el, org.jboss.seam.mail, org.jboss.seam.exception, org.jboss.seam.navigation, org.jboss.seam.international, xstream-1.1.3.jar.com.thoughtworks.xstream.core.util, xstream-1.1.3.jar.com.thoughtworks.xstream.annotations, org.jboss.seam.annotations.datamodel, xstream-1.1.3.jar.com.thoughtworks.xstream.io.xml.xppdom, org.jboss.seam.security.jaas, org.jboss.seam.init, org.jboss.seam.webservice, org.jboss.seam.annotations.bpm, org.jboss.seam.framework, xstream-1.1.3.jar.com.thoughtworks.xstream.mapper, xstream-1.1.3.jar.META-INF, xpp3_min-1.1.3.4.O.jar.META-INF.services, xstream-1.1.3.jar.com.thoughtworks.xstream.converters.collections, org.jboss.seam.log, org.jboss.seam.captcha, com.hardik.seamcalculator, org.jboss.seam.core, xstream-1.1.3.jar.com.thoughtworks.xstream.io.xml, META-INF.maven.org.jboss.seam.integration.jboss-seam-int-jbossas, org.jboss.seam.cache, xpp3_min-1.1.3.4.O.jar.org.xmlpull.v1, org.jboss.seam.jsf, jboss-el-1.0_02.CR4.jar.org.jboss.el.util, org.jboss.seam.intercept, org.jboss.seam.integration.jbossas.vfs, xstream-1.1.3.jar.com.thoughtworks.xstream.converters.enums, org.jboss.seam.annotations.intercept, org.jboss.seam.servlet, org.jboss.seam.drools, org.jboss.seam.annotations, org.jboss.seam.ejb, xstream-1.1.3.jar.com.thoughtworks.xstream.converters.basic, org.jboss.seam.persistence, xpp3_min-1.1.3.4.O.jar.org.xmlpull.mxp1, org.jboss.seam.pageflow, org.jboss.seam.annotations.async, org.jboss.seam.security.digest, xstream-1.1.3.jar.com.thoughtworks.xstream.core, org.jboss.seam.text, META-INF.maven.com.hardik.ejb-jar, xstream-1.1.3.jar.com.thoughtworks.xstream.converters.reflection, xstream-1.1.3.jar.com.thoughtworks.xstream.alias, org.jboss.seam.faces, org.jboss.seam.deployment, org.jboss.seam.annotations.web, org.jboss.seam, org.jboss.seam.annotations.faces, jboss-el-1.0_02.CR4.jar.org.jboss.el, org.jboss.seam.security.openid, org.jboss.seam.jmx, org.jboss.seam.jms, META-INF.maven.com.hardik.ear, xstream-1.1.3.jar.com.thoughtworks.xstream.converters, org.jboss.seam.security.permission, xpp3_min-1.1.3.4.O.jar, org.jboss.seam.annotations.exception, xstream-1.1.3.jar.com.thoughtworks.xstream.converters.extended, org.jboss.seam.async, xstream-1.1.3.jar.com.thoughtworks.xstream.io, org.jboss.seam.annotations.security.management, org.jboss.seam.integration.jbossas.jms, org.jboss.seam.util, org.jboss.seam.bpm, org.jboss.seam.security, org.jboss.seam.web, org.jboss.seam.security.management.action, org.jboss.seam.databinding, xstream-1.1.3.jar.com.thoughtworks.xstream, xstream-1.1.3.jar.com.thoughtworks.xstream.converters.javabean, xpp3_min-1.1.3.4.O.jar.META-INF, META-INF, org.jboss.seam.security.permission.action, xstream-1.1.3.jar.com.thoughtworks.xstream.io.path, org.jboss.seam.annotations.security.permission, jboss-el-1.0_02.CR4.jar.META-INF, org.jboss.seam.annotations.security, org.jboss.seam.transaction, org.jboss.seam.document] <IMPORT-ALL>NON_EMPTY}}
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
        ... 95 more
12:29:31,726 ERROR [StandardContext] Error listenerStart
+1  A: 

I have a hunch that JBoss 5.1 already includes a copy of the org.jboss.el stuff. If you also package a copy of those same classes in your application, then you may experience some classloader weirdness.

Try removing all copies of ReflectionUtil from your application, and see if that helps.

skaffman
Hi ReflectionUtil is not my class, it is in the jboss-el.jar. I also tried omitting the jboss-el library all together because it is already there in jboss As, but I still get the same error.
rangalo
+1  A: 

I figured out that my ear plugin was including the jboss-el.jar file on the root level with other modules. This doesn't work. Jboss requires it inside the lib directory in the ear package.

Following configuration option in ear plugin configuration fixed the problem. This way, all the dependencies, except which are mentioned in the modules will go to the lib directory in side the archive.

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.4</version>
        <configuration>
            <defaultLibBundleDir>lib</defaultLibBundleDir> 
            ...
        </configuration>
</plugin>
rangalo