struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <davelnew...@gmail.com>
Subject Re: cant list data with hibernate struts
Date Wed, 14 Mar 2012 23:55:15 GMT
Do all those classes in your config exist? Are they really all in the
default package?

Dave

On Wed, Mar 14, 2012 at 7:43 PM, Oussama Jlassi <oussamaj@live.fr> wrote:

>
> i use struts1.3 hibernate4 in tomcat6 i want to list data after the form
> but when i run localhost:8080/strutsh i get
> Etat HTTP 500 -type Rapport d'exceptionmessagedescription Le serveur a
> rencontré une erreur interne () qui l'a empêché de satisfaire la
> requête.exceptionorg.apache.jasper.JasperException:
> java.lang.NullPointerException: Module 'null' not found.
>
>  org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)
>
>  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
>
>  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> cause mèrejava.lang.NullPointerException: Module 'null' not found.
>        org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
>        org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735)
>        org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)
>        org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)
>
>  org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:173)
>        org.apache.jsp.index_jsp._jspService(index_jsp.java:94)
>        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
>  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
>
>  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> note La trace complète de la cause mère de cette erreur est disponible
> dans les fichiers journaux de Apache Tomcat/6.0.35.Apache Tomcat/6.0.35
>
> index.jsp
>
> <%@ page language="java" pageEncoding="ISO-8859-1"%><%@ taglib uri="
> http://struts.apache.org/tags-html" prefix="html" %><%@ taglib uri="
> http://struts.apache.org/tags-logic" prefix="logic" %><%@ taglib uri="
> http://struts.apache.org/tags-bean" prefix="bean" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html:html>    <head>        <meta http-equiv="Content-Type"
> content="text/html; charset=UTF-8">        <title>JSP Page</title>
>  </head>    <body>           <html:form action="/hib">            id
:
> <html:text name="HibForm" property="id" /> <br>            tt : <html:text
> name="HibForm" property="tt" /> <br>             t  : <html:text
> name="HibForm" property="t" /> <br>            <html:submit />
>  </html:form>      <br/>
> <logic:iterate name="list" id="test"><p><bean:write name="test"
> property="id"/></p></logic:iterate>    </body></html:html>
>
> HibAction.java
> import javax.servlet.http.HttpServletRequest;import
> javax.servlet.http.HttpServletResponse;import javax.servlet.ServletContext;
> import org.apache.struts.action.Action;import
> org.apache.struts.action.ActionForm;import
> org.apache.struts.action.ActionForward;import
> org.apache.struts.action.ActionMapping;import
> org.hibernate.SessionFactory;import org.hibernate.*;import
> org.hibernate.Session;import java.util.*;
> public class HibAction extends Action {
> private List list;
>        public ActionForward execute(           ActionMapping mapping,
>      ActionForm form,                HttpServletRequest request,
>   HttpServletResponse response) throws Exception{
>                HibForm formObj = (HibForm)form;
>                /*Get the servlet context */            ServletContext
> context = request.getSession().getServletContext();
>                /*Retrieve Session Factory */           SessionFactory
> factory = (SessionFactory)
>  context.getAttribute(HibernatePlugIn.SESSION_FACTORY_KEY);
>                /*Open Hibernate Session */             Session session
> =factory.openSession();try {
>                        test t = new test();
>  t.setId(formObj.getId());                       t.setT(formObj.getT());
>                       t.setTt(formObj.getTt());
>                        session.beginTransaction();
> session.save(t);
>                        Query query=session.createQuery("SELECT t FROM test
> t");                        //ArrayList list=(ArrayList)query.list();
>                                           list=query.list();
>          session.getTransaction().commit();
>  //request.getSession().setAttribute("list",list);
>  } catch(Exception e) {
>  session.getTransaction().rollback(); }           /*Close session */
>        session.close();
>                return mapping.findForward("success");  }
> public List getList() {         return list;    }public void setList(List
> list) {               this.list = list;       }
> }
> struts-config.xml
> <?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE struts-config PUBLIC
>          "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
>          "http://struts.apache.org/struts/dtds/struts-config_1_3.dtd">
>
> <struts-config>
>        <form-beans>            <form-bean name="HibForm" type="HibForm" />
>     </form-beans>
>        <action-mappings>               <action path="/hib"
> type="HibAction" name="HibForm" input="index.jsp">
>  <forward name="success" path="/index.jsp" />            </action>
>        <action path="/hib1" type="Hib1Action">
>  <forward name="success" path="/list.jsp" />             </action><plug-in
> className="HibernatePlugIn"></plug-in></struts-config>
> and i have jsp with the name list without the form when i run
> localhost:8080/strutsh/hib1.do i get
> Etat HTTP 404 - Servlet action n'est pas disponible.type Rapport
> d'étatmessage Servlet action n'est pas disponible.description La ressource
> demandée (Servlet action n'est pas disponible.) n'est pas disponible.Apache
> Tomcat/6.0.35
>
>
> tomcat log
>
> mars 15, 2012 12:39:36 AM org.apache.catalina.core.ApplicationContext
> logInfos: La servlet action est marqué comme indisponiblemars 15, 2012
> 12:39:36 AM org.apache.catalina.core.StandardContext loadOnStartupGrave: La
> servlet /strutsh a généré une exception
> "load()"javax.servlet.UnavailableException: Parsing error processing
> resource path jndi:/localhost/strutsh/WEB-INF/struts-config.xml   at
> org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:761)
> at
> org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:744)
> at
> org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:689)
>      at org.apache.struts.action.ActionServlet.init(ActionServlet.java:356)
>  at javax.servlet.GenericServlet.init(GenericServlet.java:212)   at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
>      at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
>   at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
>    at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
>  at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
>      at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
>  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
>      at
> org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
> at
> org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
>       at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
>   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
> at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
>   at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
>      at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
>  at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)   at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
>  at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
>       at
> org.apache.catalina.core.StandardService.start(StandardService.java:525)
>   at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
>       at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)      at
> java.lang.reflect.Method.invoke(Unknown Source)      at
> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)      at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
> mars 15, 2012 12:39:38 AM org.apache.catalina.core.StandardWrapperValve
> invokeGrave: "Servlet.service()" pour la servlet jsp a généré une
> exceptionjava.lang.NullPointerException: Module 'null' not found.     at
> org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755) at
> org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735) at
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)       at
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)   at
> org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:173)
>  at org.apache.jsp.index_jsp._jspService(index_jsp.java:94)      at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)   at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
>      at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>    at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>    at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
>   at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
>     at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>  at java.lang.Thread.run(Unknown Source)
> mars 15, 2012 12:40:18 AM org.apache.catalina.core.StandardWrapperValve
> invokeGrave: "Servlet.service()" pour la servlet jsp a généré une
> exceptionjava.lang.NullPointerException: Module 'null' not found.     at
> org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755) at
> org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735) at
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)       at
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)   at
> org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:173)
>  at org.apache.jsp.index_jsp._jspService(index_jsp.java:94)      at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)   at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
>      at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>    at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>    at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
>   at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
>     at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>  at java.lang.Thread.run(Unknown Source)
> mars 15, 2012 12:40:46 AM org.apache.catalina.core.StandardWrapperValve
> invokeInfos: La servlet action est actuellement indisponiblemars 15, 2012
> 12:42:16 AM org.apache.catalina.core.StandardWrapperValve invokeInfos: La
> servlet action est actuellement indisponiblemars 15, 2012 12:42:22 AM
> org.apache.catalina.core.StandardWrapperValve invokeGrave:
> "Servlet.service()" pour la servlet jsp a généré une
> exceptionjava.lang.NullPointerException: Module 'null' not found.     at
> org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755) at
> org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735) at
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)       at
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)   at
> org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:173)
>  at org.apache.jsp.index_jsp._jspService(index_jsp.java:94)      at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)   at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
>      at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>    at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>    at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
>   at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
>     at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>  at java.lang.Thread.run(Unknown Source)
> mars 15, 2012 12:42:24 AM org.apache.catalina.core.StandardWrapperValve
> invokeGrave: "Servlet.service()" pour la servlet jsp a généré une
> exceptionjava.lang.NullPointerException: Module 'null' not found.     at
> org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755) at
> org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735) at
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)       at
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)   at
> org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:173)
>  at org.apache.jsp.index_jsp._jspService(index_jsp.java:94)      at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)   at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
>      at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>    at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>    at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
>   at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
>     at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>  at java.lang.Thread.run(Unknown Source)
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message