• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts is not getting the action file. Throwing class not found exception - struts 1.3

 
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have made one simple application in which it will take values in one from and print that value in another jsp. but while clicking on submit button


HTTP Status 500 -

type Exception report

message

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

exception

javax.servlet.ServletException: java.lang.ClassNotFoundException: HtmlFromAction

root cause

java.lang.ClassNotFoundException: HtmlFromAction

note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server Platform Edition 9.0_01 logs.
Sun Java System Application Server Platform Edition 9.0_01
Sun Java System Application Server Platform Edition 9.0_01 - Error report



HtmlFormAction.class exists in WEB-INF\classes directory. and it code is as follows -



The code of other two jsps and struts-config.xml is as follows -
FirstCall.jsp - This file would be called at first



HtmlFormValues.jsp - The action would forward the control to this jsp at last



entries in struts-config.xml



Can somebody help me to resolve this problem ?
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check Action type in in struts-confige.xml.

<Action type="HtmlFromAction"> is this valid ?

please check the package structure.

 
Salil Vverma
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Ranveer,
Thanks for you reply but I have not put HtmlFromAction class in any of the package, it is directly inside WEB-INF\classes directory.
 
Salil Vverma
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Ranveer,

The issue is resolved now. What I noticed that if we keep the class files in default package it does not work and give the class not found exception. If we keep the class in a specific package and update the struts-config.xml to include the package name as well in type, it works fine.

Still it is not clear to me why, but I know that it's working fine for me now. Could you give your thoughts on it, if you have some idea?
 
reply
    Bookmark Topic Watch Topic
  • New Topic