You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael McGrady <mi...@michaelmcgrady.com> on 2004/05/28 15:52:24 UTC

Problems with Opera and Struts?

I have no difficulty running my site with Netscape or IE but Opera 
fails.  Here is the readout I get:

javax.servlet.ServletException
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause

java.lang.NullPointerException
com.crackwillow.struts.action.ForwardAction.execute(ForwardAction.java:30)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)



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


Re: Problems with Opera and Struts?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
Hi, Rick,

I am an Opera fan myself, but this problem ONLY occurs with Opera and not 
the other browsers.  I have posted some more details on this.  Take a look 
at my next posting and get the more mysterious details.  What do you think 
is up?

Michael McGrady

At 07:03 AM 5/28/2004, Rick Reumann wrote:
>Michael McGrady wrote:
>
>>I have no difficulty running my site with Netscape or IE but Opera fails.
>
>Can you provide any more information? I highly doubt this is an Opera 
>problem. I use Opera every day for my development and haven't run into a 
>single "J2EE" problem ( javascript/DHTML/css challenges.. sure .. but 
>that's not Opera's fault :)
>
>Are you spawning a new window maybe and trying to use a Session variable? 
>Different browsers handle the Session differently in child windows.
>
>--
>Rick
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problems with Opera and Struts?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
I am not spawning a new window, Rick, but it is a session variable problem 
as explained in prior emails.  It also is an intermittant 
problem.  Sometimes it happens, and sometimes it does not.  There is no 
apparent reason for the changes.  So, hacks to fix it are regarded by me as 
equally suspicious.  The intermittant problem does not occur with IE and 
Netscape.

Michael McGrady

At 07:03 AM 5/28/2004, Rick Reumann wrote:
>Michael McGrady wrote:
>
>>I have no difficulty running my site with Netscape or IE but Opera fails.
>
>Can you provide any more information? I highly doubt this is an Opera 
>problem. I use Opera every day for my development and haven't run into a 
>single "J2EE" problem ( javascript/DHTML/css challenges.. sure .. but 
>that's not Opera's fault :)
>
>Are you spawning a new window maybe and trying to use a Session variable? 
>Different browsers handle the Session differently in child windows.
>
>--
>Rick
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problems with Opera and Struts?

Posted by Rick Reumann <st...@reumann.net>.
Michael McGrady wrote:

> I have no difficulty running my site with Netscape or IE but Opera 
> fails.  

Can you provide any more information? I highly doubt this is an Opera 
problem. I use Opera every day for my development and haven't run into a 
single "J2EE" problem ( javascript/DHTML/css challenges.. sure .. but 
that's not Opera's fault :)

Are you spawning a new window maybe and trying to use a Session 
variable? Different browsers handle the Session differently in child 
windows.

-- 
Rick

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


Re: Problems with Opera and Struts?

Posted by Rick Reumann <st...@reumann.net>.
Michael McGrady wrote:

> java.lang.NullPointerException
> com.crackwillow.struts.action.ForwardAction.execute(ForwardAction.java:30)

Are you doing something funky in this custom Action? Why did you need to 
create your own ForwardAction?

-- 
Rick

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


Re: Problems with Opera, Struts and Session Management?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
Heh, Rick, I said it was impossible first.  I agree with everything you say 
and I know the computer is always right.  But, this is what I see and I 
have reported it accurately, I think.

Regarding what you did not know I meant.  I thought I explained it but I 
will try again, and try to do better.  I provide different look and feels 
to different clients.  They choose.  Thus, my urls are modified so that I 
can have a constant url in the struts-conf.xml under, e.g. "input" for the 
action mapping, and a variable one in the tiles.xml.  Thus, I have to have 
between the struts xml and the tiles xml readings a way of converting.  I 
do this with a Layout object that is spawned from the ServletContext and 
placed in the session on the index.jsp page.  This is the object that is 
showing null in Opera but is not null in IE or Netscape and I have checked 
to make sure that it is there.  This should not, I know, affect 
Opera.  But, these are the facts and all the facts I know.

The fact is I don't have trouble with IE and Netscape and I do with 
Opera.  Here is the code that Opera seems (in impossible terms) to conflict 
with and is in my index.jsp page which merely FORWARDS to  another page:

   session.setAttribute(SiteConstant.LAYOUT,session.getServletContext().getAttribute(SiteConstant.LAYOUT));

The FORWARD is <logic:forward name='<%= indexUrl %>'/> where String 
indexUrl = layout + "_index"; and where layout is presently hardcoded for 
these tests.  When the session gets to "indexUrl", with Opera sometimes the 
session does not have the default layout object in the session.  I can cure 
this in Opera by having the index.jsp FORWARD page contain the following code:


At 11:54 AM 5/28/2004, Rick Reumann wrote:
>Michael McGrady wrote:
>
>>No, this is not correct, Rick.  The null pointer is for the reference to 
>>the Layout object in the session, which in fact is there.  When I have 
>>the index page check to see if the object is there, Opera does not have a 
>>problem on OTHER pages.  Odd?  It is as if the placement of that object 
>>in the session does not happen with Opera unless you check that it has 
>>happened.  BUT THAT IS ABSURD.  Opera has no knowledge of any of this.  RIght?
>
>If you are sure you haven't changed some cookie settings and you aren't 
>spawning a new window, then my guess is there will be a way to duplicate 
>the exact same problem in IE/Netscape/Mozilla. I don't get what you mean by:
>
>"The null pointer is for the reference to
>the Layout object in the session, which in fact is there."
>
>The above would have nothing to do with a browser and is impossible, 
>unless you think you are refering to the same Session but you are not.
>
>In other words, you are setting something in Session scope and then later 
>on you do some stuff which somehow spawns a new Session.
>
>To say you are getting a null pointer for a reference to an object that 
>really is there in Session is impossible:) In other words if you do
>
>Object obj = session.getAttribute("someOjbect");
>
>and obj is null then there is no way "someObject" is refering to a handle 
>to an object in this session.
>
>--
>Rick
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problems with Opera, Struts and Session Management?

Posted by Rick Reumann <st...@reumann.net>.
Michael McGrady wrote:

> No, this is not correct, Rick.  The null pointer is for the reference to 
> the Layout object in the session, which in fact is there.  When I have 
> the index page check to see if the object is there, Opera does not have 
> a problem on OTHER pages.  Odd?  It is as if the placement of that 
> object in the session does not happen with Opera unless you check that 
> it has happened.  BUT THAT IS ABSURD.  Opera has no knowledge of any of 
> this.  RIght?

If you are sure you haven't changed some cookie settings and you aren't 
spawning a new window, then my guess is there will be a way to duplicate 
the exact same problem in IE/Netscape/Mozilla. I don't get what you mean 
by:

"The null pointer is for the reference to
the Layout object in the session, which in fact is there."

The above would have nothing to do with a browser and is impossible, 
unless you think you are refering to the same Session but you are not.

In other words, you are setting something in Session scope and then 
later on you do some stuff which somehow spawns a new Session.

To say you are getting a null pointer for a reference to an object that 
really is there in Session is impossible:) In other words if you do

Object obj = session.getAttribute("someOjbect");

and obj is null then there is no way "someObject" is refering to a 
handle to an object in this session.

-- 
Rick

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


Re: Problems with Opera, Struts and Session Management?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
No, this is not correct, Rick.  The null pointer is for the reference to 
the Layout object in the session, which in fact is there.  When I have the 
index page check to see if the object is there, Opera does not have a 
problem on OTHER pages.  Odd?  It is as if the placement of that object in 
the session does not happen with Opera unless you check that it has 
happened.  BUT THAT IS ABSURD.  Opera has no knowledge of any of this.  RIght?

Michael

At 07:50 AM 5/28/2004, Rick Reumann wrote:
>Michael McGrady wrote:
>
>>I probably should have added that in my ForwardAction I convert a path 
>>from the ActionMapping so that users can be allocated a particular look 
>>and feel that they have chosen on the website.  The line that is related 
>>to the Opera failure is:
>>     return new ActionForward(layout1.layout + "_" + path);
>>With Opera, the Layout object referenced as layout1 here is not set in 
>>the session on my index page.  This difficulty is overcome by putting 
>>code in to log that the Layout object has been put into the session.
>>That mystifies me.  Any demystification chiefs on this one?
>
>I'm still a bit confused. I'm guessing the NPE is coming from not being 
>able to find the forward created by the layout1.layout + "_" + path 
>section? Setting it up like:
>
>String forwardName = layout1.layout + "_" + path;
>log.debug( forwardname );
>return new ActionForward( forwardName );
>
>I'd be curious if that forwardName looks the same under all situations? 
>Are you sure you are following the exact same steps for each browser after 
>bouning the server? In otherwords, maybe you aren't getting the NPE on 
>netscape/IE because you are having layout1.layout set into Session scope 
>at some other point that you aren't doing when testing with Opera? Using 
>Session vars for this seems a bit odd anyway. Could you avoid using 
>layout1.layout as Session attribute?
>
>
>--
>Rick
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problems with Opera, Struts and Session Management?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
This is an excellent suggestion.  I tried hard coding the value that 
layout1.layout should be giving and everything worked.  I also tried 
testing to see if layout1 was null, and it was.  Since layout1.layout is a 
value I want to use throughout the session, always, and is a value that is 
only used in the session, it seems that the session is the proper place to 
put this value.  I am setting the value of the default layout in 
application scope with a plugin.  Then, I am putting that value into a 
session Layout when people come on board.  They can then choose their own 
layout later, or their "host" can have prefigured the Layout for them.  The 
same site has multiple hosts with their own "guests".

Michael

At 07:50 AM 5/28/2004, Rick Reumann wrote:
>Michael McGrady wrote:
>
>>I probably should have added that in my ForwardAction I convert a path 
>>from the ActionMapping so that users can be allocated a particular look 
>>and feel that they have chosen on the website.  The line that is related 
>>to the Opera failure is:
>>     return new ActionForward(layout1.layout + "_" + path);
>>With Opera, the Layout object referenced as layout1 here is not set in 
>>the session on my index page.  This difficulty is overcome by putting 
>>code in to log that the Layout object has been put into the session.
>>That mystifies me.  Any demystification chiefs on this one?
>
>I'm still a bit confused. I'm guessing the NPE is coming from not being 
>able to find the forward created by the layout1.layout + "_" + path 
>section? Setting it up like:
>
>String forwardName = layout1.layout + "_" + path;
>log.debug( forwardname );
>return new ActionForward( forwardName );
>
>I'd be curious if that forwardName looks the same under all situations? 
>Are you sure you are following the exact same steps for each browser after 
>bouning the server? In otherwords, maybe you aren't getting the NPE on 
>netscape/IE because you are having layout1.layout set into Session scope 
>at some other point that you aren't doing when testing with Opera? Using 
>Session vars for this seems a bit odd anyway. Could you avoid using 
>layout1.layout as Session attribute?
>
>
>--
>Rick
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problems with Opera, Struts and Session Management?

Posted by Rick Reumann <st...@reumann.net>.
Michael McGrady wrote:

> I probably should have added that in my ForwardAction I convert a path 
> from the ActionMapping so that users can be allocated a particular look 
> and feel that they have chosen on the website.  The line that is related 
> to the Opera failure is:
> 
>     return new ActionForward(layout1.layout + "_" + path);
> 
> With Opera, the Layout object referenced as layout1 here is not set in 
> the session on my index page.  This difficulty is overcome by putting 
> code in to log that the Layout object has been put into the session.  
> That mystifies me.  Any demystification chiefs on this one?

I'm still a bit confused. I'm guessing the NPE is coming from not being 
able to find the forward created by the layout1.layout + "_" + path 
section? Setting it up like:

String forwardName = layout1.layout + "_" + path;
log.debug( forwardname );
return new ActionForward( forwardName );

I'd be curious if that forwardName looks the same under all situations? 
Are you sure you are following the exact same steps for each browser 
after bouning the server? In otherwords, maybe you aren't getting the 
NPE on netscape/IE because you are having layout1.layout set into 
Session scope at some other point that you aren't doing when testing 
with Opera? Using Session vars for this seems a bit odd anyway. Could 
you avoid using layout1.layout as Session attribute?


-- 
Rick

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


Re: Problems with Opera, Struts and Session Management?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
I probably should have added that in my ForwardAction I convert a path from 
the ActionMapping so that users can be allocated a particular look and feel 
that they have chosen on the website.  The line that is related to the 
Opera failure is:

     return new ActionForward(layout1.layout + "_" + path);

With Opera, the Layout object referenced as layout1 here is not set in the 
session on my index page.  This difficulty is overcome by putting code in 
to log that the Layout object has been put into the session.  That 
mystifies me.  Any demystification chiefs on this one?

Michael McGrady




At 06:52 AM 5/28/2004, Michael McGrady wrote:
>I have no difficulty running my site with Netscape or IE but Opera 
>fails.  Here is the readout I get:
>
>javax.servlet.ServletException
>org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
>org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>root cause
>
>java.lang.NullPointerException
>com.crackwillow.struts.action.ForwardAction.execute(ForwardAction.java:30)
>org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>