Issue Details (XML | Word | Printable)

Key: JETTY-689
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jan Bartel
Reporter: Marat Radchenko
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Jetty

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

Created: 19/Aug/08 08:30 AM   Updated: 05/Sep/08 01:07 AM   Resolved: 05/Sep/08 12:36 AM
Return to search
Component/s: Servlet
Affects Version/s: 7.0.0pre3
Fix Version/s: 7.0.0pre4

Time Tracking:
Not Specified


 Description  « Hide

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.



Marat Radchenko added a comment - 19/Aug/08 08:43 AM

woops, colon is not part of url.


Greg Wilkins added a comment - 01/Sep/08 01:15 AM

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


Marat Radchenko added a comment - 01/Sep/08 03:29 AM

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


Greg Wilkins added a comment - 04/Sep/08 10:31 PM

I think all this code has changed.

Jan can you have a peek?

Marat, could you retest with the latest snapshot?


Jan Bartel added a comment - 04/Sep/08 11:08 PM

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


Jan Bartel added a comment - 05/Sep/08 12:36 AM

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.


Marat Radchenko added a comment - 05/Sep/08 01:07 AM

Checked against rev 3610, bug is fixed. Thanks!