• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

The import org.apache.struts cannot be resolved (ActionForm cannot be resolved to a type)

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.. When I run my web application from Eclipse, I get the above error. (But I have all library/.jar files needed, including struts.jar in my 'Web App Libraries' of Eclipse). Not sure what exactly is the problem.

I get exception the org.apache.jasper.JasperException: Exception in JSP: /loginPage.jsp:48

48: <html:form action="/login" type="inputforms.org.gov.csr.form.LoginForm" name="LoginForm" onsubmit="return loginvalidation(this);" scope="request">

and the below as root cause

root cause

javax.servlet.ServletException: Unresolved compilation problems:
The import org.apache.struts cannot be resolved
ActionForm cannot be resolved to a type

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.loginPage_jsp._jspService(loginPage_jsp.java:523)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
inputforms.org.gov.csr.bd.LoginFilter.doFilter(LoginFilter.java:81)


root cause

java.lang.Error: Unresolved compilation problems:
The import org.apache.struts cannot be resolved
ActionForm cannot be resolved to a type

inputforms.org.gov.csr.form.LoginForm.<init>(LoginForm.java:3)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)
org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:542)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:520)
org.apache.jsp.loginPage_jsp._jspService(loginPage_jsp.java:138)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
inputforms.org.gov.csr.bd.LoginFilter.doFilter(LoginFilter.java:81)

(JRE - 1.5 Tomcat - 5.5) All the needed class files are in place.. Any help around this would be grateful. Thanks!
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rakesh Rajmohan wrote:I get exception the org.apache.jasper.JasperException: Exception in JSP: /loginPage.jsp:48
48: <html:form action="/login" type="inputforms.org.gov.csr.form.LoginForm" name="LoginForm" onsubmit="return loginvalidation(this);" scope="request">


I'm afraid there is some property called "type" in html:form tag. Also html:form takes its bean form the action mapping, no need to defined "type".

HTH
 
Rakesh Rajmohan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.. This is my include directive..

<%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>

Also the type mapping is for my actionForm and not for my action whose mapping is available in action mapping.

The important thing is, the same projects runs in other machine, but not in mine..

Not sure whats going wrong
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
*Something* is probably wrong with your deployment--for whatever reason the class isn't being found.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rakesh Rajmohan wrote:Hello.. This is my include directive..
<%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>



I didn't ask this, I pointed out the absence of "type" attribute in html:form tag, see the link I posted earlier.

Rakesh Rajmohan wrote:Also the type mapping is for my actionForm and not for my action whose mapping is available in action mapping.


Geerally, the html:form has an action whose "mapping" is given in struts-config.xml with associated Action Form "name". In you canse the entry for same action will be like this;



Rakesh Rajmohan wrote:The important thing is, the same projects runs in other machine, but not in mine..


I'm really clueless about this things
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic