Jetty

ISE during startup of webapp with spring-context >= 2.5.1

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 7.0.0pre3
  • Fix Version/s: 7.0.0pre4
  • Component/s: Servlet
  • Labels:
    None
  • Number of attachments :
    0

Description

Stacktrace:

java.lang.IllegalStateException: public void org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean(javax.interceptor.InvocationContext) has parameters
        at org.mortbay.jetty.annotations.AnnotationProcessor.processPostConstructAnnotations(AnnotationProcessor.java:297)
        at org.mortbay.jetty.annotations.AnnotationProcessor.processLifeCycleCallbackAnnotations(AnnotationProcessor.java:285)
        at org.mortbay.jetty.annotations.AnnotationProcessor.process(AnnotationProcessor.java:105)
        at org.mortbay.jetty.annotations.Configuration.parseAnnotations(Configuration.java:138)
        at org.mortbay.jetty.plugin.Jetty6MavenConfiguration.parseAnnotations(Jetty6MavenConfiguration.java:121)
        at org.mortbay.jetty.plus.webapp.AbstractConfiguration.configure(AbstractConfiguration.java:121)
        at org.mortbay.jetty.webapp.WebXmlConfiguration.configureWebApp(WebXmlConfiguration.java:229)
        at org.mortbay.jetty.plus.webapp.AbstractConfiguration.configureWebApp(AbstractConfiguration.java:98)
        at org.mortbay.jetty.plus.webapp.Configuration.configureWebApp(Configuration.java:161)
        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1338)
        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:520)
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:474)
        at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:93)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
        at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:151)
        at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
        at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:151)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
        at org.mortbay.jetty.Server.doStart(Server.java:223)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
        at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:388)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:324)
        at org.mortbay.jetty.plugin.Jetty6RunWar.execute(Jetty6RunWar.java:67)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        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)

Quote from http://openejb.apache.org/3.0/callbacks.html:

For an Interceptor, the syntax includes InvocationContext as follows:
@PostConstruct <any-scope> void <method-name>(InvocationContext)
@PreDestroy <any-scope> void <method-name>(InvocationContext)
@PrePassivate <any-scope> void <method-name>(InvocationContext)
@PostActivate <any-scope> void <method-name>(InvocationContext)

As far as I understand, SpringBeanAutowiringInterceptor is a valid EJB3 interceptor.

Activity

Hide
Marat Radchenko added a comment -

woops, colon is not part of url.

Show
Marat Radchenko added a comment - woops, colon is not part of url.
Hide
Greg Wilkins added a comment -

Does that woops mean that this is not a problem and can be closed?

Show
Greg Wilkins added a comment - Does that woops mean that this is not a problem and can be closed?
Hide
Marat Radchenko added a comment -

Nope, woops means that actual url is http://openejb.apache.org/3.0/callbacks.html

Show
Marat Radchenko added a comment - Nope, woops means that actual url is http://openejb.apache.org/3.0/callbacks.html
Hide
Greg Wilkins added a comment -

I think all this code has changed.

Jan can you have a peek?

Marat, could you retest with the latest snapshot?

Show
Greg Wilkins added a comment - I think all this code has changed. Jan can you have a peek? Marat, could you retest with the latest snapshot?
Hide
Jan Bartel added a comment -

I think this is a genuine issue.

The servlet3.0 spec requires us to examine all classes in WEB-INF/classes and WEB-INF/lib as pojos can be annotated. As far as the servlet spec is concerned, methods annotated with @PostConstruct cannot have any parameters. However the ejb spec says that methods on interceptor classes which use that annotation are allowed to have a single parameter of type InvocationContext.

So the issue for us is that previously, we would never have scanned the ejb classes, so we'd never have tried to process the PostConstruct. Now we're finding them and I think we have to exclude the handling of classes that are not servlets (either pojos acting as servlets or classes implementing HttpServlet).

Jan

Show
Jan Bartel added a comment - I think this is a genuine issue. The servlet3.0 spec requires us to examine all classes in WEB-INF/classes and WEB-INF/lib as pojos can be annotated. As far as the servlet spec is concerned, methods annotated with @PostConstruct cannot have any parameters. However the ejb spec says that methods on interceptor classes which use that annotation are allowed to have a single parameter of type InvocationContext. So the issue for us is that previously, we would never have scanned the ejb classes, so we'd never have tried to process the PostConstruct. Now we're finding them and I think we have to exclude the handling of classes that are not servlets (either pojos acting as servlets or classes implementing HttpServlet). Jan
Hide
Jan Bartel added a comment -

Marat,

I've checked in a fix, so that I only process classes that are related to the servlet spec. Can you retest and confirm if it works?

See svn rev 3610.

Show
Jan Bartel added a comment - Marat, I've checked in a fix, so that I only process classes that are related to the servlet spec. Can you retest and confirm if it works? See svn rev 3610.
Hide
Marat Radchenko added a comment -

Checked against rev 3610, bug is fixed. Thanks!

Show
Marat Radchenko added a comment - Checked against rev 3610, bug is fixed. Thanks!

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: