Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Yolanda Zheng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 227
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use the code tags instead of colors, makes the posts much easier to read. I fixed the post for you.
 
Jesus Mireles
Ranch Hand
Posts: 122
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yolanda,

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



Shouldnt that file be coming from basedir?



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic