You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa" <da...@xs4all.nl> on 2004/03/13 02:05:07 UTC

RequestContext violates loader constraints

Hi,

I've been trying (for a couple of days now) to get to grips with a 
transparent way to put pages into a ssl mode. Basically the stuff works.
This question has to do with the final bit (as usual ;-) ). This concerns 
moving into another page (which works in a non-ssl setting) through a 
secure form.

Following is the snip of the border that contains a login area (like the 
tigris.org stuff). The formdata is submitted securely (or so the isSecure() 
method says) but on arrival in the attemptLogin() method things fall over 
as can be seen in the error trace.

What am i doing wrong here?

I'm assuming it is not the fact that the SecureForm was inherited from Form 
with some small overrides to make is go secure.

TIA
Fermin DCG

										<form jwcid="@SecureForm" target="frmMain" 
listener="ognl:listeners.attemptLogin">
  Username:<input type="text" jwcid="username@TextField" 
value="ognl:username" />
Password:<input type="password" jwcid="password@TextField" hidden="true" 
value="ognl:password" />
<input type="image" alt="Login" jwcid="@ImageSubmit" 
image="ognl:assets.btnLogin" listener="ognl:listeners.attemptLogin" />
</form>


public void attemptLogin(IRequestCycle cycle) {
  AGenericUser user = (AGenericUser) ActorManager.getUserActor( 
getUsername() );

  if (user != null) {
   if (user.getPassword().equals(_password)) {
    Visit visit = (Visit) ((StdTapestryEngine) 
getPage().getEngine()).getVisit(cycle);
    visit.setUser(user);
    cycle.activate("LoginWelcome");
   }
  _password = null;
  } else {
     cycle.activate("LoginError");
     _result = "User unknown or wrong pasword, please try again.";
  }
}


Error trace:
org.apache.tapestry.ApplicationRuntimeException
Unable to invoke method attemptLogin on 
org.dcg.webapp.supporting.Border$Enhance_3@4f3ba2[HomeContent/$Border]: null

java.lang.reflect.InvocationTargetException

java.lang.LinkageError
Class org/apache/tapestry/request/RequestContext violates loader constraints
Stack Trace:

     * java.lang.ClassLoader.defineClass0(Native Method)
     * java.lang.ClassLoader.defineClass(ClassLoader.java:537)
     * java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
     * java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
     * java.net.URLClassLoader.access$100(URLClassLoader.java:55)
     * java.net.URLClassLoader$1.run(URLClassLoader.java:194)
     * java.security.AccessController.doPrivileged(Native Method)
     * java.net.URLClassLoader.findClass(URLClassLoader.java:187)
     * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:224)
     * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:197)
     * java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
     * org.dcg.jwc.link.SecurePage.pageValidate(SecurePage.java:27)
     * org.apache.tapestry.AbstractPage.firePageValidate(AbstractPage.java:599)
     * org.apache.tapestry.AbstractPage.validate(AbstractPage.java:374)
     * org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:729)
     * org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:717)
     * org.dcg.webapp.supporting.Border.attemptLogin(Border.java:118)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: RequestContext violates loader constraints

Posted by "F. Da Costa" <da...@xs4all.nl>.
Geoff Longman wrote:
> Dunno what's causing this but the exception in your last message spurred me
> lookup some more info on LinkageError and loading constraints...
> 
> See http://tinyurl.com/2xbw5 section 5.3.4 Loading Constraints
> 
> here's a link to the article referred to in that section
> 
> http://tinyurl.com/3hgug
> 
> What does your runtime classpath look like?
Basically it looks ok.
But in another test project i've redone the whole secureForm & securePage 
thingy and got it to work. So i guess somethin *must* be up in the other 
one. Can't find any double classes or whatever but maybe that has something 
to do with the time being 04:00 and my eyes looking squarish.

Tomorrow i'll get out the old magnifier and flea-comb (with or without an 
e?) and go throught he code once more.

I'm going to send you a cleaned up version of the secure jetty as well (one 
*with* working images etc.)

Thx 4 the suggestions Geoff,

Cheers,
Fermin

> 
> Geoff
> 
> 
> 
> ----- Original Message -----
> From: "F. Da Costa" <da...@xs4all.nl>
> To: <ta...@jakarta.apache.org>
> Sent: Friday, March 12, 2004 8:34 PM
> Subject: Re: RequestContext violates loader constraints
> 
> 
> 
>>Found something funny in the Form code.
>>It concerns the renderComponent method
>><snip>
>>if (rewound) {
>>  String storedIdList = cycle.getRequestContext().getParameter(_name);
>>  reconstructAllocatedIds(storedIdList);
>>}
>></snip>
>>
>>Following the output retrieved by setting a breakpoint on the String
>>storedList line.
>>
>>rewound
>>  (boolean) true
>>cycle.getRequestContext().getParameter(_name)
>>  (java.lang.String) username,password,$ImageSubmit
>>
>>As can be seen nothing is doing anything funny.
>>Doing the next debug step throws the error (nothing changed).
>>Granted i'm no guru but i am a bit surprised that the storedList did not
>>get set. Putting the breakpoint on the next line makes it clear that it is
>>never reached.
>>
>>Any takers?
>>
>>Thx,
>>Fermin
>>
>>
>>
>>
>>>Hi,
>>>
>>>I've been trying (for a couple of days now) to get to grips with a
>>>transparent way to put pages into a ssl mode. Basically the stuff works.
>>>This question has to do with the final bit (as usual ;-) ). This
>>>concerns moving into another page (which works in a non-ssl setting)
>>>through a secure form.
>>>
>>>Following is the snip of the border that contains a login area (like the
>>>tigris.org stuff). The formdata is submitted securely (or so the
>>>isSecure() method says) but on arrival in the attemptLogin() method
>>>things fall over as can be seen in the error trace.
>>>
>>>What am i doing wrong here?
>>>
>>>I'm assuming it is not the fact that the SecureForm was inherited from
>>>Form with some small overrides to make is go secure.
>>>
>>>TIA
>>>Fermin DCG
>>>
>>>                                        <form jwcid="@SecureForm"
>>>target="frmMain" listener="ognl:listeners.attemptLogin">
>>> Username:<input type="text" jwcid="username@TextField"
>>>value="ognl:username" />
>>>Password:<input type="password" jwcid="password@TextField" hidden="true"
>>>value="ognl:password" />
>>><input type="image" alt="Login" jwcid="@ImageSubmit"
>>>image="ognl:assets.btnLogin" listener="ognl:listeners.attemptLogin" />
>>></form>
>>>
>>>
>>>public void attemptLogin(IRequestCycle cycle) {
>>> AGenericUser user = (AGenericUser) ActorManager.getUserActor(
>>>getUsername() );
>>>
>>> if (user != null) {
>>>  if (user.getPassword().equals(_password)) {
>>>   Visit visit = (Visit) ((StdTapestryEngine)
>>>getPage().getEngine()).getVisit(cycle);
>>>   visit.setUser(user);
>>>   cycle.activate("LoginWelcome");
>>>  }
>>> _password = null;
>>> } else {
>>>    cycle.activate("LoginError");
>>>    _result = "User unknown or wrong pasword, please try again.";
>>> }
>>>}
>>>
>>>
>>>Error trace:
>>>org.apache.tapestry.ApplicationRuntimeException
>>>Unable to invoke method attemptLogin on
>>>org.dcg.webapp.supporting.Border$Enhance_3@4f3ba2[HomeContent/$Border]:
>>>null
>>>
>>>java.lang.reflect.InvocationTargetException
>>>
>>>java.lang.LinkageError
>>>Class org/apache/tapestry/request/RequestContext violates loader
>>>constraints
>>>Stack Trace:
>>>
>>>    * java.lang.ClassLoader.defineClass0(Native Method)
>>>    * java.lang.ClassLoader.defineClass(ClassLoader.java:537)
>>>    *
>>>java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>>>    * java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
>>>    * java.net.URLClassLoader.access$100(URLClassLoader.java:55)
>>>    * java.net.URLClassLoader$1.run(URLClassLoader.java:194)
>>>    * java.security.AccessController.doPrivileged(Native Method)
>>>    * java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>>>    * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:224)
>>>    * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:197)
>>>    * java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>>>    * org.dcg.jwc.link.SecurePage.pageValidate(SecurePage.java:27)
>>>    *
>>>org.apache.tapestry.AbstractPage.firePageValidate(AbstractPage.java:599)
>>>    * org.apache.tapestry.AbstractPage.validate(AbstractPage.java:374)
>>>    *
>>>org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:729)
>>>    *
>>>org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:717)
>>>    * org.dcg.webapp.supporting.Border.attemptLogin(Border.java:118)
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: RequestContext violates loader constraints

