On 6/28/07, Watter <[EMAIL PROTECTED]> wrote:


Jean-Baptiste Quenot-3 wrote:
>
> * Watter:
>
>> With   that,   I   can   get   past   the   error   I   reported
>> earlier. Unfortunately, I'm  seeing something else now. If  I go
>> to a page,  then use my browser  back button to go  back a page,
>> and then click on any other link, I get a ClassCastException for
>> FusionAuthenticatedWebSession:
>
> If you don't paste the include/exclude patterns, it will be very
> hard to help you.
>
You're right, of course. Here is all the relevant information I can think
of, and thank you for your help.

Wicket Version: latest 1.3.0-incubating-SNAPSHOT from wicketstuff maven
repository

ReloadingFilter Patterns:


ReloadingClassLoader.includePattern("
com.ptc.fusion.web.FusionAuthenticatedWebSession*");

ReloadingClassLoader.includePattern("
com.ptc.fusion.web.FusionWebApplication*");
        ReloadingClassLoader.includePattern("com.ptc.fusion.web.pages*");
        ReloadingClassLoader.includePattern("com.ptc.fusion.web.security*
");
        ReloadingClassLoader.includePattern("
com.ptc.fusion.web.dataprovider*");

(the * after FusionWebApplication was added at your suggestion and allowed
me to revert back to overriding getSessionFactory())

Here are some important parts of the FusionAuthenticatedWebSession:

public class FusionAuthenticatedWebSession extends WebSession {

        private static final long serialVersionUID = 1L;
        private User user;

        @SpringBean(name = "ldapauthenticationManager")
        AuthenticationProvider ldapAuthenticationProvider;

        @SpringBean(name = "daoauthenticationManager")
        AuthenticationProvider daoAuthenticationProvider;

        @SpringBean(name = "webSettings")
        private WebSettings webSettings;


A couple of observations.  Looks like you are using Acegi as well.  I have
the same problem when I don't exclude my Session and Application classes.

I am able to proceed now with the following:

       ReloadingClassLoader.includePattern("info.jtrac.wicket.*");
       ReloadingClassLoader.excludePattern("
info.jtrac.wicket.JtracApplication");
       ReloadingClassLoader.excludePattern("info.jtrac.wicket.JtracSession
");
       ReloadingClassLoader.excludePattern("info.jtrac.wicket.DashboardPage");
// this the home page
       // ReloadingClassLoader.excludePattern("org.springframework.*");
       // ReloadingClassLoader.excludePattern("org.acegisecurity.*");

I know this goes completely opposite to what Jean-Baptiste Quenot advises,
but this is what is working.  Let me try summarize, I started having
problems (I think same case with you Matt?) when I got a recent version of
the snapshot and I raised the JIRA issue
https://issues.apache.org/jira/browse/WICKET-685

I thought the problem was solved when I excluded "org.springframework".  The
"Markup of type 'html' for component not found" problem went away, so I
closed the JIRA issue.  But later I found that the effect of
ReloadingWicketFilter was nullified - i.e. after changing code and
refreshing the page I was getting ClassCastException straight away.

Anyway now things are back to how they were working for me with this change:
excluding the home page also.

Jean-Baptiste: Is there any chance that whatever change was made to
classloading could be undone?

Thanks,

Peter.

       public FusionAuthenticatedWebSession(WebApplication application,
Request
request) {
                super(application, request);
                InjectorHolder.getInjector().inject(this);
        }

        public static FusionAuthenticatedWebSession get() {
                return (FusionAuthenticatedWebSession) Session.get();
        }

        /** True when the user is signed in */
        private boolean signedIn;

        public boolean authenticate(final String username, final String
password) {
                //do some authentication work
        }

        public final boolean signIn(final String username, final String
password) {
                signedIn = authenticate(username, password);
                return signedIn;
        }


        /* Accessors */
        public final boolean isSignedIn() {
                return signedIn;
        }

        public User getUser() {
                return user;
        }
}

I call the get() method of this class in a few places and it's that call
that causes the error when using the ReloadingFilter and after I hit the
back button.

WicketMessage: Method onLinkClicked of interface
org.apache.wicket.markup.html.link.ILinkListener targeted at component
[MarkupContainer [Component id = listOrganizationLink, page =
com.ptc.fusion.web.pages.user.ListUsers, path =
77:adminMenuItems:listOrganizationLink.PageLink, isVisible = true,
isVersioned = true]] threw an exception

Root cause:

java.lang.ClassCastException:
com.ptc.fusion.web.FusionAuthenticatedWebSession
at
com.ptc.fusion.web.FusionAuthenticatedWebSession.get(
FusionAuthenticatedWebSession.java:43)
at
com.ptc.fusion.web.pages.template.FusionTemplate$AdminMenuItems.<init>(
FusionTemplate.java:136)
at
com.ptc.fusion.web.pages.template.FusionTemplate.<init>(
FusionTemplate.java:71)
at
com.ptc.fusion.web.pages.ListOrganization.<init>(ListOrganization.java:35)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at
org.apache.wicket.session.DefaultPageFactory.newPage(
DefaultPageFactory.java:58)
at org.apache.wicket.markup.html.link.PageLink$1.getPage(PageLink.java:66)
at org.apache.wicket.markup.html.link.PageLink.onClick(PageLink.java:153)
at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:222)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.wicket.RequestListenerInterface.invoke(
RequestListenerInterface.java:186)
at

org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents
(ListenerInterfaceRequestTarget.java:73)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
AbstractRequestCycleProcessor.java:90)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
:1031)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1107)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1176)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java
:257)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java
:127)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(
ServletHandler.java:1065)
at

org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
(OpenSessionInViewFilter.java:173)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(
OncePerRequestFilter.java:77)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(
ServletHandler.java:1065)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java
:365)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java
:185)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java
:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java
:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(
ContextHandlerCollection.java:146)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java
:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java
:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(
HttpConnection.java:751)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java
:329)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java
:475)

Complete stack:

org.apache.wicket.WicketRuntimeException: Method onLinkClicked of
interface
org.apache.wicket.markup.html.link.ILinkListener targeted at component
[MarkupContainer [Component id = listOrganizationLink, page =
com.ptc.fusion.web.pages.user.ListUsers, path =
77:adminMenuItems:listOrganizationLink.PageLink, isVisible = true,
isVersioned = true]] threw an exception
at
org.apache.wicket.RequestListenerInterface.invoke(
RequestListenerInterface.java:197)
at

org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents
(ListenerInterfaceRequestTarget.java:73)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
AbstractRequestCycleProcessor.java:90)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
:1031)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1107)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1176)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java
:257)

java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.wicket.RequestListenerInterface.invoke(
RequestListenerInterface.java:186)
at

org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents
(ListenerInterfaceRequestTarget.java:73)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
AbstractRequestCycleProcessor.java:90)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
:1031)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1107)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1176)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java
:257)

Matt










--
View this message in context:
http://www.nabble.com/Has-something-changed-in-markup-inheritance--tf3963374.html#a11343320
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to