aspose file tools*
The moose likes Struts and the fly likes War file created by Ant is not working with an exception cannot find global ActionForward for name * Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "War file created by Ant is not working with an exception cannot find global ActionForward for name *" Watch "War file created by Ant is not working with an exception cannot find global ActionForward for name *" New topic
Author

War file created by Ant is not working with an exception cannot find global ActionForward for name *

Yolanda Zheng
Greenhorn

Joined: Dec 20, 2010
Posts: 3
Can anyone help??? I got the war file created by Ant, and manually deployed it on a server, but when I tested it, an error message occurs:
However, the war file I created through MyEclipse File-->Export-->war file works with no error message.
Anyone know it is because of the wrong struts config or ant??

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find global ActionForward for name loginPage
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find global ActionForward for name loginPage
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.jsp.index_jsp._jspService(index_jsp.java:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)




my build.xml file is as below:



The structure of my web application:
RRAdmin
|-- src
|--WebRoot
| |--form
| |--jsp
| |--META-INF
| |--WEB-INF
| | |--lib
| | |--struts-config.xml
| | |-- web.xml - deployment descriptor
|--build.xml



The structure of the War file created by ant: :




Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

Hi Yolanda, welcome to JavaRanch!

I think your Ant build is probably fine, and the problem is with your Struts configuration. I'm going to move this thread into our Struts forum, where I'm sure someone will be able to help you with that.
Yolanda Zheng
Greenhorn

Joined: Dec 20, 2010
Posts: 3
Greg Charles wrote:Hi Yolanda, welcome to JavaRanch!

I think your Ant build is probably fine, and the problem is with your Struts configuration. I'm going to move this thread into our Struts forum, where I'm sure someone will be able to help you with that.


Thank you Greg Charles !!
Aditya Jha
Ranch Hand

Joined: Aug 25, 2003
Posts: 227

Seems like you're sending user to <your-web-site>/loginPage.do or similar, and you don't have any 'global forward' defined with the name 'loginPage' in your Struts config. If you can post your struts config and the URL for which you get this error, the folks would be able to help you.
Yolanda Zheng
Greenhorn

Joined: Dec 20, 2010
Posts: 3
Aditya Jha wrote:Seems like you're sending user to <your-web-site>/loginPage.do or similar, and you don't have any 'global forward' defined with the name 'loginPage' in your Struts config. If you can post your struts config and the URL for which you get this error, the folks would be able to help you.


I defined the global forward for userLogin.jsp and the URL is: http://localhost:8080/RRAdmin/
The war file I created through MyEclipse File-->Export-->war file works with no error message, but the war file created by Ant got this issue.
I am wondering is it because a .jar file missing when i compile the project.

struts config:


index.jsp page


When I used http://10.0.0.201:8080/RRAdmin/jsp/index.jsp, it caused the same error:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find global ActionForward for name loginPage
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find global ActionForward for name loginPage
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.jsp.index_jsp._jspService(index_jsp.java:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

javax.servlet.jsp.JspException: Cannot find global ActionForward for name loginPage
org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:92)
org.apache.jsp.jsp.index_jsp._jspx_meth_logic_005fforward_005f0(index_jsp.java:168)
org.apache.jsp.jsp.index_jsp._jspx_meth_html_005fhtml_005f0(index_jsp.java:123)
org.apache.jsp.jsp.index_jsp._jspService(index_jsp.java:72)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Please use the code tags instead of colors, makes the posts much easier to read. I fixed the post for you.


JBoss In Action
Jesus Mireles
Ranch Hand

Joined: Mar 10, 2010
Posts: 122

Yolanda,

Did you check to see if your web.xml is being picked up correctly?



Shouldnt that file be coming from basedir?



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: War file created by Ant is not working with an exception cannot find global ActionForward for name *
 
Similar Threads
/build.xml:372: java.net.UnknownHostException: root +ant
unable to create War using Ant
exception wile running build.xml
Fatal Error: Unable to find package java.lang in classpath or bootclasspath
problem in making jar and war based on the 'src' package hierarchy!