Posted by Geoff Longman <gl...@intelligentworks.com>.
Dunno what's causing this but the exception in your last message spurred me
lookup some more info on LinkageError and loading constraints...

See http://tinyurl.com/2xbw5 section 5.3.4 Loading Constraints

here's a link to the article referred to in that section

http://tinyurl.com/3hgug

What does your runtime classpath look like?

Geoff



----- Original Message -----
From: "F. Da Costa" <da...@xs4all.nl>
To: <ta...@jakarta.apache.org>
Sent: Friday, March 12, 2004 8:34 PM
Subject: Re: RequestContext violates loader constraints


> Found something funny in the Form code.
> It concerns the renderComponent method
> <snip>
> if (rewound) {
>   String storedIdList = cycle.getRequestContext().getParameter(_name);
>   reconstructAllocatedIds(storedIdList);
> }
> </snip>
>
> Following the output retrieved by setting a breakpoint on the String
> storedList line.
>
> rewound
>   (boolean) true
> cycle.getRequestContext().getParameter(_name)
>   (java.lang.String) username,password,$ImageSubmit
>
> As can be seen nothing is doing anything funny.
> Doing the next debug step throws the error (nothing changed).
> Granted i'm no guru but i am a bit surprised that the storedList did not
> get set. Putting the breakpoint on the next line makes it clear that it is
> never reached.
>
> Any takers?
>
> Thx,
> Fermin
>
>
>
> > Hi,
> >
> > I've been trying (for a couple of days now) to get to grips with a
> > transparent way to put pages into a ssl mode. Basically the stuff works.
> > This question has to do with the final bit (as usual ;-) ). This
> > concerns moving into another page (which works in a non-ssl setting)
> > through a secure form.
> >
> > Following is the snip of the border that contains a login area (like the
> > tigris.org stuff). The formdata is submitted securely (or so the
> > isSecure() method says) but on arrival in the attemptLogin() method
> > things fall over as can be seen in the error trace.
> >
> > What am i doing wrong here?
> >
> > I'm assuming it is not the fact that the SecureForm was inherited from
> > Form with some small overrides to make is go secure.
> >
> > TIA
> > Fermin DCG
> >
> >                                         <form jwcid="@SecureForm"
> > target="frmMain" listener="ognl:listeners.attemptLogin">
> >  Username:<input type="text" jwcid="username@TextField"
> > value="ognl:username" />
> > Password:<input type="password" jwcid="password@TextField" hidden="true"
> > value="ognl:password" />
> > <input type="image" alt="Login" jwcid="@ImageSubmit"
> > image="ognl:assets.btnLogin" listener="ognl:listeners.attemptLogin" />
> > </form>
> >
> >
> > public void attemptLogin(IRequestCycle cycle) {
> >  AGenericUser user = (AGenericUser) ActorManager.getUserActor(
> > getUsername() );
> >
> >  if (user != null) {
> >   if (user.getPassword().equals(_password)) {
> >    Visit visit = (Visit) ((StdTapestryEngine)
> > getPage().getEngine()).getVisit(cycle);
> >    visit.setUser(user);
> >    cycle.activate("LoginWelcome");
> >   }
> >  _password = null;
> >  } else {
> >     cycle.activate("LoginError");
> >     _result = "User unknown or wrong pasword, please try again.";
> >  }
> > }
> >
> >
> > Error trace:
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to invoke method attemptLogin on
> > org.dcg.webapp.supporting.Border$Enhance_3@4f3ba2[HomeContent/$Border]:
> > null
> >
> > java.lang.reflect.InvocationTargetException
> >
> > java.lang.LinkageError
> > Class org/apache/tapestry/request/RequestContext violates loader
> > constraints
> > Stack Trace:
> >
> >     * java.lang.ClassLoader.defineClass0(Native Method)
> >     * java.lang.ClassLoader.defineClass(ClassLoader.java:537)
> >     *
> > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
> >     * java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
> >     * java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> >     * java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> >     * java.security.AccessController.doPrivileged(Native Method)
> >     * java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> >     * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:224)
> >     * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:197)
> >     * java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> >     * org.dcg.jwc.link.SecurePage.pageValidate(SecurePage.java:27)
> >     *
> > org.apache.tapestry.AbstractPage.firePageValidate(AbstractPage.java:599)
> >     * org.apache.tapestry.AbstractPage.validate(AbstractPage.java:374)
> >     *
> > org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:729)
> >     *
> > org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:717)
> >     * org.dcg.webapp.supporting.Border.attemptLogin(Border.java:118)
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Can not change form content dynamiclly?

