You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Kirill (JIRA)" <ji...@apache.org> on 2010/01/19 17:16:54 UTC

[jira] Created: (WICKET-2690) Stateless components and classloading

Stateless components and classloading 
--------------------------------------

                 Key: WICKET-2690
                 URL: https://issues.apache.org/jira/browse/WICKET-2690
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.5
            Reporter: Kirill


Following a post on the user list, which so far got no reply, posting the issue here:

Wicket 1.4.5 with Tomcat 6.0.

Here's one thing that doesn't work. I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:

SEVERE: unable to find listener interface ILinkListener
org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
        at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
        at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)

Sometimes I also get the following (seemingly related) error:

org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
        at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
        at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
        at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
        ... 20 more
Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
        at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
        ... 21 more



A reliable way to reproduce it is:
1) open the home page in the browser
2) restart the web application in Tomcat
3) click the link
Every time I perform the above steps, I either get the first exception, or the second.

It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.

I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.

Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).

What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?

>From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2690) Stateless components and classloading

Posted by "Kirill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802372#action_12802372 ] 

Kirill commented on WICKET-2690:
--------------------------------

I'm able to work around the problem by putting the following in my Application.init():
        ILinkListener.INTERFACE.toString();
        IFormSubmitListener.INTERFACE.toString();


> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2690) Stateless components and classloading

Posted by "Kirill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802363#action_12802363 ] 

Kirill commented on WICKET-2690:
--------------------------------

I will be glad to answer all your questions, but I really couldn't find a reduced test case, and I can't provide the full source code (it's not mine).
The best I could do is reduce the *page* to the following:

TestPage.java:
public final class TestPage extends WebPage {
    static private Logger log = LoggerFactory.getLogger(TestPage.class);
    private static final long serialVersionUID = 1L;

    public TestPage() {
        add(new StatelessLink("test") {
            public void onClick() {
                log.debug("test");
            }
        });
    }
}

TestPage.html:
    <a wicket:id="test">test</a>

So when I launch the application, the browser is only showing TestPage, and then I click the link. Now the same code doesn't trigger the problem when I use it in a clean-room application. I took all the things that I do in my Application and transferred them into the new application, but that didn't help. I don't do anything weird there or elsewhere, anyway.


Now to answer your questions:
1) stateless - see above
2) versioned - see above
3) I'm using the filter
4) 
    <filter>
        <filter-name>WicketApplication</filter-name>
        <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
        <init-param>
            <param-name>applicationClassName</param-name>
            <param-value>com.my.Application</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>WicketApplication</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

5) No other filters.


> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2690) Stateless components and classloading

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802349#action_12802349 ] 

Igor Vaynberg commented on WICKET-2690:
---------------------------------------

there are many factors that can affect this. is the page the link on stateless? stateful? versioned? not versioned? are you using the filter? servlet? what kind of mapping? what others filters do you have infront? these are just a few questions that come to mind, this is why we ask for a simple quickstart that reproduces the problem...

> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2690) Stateless components and classloading

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802367#action_12802367 ] 

Igor Vaynberg commented on WICKET-2690:
---------------------------------------

well, you say you dont do anything weird, but in a quickstart you cant reproduce it - seems a paradox. you can understand how it is difficult for us to reproduce and deal with these kinds of problems when there is no testcase...

> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (WICKET-2690) Stateless components and classloading

Posted by "Kirill (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kirill closed WICKET-2690.
--------------------------

    Resolution: Invalid

> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2690) Stateless components and classloading

Posted by "Kirill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802443#action_12802443 ] 

Kirill commented on WICKET-2690:
--------------------------------

I investigated that. While I didn't discover anything interesting (the initializers run as expected), after the investigation the problem MAGICALLY DISAPPEARED. I then checked out the project in its previous state into /tmp, and I can't reproduce the problem using that project, either. So it turns out either NetBeans, or Tomcat is to blame (I have also reinstalled the latter, unfortunately deleting the previous install). Yet it is complete mystery to me, how could any of them achieve this kind of disutility.

 Will reopen the issue if something else turns up...

> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2690) Stateless components and classloading

Posted by "Kirill (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kirill updated WICKET-2690:
---------------------------

    Description: 
Following a post on the user list, which so far got no reply, posting the issue here:

