Re: Catching: Unable to instantiate Action

2009-11-13 Thread Greg Lindholm
I haven't been following this thread so if my answer doesn't help... sorry.

I have configured a default Action setup to catch all unknown actions.

The default-action-ref tag [1] sets the action to use when the requested
action isn't found.



  
  Login


I use a restricted interceptor stack since all I'm going to do is log it and
redirect to the login action.
  


  

Your other option would be to configure a wildcard default [2]


  /Unknown.jsp



[1]
http://struts.apache.org/2.x/docs/action-configuration.html#ActionConfiguration-ActionDefault

[2]
http://struts.apache.org/2.x/docs/action-configuration.html#ActionConfiguration-WildcardDefault

On Fri, Nov 13, 2009 at 5:51 AM, RogerV  wrote:

>
>
>
> Brian Thompson-5 wrote:
> >
> > I can only speculate, but it seems logical that the
> ClassNotFoundException
> > is being thrown from outside the purview of Struts, in Tomcat's
> > ClassLoaders
> > - thus the Struts exception mapping never enters into it.
> >
>
> Theres definitely something odd going on. With global mappings disabled and
> devmode set to true, entering an invalid action into the browser gives the
> Struts formatted "No Action Mapped" exception (it's not
> ClassNotFoundException"). With global mappings and devmode set to false,
> entering an invalid action give the Tomcat 404 page with the no Action
> Mapped message. With global mappings set to catch java.lang.exception and
> devmode set to false, Struts seems to catch every exception thrown except
> when an invalid action is keyed into the browser.
>
> The fact that both the error message texts talk about "No Action Mapped"
> must surely mean that the error is being caught by Struts as Action Mapping
> is a Struts concept, not a Tomcat concept. I would have thought that
> catching in Invalid Action was one of the messages you would most want to
> catch to stop unfriendly users "experimenting" with your application!
>
> Regards
>
> --
> View this message in context:
> http://old.nabble.com/Re%3A-Catching%3A-Unable-to-instantiate-Action-tp26303352p26334735.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Catching: Unable to instantiate Action

2009-11-13 Thread RogerV



Brian Thompson-5 wrote:
> 
> I can only speculate, but it seems logical that the ClassNotFoundException
> is being thrown from outside the purview of Struts, in Tomcat's
> ClassLoaders
> - thus the Struts exception mapping never enters into it.
> 

Theres definitely something odd going on. With global mappings disabled and
devmode set to true, entering an invalid action into the browser gives the
Struts formatted "No Action Mapped" exception (it's not
ClassNotFoundException"). With global mappings and devmode set to false,
entering an invalid action give the Tomcat 404 page with the no Action
Mapped message. With global mappings set to catch java.lang.exception and
devmode set to false, Struts seems to catch every exception thrown except
when an invalid action is keyed into the browser.

The fact that both the error message texts talk about "No Action Mapped"
must surely mean that the error is being caught by Struts as Action Mapping
is a Struts concept, not a Tomcat concept. I would have thought that
catching in Invalid Action was one of the messages you would most want to
catch to stop unfriendly users "experimenting" with your application!

Regards

-- 
View this message in context: 
http://old.nabble.com/Re%3A-Catching%3A-Unable-to-instantiate-Action-tp26303352p26334735.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Catching: Unable to instantiate Action

2009-11-12 Thread Brian Thompson
I can only speculate, but it seems logical that the ClassNotFoundException
is being thrown from outside the purview of Struts, in Tomcat's ClassLoaders
- thus the Struts exception mapping never enters into it.

My only suggestion for dealing with this is to configure your actions
explicitly rather than using wildcards in your struts config.  (sorry, I'm
sure that's a LOT of work...)

Also - if you find another way around it, I'm also interested in reading
about it.

-Brian



On Thu, Nov 12, 2009 at 4:13 PM, Roger  wrote:

> On Thursday 12 November 2009 12:35:25 Gustavo Felisberto wrote:
> > My toughts also. But in any case I tested and it did not help.
> >
> > If you find a solution please drop it here.
> >
> > Gustavo
> >
> Will do, but I've had even less response to my query than you.
>
> Regards
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Catching: Unable to instantiate Action

2009-11-12 Thread Roger
On Thursday 12 November 2009 12:35:25 Gustavo Felisberto wrote:
> My toughts also. But in any case I tested and it did not help.
> 
> If you find a solution please drop it here.
> 
> Gustavo
> 
Will do, but I've had even less response to my query than you.

Regards

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



RE: Catching: Unable to instantiate Action

2009-11-12 Thread Gustavo Felisberto
My toughts also. But in any case I tested and it did not help.

If you find a solution please drop it here.

Gustavo

-Mensagem original-
De: Roger [mailto:roger.var...@googlemail.com] 
Enviada: quarta-feira, 11 de Novembro de 2009 21:02
Para: Struts Users Mailing List
Assunto: Re: Catching: Unable to instantiate Action

On Wednesday 11 November 2009 17:34:49 Oscar wrote:
> Maybe using a exception mapping for java.lang.ClassNotFoundException
> 

This sounds like the same problem that I'm having, Why would mapping 
ClssNotFoundException help? It's a sub-class of java.lang.Exception and 
mapping that should catch everything - yes?

Regards


> 2009/11/11 Gustavo Felisberto 
> 
> > I have a Project were we have in struts.xml:
> >
> >
> >
> > 
> >
> >/WEB-INF/plugins/{1}/{2}.jsp
> >
> > 
> >
> >
> >
> > 
> >
> >  
> >
> > 
> >
> >
> >
> > 
> >
> >  /WEB-INF/Error.jsp
> >
> > 
> >
> >
> >
> > If any exception is thrown in my actions the global maping catches it
and
> > sends to correct JSP. If user enters some Url where the Class exists but
> > the
> > method does not the exception mapping works ok. Problem is if the Class
> > does
> > not exist. In that case I get a struts error page (if debug mod is on)
or
> > a tomcat error page. Any way to catch this exception?
> >
> >
> >
> > --
> >
> > Gustavo Felisberto.
> >
> > WIT-Software, Lda
> >
> > Coimbra (Portugal), San Jose (California)
> >
> > Phone: +351239801030
> >
> > Web:  <http://www.wit-software.com> http://www.wit-software.com
> 

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




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



Re: Catching: Unable to instantiate Action

2009-11-11 Thread Roger
On Wednesday 11 November 2009 17:34:49 Oscar wrote:
> Maybe using a exception mapping for java.lang.ClassNotFoundException
> 

This sounds like the same problem that I'm having, Why would mapping 
ClssNotFoundException help? It's a sub-class of java.lang.Exception and 
mapping that should catch everything - yes?

Regards


> 2009/11/11 Gustavo Felisberto 
> 
> > I have a Project were we have in struts.xml:
> >
> >
> >
> > 
> >
> >/WEB-INF/plugins/{1}/{2}.jsp
> >
> > 
> >
> >
> >
> > 
> >
> >  
> >
> > 
> >
> >
> >
> > 
> >
> >  /WEB-INF/Error.jsp
> >
> > 
> >
> >
> >
> > If any exception is thrown in my actions the global maping catches it and
> > sends to correct JSP. If user enters some Url where the Class exists but
> > the
> > method does not the exception mapping works ok. Problem is if the Class
> > does
> > not exist. In that case I get a struts error page (if debug mod is on) or
> > a tomcat error page. Any way to catch this exception?
> >
> >
> >
> > --
> >
> > Gustavo Felisberto.
> >
> > WIT-Software, Lda
> >
> > Coimbra (Portugal), San Jose (California)
> >
> > Phone: +351239801030
> >
> > Web:   http://www.wit-software.com
> 

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



Re: Catching: Unable to instantiate Action

2009-11-11 Thread Oscar
Maybe using a exception mapping for java.lang.ClassNotFoundException

2009/11/11 Gustavo Felisberto 

> I have a Project were we have in struts.xml:
>
>
>
> 
>
>/WEB-INF/plugins/{1}/{2}.jsp
>
> 
>
>
>
> 
>
>  
>
> 
>
>
>
> 
>
>  /WEB-INF/Error.jsp
>
> 
>
>
>
> If any exception is thrown in my actions the global maping catches it and
> sends to correct JSP. If user enters some Url where the Class exists but
> the
> method does not the exception mapping works ok. Problem is if the Class
> does
> not exist. In that case I get a struts error page (if debug mod is on) or a
> tomcat error page. Any way to catch this exception?
>
>
>
> --
>
> Gustavo Felisberto.
>
> WIT-Software, Lda
>
> Coimbra (Portugal), San Jose (California)
>
> Phone: +351239801030
>
> Web:   http://www.wit-software.com
>
>
>
>


-- 
Oscar