Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 371050 - NoSuchMethodException org.eclipse.virgo.medic.log.logback.DelegatingContextSelector.<init> in Virgo Jetty Server startup
Summary: NoSuchMethodException org.eclipse.virgo.medic.log.logback.DelegatingContextSe...
Status: CLOSED FIXED
Alias: None
Product: Virgo
Classification: RT
Component: runtime (show other bugs)
Version: 3.5.0.M02   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.5.0.M04   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 04:30 EST by Chris Frost CLA
Modified: 2012-06-14 12:10 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Frost CLA 2012-02-09 04:30:59 EST
DE0004I Starting bundle 'org.eclipse.jetty.osgi.boot' version '8.1.0.v20120127'. 
 Failed to instantiate [ch.qos.logback.classic.LoggerContext] 
 Reported exception: 
 java.lang.NoSuchMethodException: org.eclipse.virgo.medic.log.logback.DelegatingContextSelector.<init>(ch.qos.logback.classic.LoggerContext) 
  at java.lang.Class.getConstructor0(Class.java:2706) 
  at java.lang.Class.getConstructor(Class.java:1657) 
  at ch.qos.logback.classic.util.ContextSelectorStaticBinder.dynamicalContextSelector(ContextSelectorStaticBinder.java:98) 
  at ch.qos.logback.classic.util.ContextSelectorStaticBinder.init(ContextSelectorStaticBinder.java:72) 
  at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:90) 
  at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55) 
  at java.lang.Class.forName0(Native Method) 
  at java.lang.Class.forName(Class.java:169) 
  at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:36) 
  at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:27) 
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
  at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 
  at java.lang.Class.newInstance0(Class.java:355) 
  at java.lang.Class.newInstance(Class.java:308) 
  at org.eclipse.jetty.util.log.Log.initialized(Log.java:156) 
  at org.eclipse.jetty.util.log.Log.getLogger(Log.java:430) 
  at org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleDeployerHelper.<clinit>(WebBundleDeployerHelper.java:74) 
  at org.eclipse.jetty.osgi.boot.jsp.FragmentActivator.start(FragmentActivator.java:40) 
  at org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker.invokeFragmentActivators(PackageAdminServiceTracker.java:265) 
  at org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker.setup(PackageAdminServiceTracker.java:71) 
  at org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker.<init>(PackageAdminServiceTracker.java:50) 
  at org.eclipse.jetty.osgi.boot.JettyBootstrapActivator.start(JettyBootstrapActivator.java:94) 
  at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711) 
  at java.security.AccessController.doPrivileged(Native Method) 
  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702) 
  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) 
  at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) 
  at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299) 
  at org.eclipse.virgo.kernel.core.internal.StandardBundleStarter.start(StandardBundleStarter.java:57) 
  at org.eclipse.virgo.kernel.core.internal.StandardBundleStarter.start(StandardBundleStarter.java:45) 
  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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) 
  at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58) 
  at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) 
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 
  at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) 
  at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) 
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 
  at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
Comment 1 Glyn Normington CLA 2012-02-09 04:40:15 EST
This seems to be related to the implementation of 362095 which moved logback out of medic core. As a consequence, logback can no longer load medic's DelegatingContextSelector class locally from its bundle class loader. So a new fragment was introduced to import DCS's package into logback classic. It seems this fragment is not being installed in the Jetty build (and most likely not in any of the other packaging builds).

There are actually two fragments, one each for logback class and logback core, introduced in medic commit 7082838769497acfa825530b6d4b3d1b8f9e7fbf. These need to be installed in the kernel region so they will attach. (Also, note that the medic activator sets a system property in medic commit a80a6b1a5a5ee0c1496d1dc8be76801ceb780f61 to ensure that DCS is loaded from the correct place. That should not need any change in the packaging repos, but it's worth knowing about from a debugging perspective.)
Comment 2 Glyn Normington CLA 2012-02-09 04:44:11 EST
Comment 1 should have read "... There are actually two fragments, one each for logback classic and logback core, ...".
Comment 3 Chris Frost CLA 2012-03-30 11:00:07 EDT
This should be a change to the p2 packaging information in Nano. Simply need to add reference to the fragments in the right feature definition
Comment 4 Glyn Normington CLA 2012-06-14 10:16:20 EDT
The exception does not show in the log when starting VJS 3.5.0.M04.

(In reply to comment #3)
> This should be a change to the p2 packaging information in Nano. Simply need to
> add reference to the fragments in the right feature definition

These fragments appear to be part of the medic feature.xml in nano. The fragments correctly attach in VJS 3.5.0.M04.

However, this change was made on 2012-01-12 which is well before this bug was raised. I tried reproducing the problem on VJS 3.5.0.M02 (the version it was reported against) and the fragments were correctly attached there too and there was no sign of the exception.

Is there some missing information about how to recreate this?
Comment 5 Glyn Normington CLA 2012-06-14 12:10:07 EDT
We managed to recreate with with VJS 3.5.0.M03, but that was missing a jetty boot logback fragment attached to the jetty boot bunde, which is necessary for correct use of logback by jetty. This is fixed in 3.5.0.M04 and beyond, so closing as fixed.