Posted by Jamie Orchard-Hays <ja...@dang.com>.
OK, I started a Gotchas page with the first big gotcha that got me when 
I started Tapestry: misusing initialize()!

Jamie

On Mar 12, 2004, at 10:21 PM, Erik Hatcher wrote:

> Use contrib:FormConditional instead of Conditional - that will do the 
> trick.
>
> Anybody wanna volunteer to start a "Gotchas" wiki page? :)
>
> 	Erik
>
>
> On Mar 12, 2004, at 10:16 PM, Alex Kwan wrote:
>
>> Hi, All
>>     Recently, I ran into a strange problem. I have a form that 
>> contains
>> some submit buttons. Just below the buttons, there are several input 
>> field.
>> Whether to show these field are judged by the listeners of the submit
>> buttons. For example, if I click the showName field button, the name 
>> input
>> field will be shown and other buttons will be hide.
>>
>>     But in the rewind cycle, The listeners are invoked according to 
>> the
>> rendering order, so the button listeners are invoked before 
>> rerendering the
>> field. The tapestry will check the form's elements and find the count 
>> of the
>> element changed,
>> so it will report the stale link exception.
>>
>>
>>     Now how can I handle this situation?
>>
>>     Any suggestion will be appreciated.
>>
>>
>> Alex Kwan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Can not change form content dynamiclly?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Use contrib:FormConditional instead of Conditional - that will do the 
trick.

Anybody wanna volunteer to start a "Gotchas" wiki page? :)

	Erik


On Mar 12, 2004, at 10:16 PM, Alex Kwan wrote:

> Hi, All
>     Recently, I ran into a strange problem. I have a form that contains
> some submit buttons. Just below the buttons, there are several input 
> field.
> Whether to show these field are judged by the listeners of the submit
> buttons. For example, if I click the showName field button, the name 
> input
> field will be shown and other buttons will be hide.
>
>     But in the rewind cycle, The listeners are invoked according to the
> rendering order, so the button listeners are invoked before 
> rerendering the
> field. The tapestry will check the form's elements and find the count 
> of the
> element changed,
> so it will report the stale link exception.
>
>
>     Now how can I handle this situation?
>
>     Any suggestion will be appreciated.
>
>
> Alex Kwan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Can not change form content dynamiclly?

Posted by Alex Kwan <er...@hotmail.com>.
Thanks Vince and Erik.
    You two always give me the best answers.
    But this does show some trick aspects of Tapestry. I hope we can have a
better solution to these kind problems.
    BTW: I really want to contribute to the Tapestry Gotchas:)

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Can not change form content dynamiclly?

