Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
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: :




 
Sheriff
Posts: 3036
12
Mac IntelliJ IDE Python VI Editor Java
  • 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 !!
 
Ranch Hand
Posts: 227
Eclipse IDE Spring Java
  • 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)


 
author
Posts: 5856
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.
 
Ranch Hand
Posts: 122
Mac IntelliJ IDE Java
  • 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?



 
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic