I'm getting a LinkageError I don't know how to diagnose or fix when
building console-tomcat. I've committed all my code changes and
pushed pluto snapshots so it should be possible to reproduce.
Here's the stack trace:
[FelixDispatchQueue] DEBUG org.apache.geronimo.plugins.console-
tomcat_base-portlets.war-DEPLOYMENT - BundleEvent STARTED
[main] ERROR org.apache.geronimo.deployment.Deployer - Deployment
failed due to
java.lang.LinkageError: loader constraint violation: when resolving
overridden method "jsp.about_jsp._jspService(Ljavax/servlet/http/
HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V" the
class loader (instance of org/apache/felix/framework/ModuleImpl
$ModuleClassLoader) of the current class, jsp/about_jsp, and its
superclass loader (instance of org/apache/felix/framework/ModuleImpl
$ModuleClassLoader), have different Class objects for the type javax/
servlet/http/HttpServletRequest used in the signature
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at
org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:165)
at
org
.apache
.geronimo
.web25
.deployment
.AbstractWebModuleBuilder
.createWebAppClassFinder(AbstractWebModuleBuilder.java:694)
at
org
.apache
.geronimo
.web25
.deployment
.AbstractWebModuleBuilder
.createWebAppClassFinder(AbstractWebModuleBuilder.java:637)
at
org
.apache
.geronimo
.web25
.deployment
.AbstractWebModuleBuilder
.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:714)
at
org
.apache
.geronimo
.tomcat
.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:353)
at
org
.apache
.geronimo
.j2ee
.deployment
.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:166)
at
org
.apache
.geronimo
.j2ee
.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:
707)
at
org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:248)
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
.geronimo
.gbean
.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at
org
.apache
.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
at
org
.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:
856)
at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:
245)
at
org
.apache
.geronimo.mavenplugins.car.PackageMojo.invokeDeployer(PackageMojo.java:
519)
at
org
.apache
.geronimo.mavenplugins.car.PackageMojo.buildPackage(PackageMojo.java:
337)
at
org
.apache.geronimo.mavenplugins.car.PackageMojo.execute(PackageMojo.java:
234)
at
org
.apache
.maven
.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
694)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor
.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor
.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor
.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:
328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
I've poked around in the IDEA debugger and...
clazz is the jsp.about_jsp class
clazz.getClassLoader().loadClass(clazz.getName(),
true).getDeclaredMethods() also throws the linkage error
clazz
.getClassLoader
().loadClass("javax.servlet.http.HttpServletRequest").getClassLoader()
gives the classloader for bundle 137, the console-tomcat temporary
bundle. This bundle has a wire for javax.servlet.http to bundle 60,
the servlet 3.0 spec jar, but the classloader seems to be loading
another copy of the class anyway.
clazz
.getSuperclass
().getClassLoader
().loadClass("javax.servlet.http.HttpServletRequest").getClassLoader()
gives the classloader for bundle 60 as expected.
Anyone have any ideas?
thanks
david jencks