Posted by Vince Platt <Vi...@comcast.net>.
Alex, have you tried performing your actions in the Form component's listener?  I don't know if I understood your problem exactly, but I suspect that using the form's listener will solve the issue.  If you read the description for the Form component (http://jakarta.apache.org/tapestry/doc/ComponentReference/Form.html) a little more closely, you'll notice that the listener for a Form gets executed AFTER  the components have all finished their processing.  The implication of this is that you can not RELIABLY modify or read the posted data until the Form's listener is executed.  It sometimes does work out OK, but not always and experience has shown me that it shouldn't be relied upon.  

Also, you mentioned that you have several submit buttons.  In order to be able to tell which button was clicked and caused the submit, you will want to either have the Submit listeners set a flag which you then check in the Form's listener, or you can use the 'tag' and 'listener' parameters for the Submit component as documented (http://jakarta.apache.org/tapestry/doc/ComponentReference/Submit.html).

I hope that helps!
-Vince


-----Original Message-----
From: Alex Kwan [mailto:erazor_kwan@hotmail.com]
Sent: Friday, March 12, 2004 9:17 PM
To: Tapestry users
Subject: Can not change form content dynamiclly?


Hi, All
    Recently, I ran into a strange problem. I have a form that contains
some submit buttons. Just below the buttons, there are several input field.
Whether to show these field are judged by the listeners of the submit
buttons. For example, if I click the showName field button, the name input
field will be shown and other buttons will be hide.

    But in the rewind cycle, The listeners are invoked according to the
rendering order, so the button listeners are invoked before rerendering the
field. The tapestry will check the form's elements and find the count of the
element changed,
so it will report the stale link exception.


    Now how can I handle this situation?

    Any suggestion will be appreciated.


Alex Kwan



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Can not change form content dynamiclly?

Posted by Alex Kwan <er...@hotmail.com>.
Hi, All
    Recently, I ran into a strange problem. I have a form that contains
some submit buttons. Just below the buttons, there are several input field.
Whether to show these field are judged by the listeners of the submit
buttons. For example, if I click the showName field button, the name input
field will be shown and other buttons will be hide.

    But in the rewind cycle, The listeners are invoked according to the
rendering order, so the button listeners are invoked before rerendering the
field. The tapestry will check the form's elements and find the count of the
element changed,
so it will report the stale link exception.


    Now how can I handle this situation?

    Any suggestion will be appreciated.


Alex Kwan

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: RequestContext violates loader constraints (done)

Posted by "F. Da Costa" <da...@xs4all.nl>.
Geoff Longman wrote:
> Fermin,
> 
> Might you have two versions of tapestry in the classpath?
Not tapestry versions but I guess that during a CVS sync i stuffed up and 
an additional RequestContext was introduced in the source (some old thing i 
was testing with a while ago).

Obviously it choked whilst trying to something with it. Although it does 
not explain away everything that happened.
Oh well, it works again so i'll clean up the Jetty thing and post it so can 
(or cannot) do something with it.

Thx,

Fermin

