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

Spring Java Discussion :

JSF2 Spring, Hibernate


Sujet :

Spring Java

  1. #1
    Nouveau Candidat au Club
    Inscrit en
    Avril 2009
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Avril 2009
    Messages : 2
    Points : 1
    Points
    1
    Par défaut JSF2 Spring, Hibernate
    Salut à tous!

    Je fais mes premiers pas en JSF et actuellement je suis sur un projet intégrant JSF2, Spring et hibernate. Après avoir implémenté toutes mes couches voilà une jolie stacktrace qui me cale depuis 2 jours.

    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
    SEVERE: "Servlet.service()" pour la servlet Faces Servlet a lancé une exception
    java.lang.UnsupportedOperationException
    	at javax.faces.application.Application.getResourceHandler(Application.java:286)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:307)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
    	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
    	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
    	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
    	at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:746)
    	at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:716)
    	at org.apache.jsp.index_jsp._jspService(index_jsp.java:74)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    	at java.lang.Thread.run(Thread.java:722)
    Any idea? merci à tous!

  2. #2
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Points : 15 059
    Points
    15 059
    Par défaut
    Bonjour,

    Ça vient du fait que tu tentes de modifier une liste, map ou set qui ne peut être modifié ou encours de parcours. Tu peux nous montrer le code de index.jsp et son contrôleur?

    A+.

  3. #3
    Nouveau Candidat au Club
    Inscrit en
    Avril 2009
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Avril 2009
    Messages : 2
    Points : 1
    Points
    1
    Par défaut
    Voici le code la jsp, du bean et de web.xml :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
     
    <jsp:forward page="/faces/index.xhtml"></jsp:forward>
    </body>
    </html>
    La page index.xhtml :
    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:h="http://java.sun.com/jsf/html"
    	 xmlns:f="http://java.sun.com/jsf/core"
    	>
    <h:head>…</h:head>
    <h:body>
     
    	<fieldset>
    		<legend>User Infos :</legend>
    		<h:form>
     
    			<h:inputText value="#{personMB.nom}" />
    			<h:inputText value="#{personMB.prenom}" />
    			<h:inputText value="#{personMB.age}" />
    			<br />
    			<h:commandButton value="Submit" type="submit"
    				action="#{personMB.addPerson}" />
    		</h:form>
    	</fieldset>
     
    </h:body>
    </html>
    ####################### ManagedBean ###################
    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
    64
    65
    66
    67
    68
    package com.mag.mb;
     
    import java.util.List;
     
    import javax.faces.bean.ManagedBean;
     
    import com.mag.model.Person;
     
    @ManagedBean
    public class PersonMB {
     
    	private List<Person> liste;
    	private String nom;
    	private String prenom;
    	private int age;
     
    	private Person person;
     
    	public List<Person> getListe() {
    		return liste;
    	}
     
    	public void setListe(List<Person> liste) {
    		this.liste = liste;
    	}
     
    	public String getNom() {
    		return nom;
    	}
     
    	public void setNom(String nom) {
    		this.nom = nom;
    	}
     
    	public String getPrenom() {
    		return prenom;
    	}
     
    	public void setPrenom(String prenom) {
    		this.prenom = prenom;
    	}
     
    	public int getAge() {
    		return age;
    	}
     
    	public void setAge(int age) {
    		this.age = age;
    	}
     
    	public Person getPerson() {
    		return person;
    	}
     
    	public void setPerson(Person person) {
    		this.person = person;
    	}
     
     
    	public void addPerson(){
     
    		//
     
    	}
     
     
     
    }
    ########################## web.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
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="person" 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>person</display-name>
     
    	<welcome-file-list>
    		<welcome-file>index.jsp</welcome-file>
    	</welcome-file-list>
     
    	<servlet>
    		<servlet-name>Faces Servlet</servlet-name>
    		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    	</servlet>
    	<servlet-mapping>
    		<servlet-name>Faces Servlet</servlet-name>
    		<url-pattern>/faces/*</url-pattern>
    	</servlet-mapping>
    	<context-param>
    		<param-name>javax.faces.PROJECT_STAGE</param-name>
    		<param-value>Development</param-value>
    	</context-param>
     
     
    	<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
    		</listener> 
     
    		<context-param>    
            <param-name>contextConfigLocation</param-name>    
            <param-value> classpath:applicationContext.xml    
            </param-value>    
        </context-param>
    </web-app>
    Merci

Discussions similaires

  1. Réponses: 0
    Dernier message: 13/03/2013, 23h33
  2. [Spring][Hibernate] Transaction déclarative
    Par mauvais_karma dans le forum Hibernate
    Réponses: 13
    Dernier message: 03/07/2008, 17h09
  3. Réponses: 5
    Dernier message: 25/05/2005, 21h16

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