Wicket 1.4.5 with Tomcat 6.0.

I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:

SEVERE: unable to find listener interface ILinkListener
org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
        at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
        at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)

Sometimes I also get the following (seemingly related) error:

org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
        at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
        at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
        at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
        ... 20 more
Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
        at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
        ... 21 more



A reliable way to reproduce it is:
1) open the home page in the browser
2) restart the web application in Tomcat
3) click the link
Every time I perform the above steps, I either get the first exception, or the second.

It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.

I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.

Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).

What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?

>From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

  was:
Following a post on the user list, which so far got no reply, posting the issue here:

Wicket 1.4.5 with Tomcat 6.0.

Here's one thing that doesn't work. I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:

SEVERE: unable to find listener interface ILinkListener
org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
        at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
        at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)

Sometimes I also get the following (seemingly related) error:

org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
        at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
        at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
        at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
        ... 20 more
Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
        at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
        ... 21 more



A reliable way to reproduce it is:
1) open the home page in the browser
2) restart the web application in Tomcat
3) click the link
Every time I perform the above steps, I either get the first exception, or the second.

It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.

I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.

Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).

What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?

>From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.


> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2690) Stateless components and classloading

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802322#action_12802322 ] 

Martin Grigorov commented on WICKET-2690:
-----------------------------------------

Maybe you forgot to attach the demo application ?

> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2690) Stateless components and classloading

Posted by "Kirill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802345#action_12802345 ] 

Kirill commented on WICKET-2690:
--------------------------------

Nice guess, but no. I couldn't find a reduced test case. I didn't say the issue was an easy one, that I didn't.

> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2690) Stateless components and classloading

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802405#action_12802405 ] 

Igor Vaynberg commented on WICKET-2690:
---------------------------------------

this should already be done by org.apache.wicket.Initializer. maybe initializers do not run in your environment for whatever reason when wicket starts up...i would investigate that.

> Stateless components and classloading 
> --------------------------------------
>
>                 Key: WICKET-2690
>                 URL: https://issues.apache.org/jira/browse/WICKET-2690
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Kirill
>
> Following a post on the user list, which so far got no reply, posting the issue here:
> Wicket 1.4.5 with Tomcat 6.0.
> I'm trying to make a session-resistant (but *not* bookmarkable) link on the homepage that should work no matter if the page exists. If the page doesn't exist, I want it to be created and then the link event handler invoked. As far as I understand, StatelessLink should work for this purpose. However, I can't get it to work. From time to time, clicking it produces the following error in the console:
> SEVERE: unable to find listener interface ILinkListener
> org.apache.wicket.WicketRuntimeException: unable to find listener interface ILinkListener
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:159)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Sometimes I also get the following (seemingly related) error:
> org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.wicket.WicketRuntimeException: Unable to instantiate Page class: com.my.HomePage. See below for details.
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:286)
>         at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:78)
>         ... 20 more
> Caused by: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface ILinkListener
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:407)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveBookmarkablePage(AbstractRequestCycleProcessor.java:266)
>         ... 21 more
> A reliable way to reproduce it is:
> 1) open the home page in the browser
> 2) restart the web application in Tomcat
> 3) click the link
> Every time I perform the above steps, I either get the first exception, or the second.
> It doesn't necessarily happen immediately when the session expires (but AFAICT it always happens some time after that). Looks like it happens when a classloader cache in the servlet container gets garbage-collected.
> I find the first stack trace especially interesting. I have traced the execution flow in debugger, and I'm confident that the first exception always happens after some Links get instantiated, and because Link implements ILinkListener, at that point the RequestListenerInterface instance for ILinkListener exists. However, RequestListenerInterface.register() method doesn't get called during the "resolve" step, so I must conclude that the servlet container uses the preexisting class at that point. But when the execution flow reaches AbstractRequestCycleProcessor.java:92 during the "process" step, the RequestListenerInterface instance for ILinkListener can no longer be found.
> Such inconsistencies happen when one class (AbstractRequestCycleProcessor?) is created by a different classloader than another class (RequestListenerInterface?).
> What remains unclear is why I can't see other reports of the same problem on the list. Am I doing something wrong?
> From what I know about servlet containers, you are not supposed to mess with classloading there. I did some of that in past, and it can be VERY hard to make it work across the implementations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.