> 
> Geoff
> ----- Original Message -----
> From: "F. Da Costa" <da...@xs4all.nl>
> To: <ta...@jakarta.apache.org>
> Sent: Friday, March 12, 2004 8:34 PM
> Subject: Re: RequestContext violates loader constraints
> 
> 
> 
>>Found something funny in the Form code.
>>It concerns the renderComponent method
>><snip>
>>if (rewound) {
>>  String storedIdList = cycle.getRequestContext().getParameter(_name);
>>  reconstructAllocatedIds(storedIdList);
>>}
>></snip>
>>
>>Following the output retrieved by setting a breakpoint on the String
>>storedList line.
>>
>>rewound
>>  (boolean) true
>>cycle.getRequestContext().getParameter(_name)
>>  (java.lang.String) username,password,$ImageSubmit
>>
>>As can be seen nothing is doing anything funny.
>>Doing the next debug step throws the error (nothing changed).
>>Granted i'm no guru but i am a bit surprised that the storedList did not
>>get set. Putting the breakpoint on the next line makes it clear that it is
>>never reached.
>>
>>Any takers?
>>
>>Thx,
>>Fermin
>>
>>
>>
>>
>>>Hi,
>>>
>>>I've been trying (for a couple of days now) to get to grips with a
>>>transparent way to put pages into a ssl mode. Basically the stuff works.
>>>This question has to do with the final bit (as usual ;-) ). This
>>>concerns moving into another page (which works in a non-ssl setting)
>>>through a secure form.
>>>
>>>Following is the snip of the border that contains a login area (like the
>>>tigris.org stuff). The formdata is submitted securely (or so the
>>>isSecure() method says) but on arrival in the attemptLogin() method
>>>things fall over as can be seen in the error trace.
>>>
>>>What am i doing wrong here?
>>>
>>>I'm assuming it is not the fact that the SecureForm was inherited from
>>>Form with some small overrides to make is go secure.
>>>
>>>TIA
>>>Fermin DCG
>>>
>>>                                        <form jwcid="@SecureForm"
>>>target="frmMain" listener="ognl:listeners.attemptLogin">
>>> Username:<input type="text" jwcid="username@TextField"
>>>value="ognl:username" />
>>>Password:<input type="password" jwcid="password@TextField" hidden="true"
>>>value="ognl:password" />
>>><input type="image" alt="Login" jwcid="@ImageSubmit"
>>>image="ognl:assets.btnLogin" listener="ognl:listeners.attemptLogin" />
>>></form>
>>>
>>>
>>>public void attemptLogin(IRequestCycle cycle) {
>>> AGenericUser user = (AGenericUser) ActorManager.getUserActor(
>>>getUsername() );
>>>
>>> if (user != null) {
>>>  if (user.getPassword().equals(_password)) {
>>>   Visit visit = (Visit) ((StdTapestryEngine)
>>>getPage().getEngine()).getVisit(cycle);
>>>   visit.setUser(user);
>>>   cycle.activate("LoginWelcome");
>>>  }
>>> _password = null;
>>> } else {
>>>    cycle.activate("LoginError");
>>>    _result = "User unknown or wrong pasword, please try again.";
>>> }
>>>}
>>>
>>>
>>>Error trace:
>>>org.apache.tapestry.ApplicationRuntimeException
>>>Unable to invoke method attemptLogin on
>>>org.dcg.webapp.supporting.Border$Enhance_3@4f3ba2[HomeContent/$Border]:
>>>null
>>>
>>>java.lang.reflect.InvocationTargetException
>>>
>>>java.lang.LinkageError
>>>Class org/apache/tapestry/request/RequestContext violates loader
>>>constraints
>>>Stack Trace:
>>>
>>>    * java.lang.ClassLoader.defineClass0(Native Method)
>>>    * java.lang.ClassLoader.defineClass(ClassLoader.java:537)
>>>    *
>>>java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>>>    * java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
>>>    * java.net.URLClassLoader.access$100(URLClassLoader.java:55)
>>>    * java.net.URLClassLoader$1.run(URLClassLoader.java:194)
>>>    * java.security.AccessController.doPrivileged(Native Method)
>>>    * java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>>>    * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:224)
>>>    * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:197)
>>>    * java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>>>    * org.dcg.jwc.link.SecurePage.pageValidate(SecurePage.java:27)
>>>    *
>>>org.apache.tapestry.AbstractPage.firePageValidate(AbstractPage.java:599)
>>>    * org.apache.tapestry.AbstractPage.validate(AbstractPage.java:374)
>>>    *
>>>org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:729)
>>>    *
>>>org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:717)
>>>    * org.dcg.webapp.supporting.Border.attemptLogin(Border.java:118)
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: RequestContext violates loader constraints

Posted by Geoff Longman <gl...@intelligentworks.com>.
Fermin,

Might you have two versions of tapestry in the classpath?

Geoff
----- Original Message -----
From: "F. Da Costa" <da...@xs4all.nl>
To: <ta...@jakarta.apache.org>
Sent: Friday, March 12, 2004 8:34 PM
Subject: Re: RequestContext violates loader constraints


> Found something funny in the Form code.
> It concerns the renderComponent method
> <snip>
> if (rewound) {
>   String storedIdList = cycle.getRequestContext().getParameter(_name);
>   reconstructAllocatedIds(storedIdList);
> }
> </snip>
>
> Following the output retrieved by setting a breakpoint on the String
> storedList line.
>
> rewound
>   (boolean) true
> cycle.getRequestContext().getParameter(_name)
>   (java.lang.String) username,password,$ImageSubmit
>
> As can be seen nothing is doing anything funny.
> Doing the next debug step throws the error (nothing changed).
> Granted i'm no guru but i am a bit surprised that the storedList did not
> get set. Putting the breakpoint on the next line makes it clear that it is
> never reached.
>
> Any takers?
>
> Thx,
> Fermin
>
>
>
> > Hi,
> >
> > I've been trying (for a couple of days now) to get to grips with a
> > transparent way to put pages into a ssl mode. Basically the stuff works.
> > This question has to do with the final bit (as usual ;-) ). This
> > concerns moving into another page (which works in a non-ssl setting)
> > through a secure form.
> >
> > Following is the snip of the border that contains a login area (like the
> > tigris.org stuff). The formdata is submitted securely (or so the
> > isSecure() method says) but on arrival in the attemptLogin() method
> > things fall over as can be seen in the error trace.
> >
> > What am i doing wrong here?
> >
> > I'm assuming it is not the fact that the SecureForm was inherited from
> > Form with some small overrides to make is go secure.
> >
> > TIA
> > Fermin DCG
> >
> >                                         <form jwcid="@SecureForm"
> > target="frmMain" listener="ognl:listeners.attemptLogin">
> >  Username:<input type="text" jwcid="username@TextField"
> > value="ognl:username" />
> > Password:<input type="password" jwcid="password@TextField" hidden="true"
> > value="ognl:password" />
> > <input type="image" alt="Login" jwcid="@ImageSubmit"
> > image="ognl:assets.btnLogin" listener="ognl:listeners.attemptLogin" />
> > </form>
> >
> >
> > public void attemptLogin(IRequestCycle cycle) {
> >  AGenericUser user = (AGenericUser) ActorManager.getUserActor(
> > getUsername() );
> >
> >  if (user != null) {
> >   if (user.getPassword().equals(_password)) {
> >    Visit visit = (Visit) ((StdTapestryEngine)
> > getPage().getEngine()).getVisit(cycle);
> >    visit.setUser(user);
> >    cycle.activate("LoginWelcome");
> >   }
> >  _password = null;
> >  } else {
> >     cycle.activate("LoginError");
> >     _result = "User unknown or wrong pasword, please try again.";
> >  }
> > }
> >
> >
> > Error trace:
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to invoke method attemptLogin on
> > org.dcg.webapp.supporting.Border$Enhance_3@4f3ba2[HomeContent/$Border]:
> > null
> >
> > java.lang.reflect.InvocationTargetException
> >
> > java.lang.LinkageError
> > Class org/apache/tapestry/request/RequestContext violates loader
> > constraints
> > Stack Trace:
> >
> >     * java.lang.ClassLoader.defineClass0(Native Method)
> >     * java.lang.ClassLoader.defineClass(ClassLoader.java:537)
> >     *
> > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
> >     * java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
> >     * java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> >     * java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> >     * java.security.AccessController.doPrivileged(Native Method)
> >     * java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> >     * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:224)
> >     * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:197)
> >     * java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> >     * org.dcg.jwc.link.SecurePage.pageValidate(SecurePage.java:27)
> >     *
> > org.apache.tapestry.AbstractPage.firePageValidate(AbstractPage.java:599)
> >     * org.apache.tapestry.AbstractPage.validate(AbstractPage.java:374)
> >     *
> > org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:729)
> >     *
> > org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:717)
> >     * org.dcg.webapp.supporting.Border.attemptLogin(Border.java:118)
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: RequestContext violates loader constraints

