IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Struts 1 Java Discussion :

Module 'null' not found


Sujet :

Struts 1 Java

  1. #1
    Membre du Club
    Inscrit en
    Décembre 2005
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Décembre 2005
    Messages : 74
    Points : 48
    Points
    48
    Par défaut Module 'null' not found
    Bonjour,

    je viens d'essayer de me mettre à struts avec un petit exemple tout simple.
    Cependant, j'ai une erreur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    exception 
     
    org.apache.jasper.JasperException: Module 'null' not found.
    	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     
     
    cause mère 
     
    java.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:796)
    	org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:467)
    	org.apache.jsp.NouveauEnduro_jsp._jspx_meth_html_005fform_005f0(NouveauEnduro_jsp.java:132)
    	org.apache.jsp.NouveauEnduro_jsp._jspx_meth_html_005fhtml_005f0(NouveauEnduro_jsp.java:106)
    	org.apache.jsp.NouveauEnduro_jsp._jspService(NouveauEnduro_jsp.java:73)
    	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    Mon fichier web.xml est le suivant:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
     <display-name>EnduroWeb</display-name>
     <servlet>
      <display-name>Menu</display-name>
      <servlet-name>Menu</servlet-name>
      <servlet-class>com.enduro.web.Menu</servlet-class>
     </servlet>
     <servlet>
      <display-name>Application</display-name>
      <servlet-name>Application</servlet-name>
      <servlet-class>com.enduro.web.Application</servlet-class>
     </servlet>
     <servlet>
      <servlet-name>action</servlet-name>
      <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
      <init-param>
       <param-name>config</param-name>
       <param-value>/WEB-INF/struts-config.xml</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
     </servlet>
     <servlet-mapping>
      <servlet-name>Menu</servlet-name>
      <url-pattern>/Menu</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
      <servlet-name>Application</servlet-name>
      <url-pattern>/Application</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>*.do</url-pattern>
     </servlet-mapping>
     <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
     </welcome-file-list>
     <jsp-config>
      <taglib>
       <taglib-uri>/WEB-INF/struts-bean</taglib-uri>
       <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
       <taglib-uri>/WEB-INF/struts-logic</taglib-uri>
       <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
      <taglib>
       <taglib-uri>/WEB-INF/struts-html</taglib-uri>
       <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
     </jsp-config>
     <login-config>
      <auth-method>BASIC</auth-method>
     </login-config>
    </web-app>
    Mon fichier struts-config.xml

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
                                   "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
     <data-sources/>
     <form-beans id="GetEnduroForm" type="GetEnduroForm">
      <form-bean name="GetEnduroForm" type="GetEnduroForm"/>
     </form-beans>
     <global-exceptions/>
     <global-forwards>
      <forward name="GetEnduro" path="/NouveauEnduro.jsp"/>
     </global-forwards>
     <action-mappings>
      <action name="GetEnduroForm" path="/NouveauEnduro" scope="request" type="NouveauEnduroAction">
       <forward name="index" path="/index.jsp"/>
      </action>
     </action-mappings>
     <controller/>
    </struts-config>

    ma jsp NouveauEnduro.jsp:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    <%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
    <html:html>
    <head>
    	<title></title>
    </head>
    <body>
        <html:form action="/NouveauEnduro.do">
        Titre: 
        <html:text property="" /><br/>
        Date: <html:text property="" /> au <html:text property="" /><br/>
        Poids
    <html:select property="">
     
    <html:option value="kg">
    	kg
    </html:option>
    <html:option value="lbs">
    	lbs
    </html:option>
    </html:select><br/>.
    <html:submit value="">
     
    </html:submit>
    </html:form>
    </body>
    </html:html>
    ma form GetEnduroForm :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    import javax.servlet.http.HttpServletRequest;
     
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionMapping;
    import java.lang.String;
    import java.util.Date;
     
    public class GetEnduroForm extends org.apache.struts.action.ActionForm {
     
    	private String titre;
    	private Date dateDebut;
    	private Date dateFin;
    	private String poids;
     
        public GetEnduroForm () {
        }
     
        public void reset(ActionMapping actionMapping, HttpServletRequest request) {        
        	this.titre="";
            this.dateDebut=null;
            this.dateFin=null;
            this.poids="";    	       
        }
     
        public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest request) {
        	ActionErrors errors = new ActionErrors();
        	return errors;        
        }
     
    	public Date getDateDebut() {
    		return dateDebut;
    	}
     
    	public void setDateDebut(Date dateDebut) {
    		this.dateDebut = dateDebut;
    	}
     
    	public Date getDateFin() {
    		return dateFin;
    	}
     
    	public void setDateFin(Date dateFin) {
    		this.dateFin = dateFin;
    	}
     
    	public String getPoids() {
    		return poids;
    	}
     
    	public void setPoids(String poids) {
    		this.poids = poids;
    	}
     
    	public String getTitre() {
    		return titre;
    	}
     
    	public void setTitre(String titre) {
    		this.titre = titre;
    	}
     
     
    }
    mon action NouveauEnduroAction:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    import java.util.Date;
     
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
     
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
     
    public class NouveauEnduroAction extends org.apache.struts.action.Action {
     
        // Global Forwards
        public static final String GLOBAL_FORWARD_GetEnduro = "GetEnduro"; 
     
        // Local Forwards
        public static final String FORWARD_index = "index"; 
     
     
        public NouveauEnduroAction() {
        }
     
        public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
            String titre = ((GetEnduroForm)form).getTitre();
            Date dateDebut = ((GetEnduroForm)form).getDateDebut();
            Date dateFin= ((GetEnduroForm)form).getDateFin();
            String poids = ((GetEnduroForm)form).getPoids();
            return mapping.findForward(FORWARD_index);
        }
     
    }
    Je déjà vu un problème similaire sur ce forum mais sans solution valable.

    J'attends vos réponse avec impatience.

    Merci beaucoup

  2. #2
    Rédacteur
    Avatar de CyberChouan
    Homme Profil pro
    Directeur technique
    Inscrit en
    Janvier 2007
    Messages
    2 752
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Directeur technique
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Janvier 2007
    Messages : 2 752
    Points : 4 314
    Points
    4 314
    Par défaut
    Passe en mode "debug" pour tracer ton erreur. Tu en trouveras la cause beaucoup plus vite que moi en essayant de débugguer à vue tout le code que tu donnes.

  3. #3
    Membre du Club
    Inscrit en
    Décembre 2005
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Décembre 2005
    Messages : 74
    Points : 48
    Points
    48
    Par défaut
    J'essaye mais je ne vois pas du tout où chercher

  4. #4
    Expert éminent

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Points : 7 778
    Points
    7 778
    Par défaut
    Tu as des tags html dans lesquels les attributs property n'ont aucune valeur.

    Code ta balise form-beans comme ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     <form-beans>
      <form-bean name="GetEnduroForm" type="GetEnduroForm"/>
     </form-beans>
    Et aussi, il vaut mieux mettre tes classes dans un package.

  5. #5
    Expert éminent

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Points : 7 778
    Points
    7 778
    Par défaut
    Peux-tu aussi faire un test en enlevant les balises display-name présentes dans le corps des balises servlet dans le web.xml ?
    Il me semble qu'elles ne sont plus valables.

  6. #6
    Membre du Club
    Inscrit en
    Décembre 2005
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Décembre 2005
    Messages : 74
    Points : 48
    Points
    48
    Par défaut
    Un grand merci pour la modification du form bean. J'aurais jamais trouvé.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. java.lang.nullPointerException: Module 'null' not found
    Par yazid.m dans le forum Struts 1
    Réponses: 2
    Dernier message: 29/04/2011, 15h46
  2. Réponses: 1
    Dernier message: 15/02/2011, 16h53
  3. Réponses: 3
    Dernier message: 16/05/2010, 21h20
  4. java.lang.NullPointerException: Module 'null' not found
    Par yacine.dev dans le forum Struts 1
    Réponses: 1
    Dernier message: 26/02/2010, 10h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo