You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Lee Clemens <le...@leeclemens.net> on 2010/01/10 20:44:21 UTC

action fails when precompiled in war file

I believe I have found an issue when the web.xml's welcome-file is a JSP,
which uses an action tag. And that JSP is pre-compiled/packed in a WAR file.
(This does not occur if deployed from a directory, but does occur if
deployed from an unpacked WAR or not-unpacked WAR file).


Tested on Tomcat 6.0.20/Windows and Tomcat 6.0.20/Linux using AJP/mod_jk
AJP13).

Tried with and without namespace="/" name="/" action dispatcher with same
results.

welcome-file defined in web.xml is "/home.jsp"

JSPs are largely contained in /WEB-INF/jsp/* and pre-compiled.
No JSP files are included in WAR file

home.jsp is pre-compiled to WEB-INF/classes/org/apache/jsp/home_jsp.class
(in the WAR file).

An action ("/<path>/Login"), when accessed directly, works fine!

However, when "/<path>/" is accessed from WAR file (unpacked or not), I
receive this error:

WARN ajp-127.0.0.1-80-4 org.apache.struts2.dispatcher.Dispatcher - Could not
find action or result
 There is no Action mapped for namespace / and action name . - [unknown
location]
        at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1
78)
        at
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
        at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsAct
ionProxyFactory.java:39)
        at
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultA
ctionProxyFactory.java:47)
        at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
        at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.jav
a:395)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va: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.valves.AccessLogValve.invoke(AccessLogValve.java:567)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at
org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:427)
        at
org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProt
ocol.java:384)
        at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)
        at java.lang.Thread.run(Thread.java:619)




If /home.jsp is added to the WAR file (uncompiled), it works properly.

I have tested this without mod_jk (Apache Httpd) which is what I thought the
original issue was from (previous post to Struts-Users).

However, testing on only Tomcat proves that the simple addition of /home.jsp
to the WAR file solves this issue - although /home.jsp has been pre-compiled
properly.

This may also be worth noting, home.jsp contains an <s:action name="xx"
executeResult="true"/> tag, which works properly when running from Directory
or from WAR file which contains the uncompiled "/home.jsp".


If this is a bug, I will happily report it; I'm just not 100% certain if it
is a Tomcat issue or Struts/xwork (stack trace suggests xwork, but Struts
could be relying on Tomcat/Jasper compilation...)




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