Posted by "F. Da Costa" <da...@xs4all.nl>.
Found something funny in the Form code.
It concerns the renderComponent method
<snip>
if (rewound) {
  String storedIdList = cycle.getRequestContext().getParameter(_name);
  reconstructAllocatedIds(storedIdList);
}
</snip>

Following the output retrieved by setting a breakpoint on the String 
storedList line.

rewound
  (boolean) true
cycle.getRequestContext().getParameter(_name)
  (java.lang.String) username,password,$ImageSubmit

As can be seen nothing is doing anything funny.
Doing the next debug step throws the error (nothing changed).
Granted i'm no guru but i am a bit surprised that the storedList did not 
get set. Putting the breakpoint on the next line makes it clear that it is 
never reached.

Any takers?

Thx,
Fermin



> Hi,
> 
> I've been trying (for a couple of days now) to get to grips with a 
> transparent way to put pages into a ssl mode. Basically the stuff works.
> This question has to do with the final bit (as usual ;-) ). This 
> concerns moving into another page (which works in a non-ssl setting) 
> through a secure form.
> 
> Following is the snip of the border that contains a login area (like the 
> tigris.org stuff). The formdata is submitted securely (or so the 
> isSecure() method says) but on arrival in the attemptLogin() method 
> things fall over as can be seen in the error trace.
> 
> What am i doing wrong here?
> 
> I'm assuming it is not the fact that the SecureForm was inherited from 
> Form with some small overrides to make is go secure.
> 
> TIA
> Fermin DCG
> 
>                                         <form jwcid="@SecureForm" 
> target="frmMain" listener="ognl:listeners.attemptLogin">
>  Username:<input type="text" jwcid="username@TextField" 
> value="ognl:username" />
> Password:<input type="password" jwcid="password@TextField" hidden="true" 
> value="ognl:password" />
> <input type="image" alt="Login" jwcid="@ImageSubmit" 
> image="ognl:assets.btnLogin" listener="ognl:listeners.attemptLogin" />
> </form>
> 
> 
> public void attemptLogin(IRequestCycle cycle) {
>  AGenericUser user = (AGenericUser) ActorManager.getUserActor( 
> getUsername() );
> 
>  if (user != null) {
>   if (user.getPassword().equals(_password)) {
>    Visit visit = (Visit) ((StdTapestryEngine) 
> getPage().getEngine()).getVisit(cycle);
>    visit.setUser(user);
>    cycle.activate("LoginWelcome");
>   }
>  _password = null;
>  } else {
>     cycle.activate("LoginError");
>     _result = "User unknown or wrong pasword, please try again.";
>  }
> }
> 
> 
> Error trace:
> org.apache.tapestry.ApplicationRuntimeException
> Unable to invoke method attemptLogin on 
> org.dcg.webapp.supporting.Border$Enhance_3@4f3ba2[HomeContent/$Border]: 
> null
> 
> java.lang.reflect.InvocationTargetException
> 
> java.lang.LinkageError
> Class org/apache/tapestry/request/RequestContext violates loader 
> constraints
> Stack Trace:
> 
>     * java.lang.ClassLoader.defineClass0(Native Method)
>     * java.lang.ClassLoader.defineClass(ClassLoader.java:537)
>     * 
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>     * java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
>     * java.net.URLClassLoader.access$100(URLClassLoader.java:55)
>     * java.net.URLClassLoader$1.run(URLClassLoader.java:194)
>     * java.security.AccessController.doPrivileged(Native Method)
>     * java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>     * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:224)
>     * org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:197)
>     * java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>     * org.dcg.jwc.link.SecurePage.pageValidate(SecurePage.java:27)
>     * 
> org.apache.tapestry.AbstractPage.firePageValidate(AbstractPage.java:599)
>     * org.apache.tapestry.AbstractPage.validate(AbstractPage.java:374)
>     * 
> org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:729)
>     * 
> org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:717)
>     * org.dcg.webapp.supporting.Border.attemptLogin(Border.java:118)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org