• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Getting Http 404 Error while running Strut Application

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

I am getting Http Status 404 error while executing strut application (Inventory).

Following is struts-config.xml.

struts-config.xml



index.jsp




Could any one please help me what is problem in above.

Thanks in Advance.



 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Were there any deployment errors in the application?? Did you configure struts in web.xml?? Is there a jsp named product.jsp in the root folder of your application?? Is there a class TestProduct.struts.ProductListAction in your application??
 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ankit,

Thanks for Reply. While running application GlassFish V2 gave following Exception. But i think that is related to Validation Framework and that should not be the cause of not even loading the application. (Loading even starting Page).

WebModule[/Inventory]PWC1396: Servlet /Inventory threw load() exception
javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:172)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:254)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1178)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1007)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4808)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5196)
at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58)
at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:304)
at com.sun.appserv.management.util.misc.RunnableBase.run(RunnableBase.java:341)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
WEB0207: Error starting web context StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[/Inventory] on virtual server server
LifecycleException: javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4818)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5196)
at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58)
at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:304)
at com.sun.appserv.management.util.misc.RunnableBase.run(RunnableBase.java:341)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)


Following is the struts-config.xml entry in web.xml




Follwing the product.jsp under /WEB-INF folder.




But currently TestProduct.struts.ProductListAction is not there But that should not cause problem of even not displaying first jsp page itself.

Thanks in Advance.
 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ankit,

I commented out snippet for /ProductList action in the strut-config.xml in. But in vain.

Thanks.
 
Ankit Garg
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please show the complete declaration of struts servlet in web.xml i.e. the <servlet> and <servlet-mapping> tag used to declare struts in web.xml. Also are there files named validator-rules.xml and validation.xml in WEB-INF directory??
 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ankit,

Below is the code for web.xml




And Yes, there are files validator-rules.xml and validation.xml under WEB-INF folder.
 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ankit,

Last when i ran the application i got following error.(in bold)


Error occurred during application loading phase. The application will not run properly. Please fix your application and redeploy. WARNING: com.sun.enterprise.deployment.backend.IASDeploymentException: ContainerBase.addChild: start: LifecycleException: javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml' run-deploy: Browsing: http://localhost:14521/Inventory/ run-display-browser:


Could you let me know what went wrong here other than validator framework. Moreover i have change form bean extending to ActionForm instead of ValidatorForm.
 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Now i'm getting HTTP Status 500 and getting following exception on the display page.

exception javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot retrieve definition for form bean null on action /Product root cause javax.servlet.jsp.JspException: Cannot retrieve definition for form bean null on action /Product.


Do not know where the error lies or what is going wrong?

Please Help on this.
 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Everyone!!! The problem got resolved. I change /Add action to /Product in struts-config.xml and issue got resolved.
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic