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 2 Java Discussion :

[Struts2] Erreur dans ma classe UserAction : java.lang.NullPointerException


Sujet :

Struts 2 Java

  1. #1
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut [Struts2] Erreur dans ma classe UserAction : java.lang.NullPointerException
    Bonjour,

    Je suis débutant en Struts2 et je travaille sur une application qui intègre Hibernate et Struts2.

    J'ai suivi ce tutoriel : http://www.mkyong.com/struts2/struts...ation-example/

    Voilà mes fichiers de configuation (web.xml, struts.xml), la classe UserAction et ma page user.jsp ci - dessous:

    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
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      <display-name>Struts2HibernateExample</display-name>
      <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>
     
      <filter>
    	<filter-name>struts2</filter-name>
    	<filter-class>
    	  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    	</filter-class>
      </filter>
     
      <filter-mapping>
    	<filter-name>struts2</filter-name>
    	<url-pattern>/*</url-pattern>
      </filter-mapping>
     
      <listener>
        <listener-class>
    	  com.afkir.listener.HibernateListener
        </listener-class>
      </listener>
      
    </web-app>
    Struts.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
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
     
    <struts>
      <constant name="struts.devMode" value="true" />
     
      <package name="default" namespace="/" extends="struts-default">
     
        <action name="listUserAction" 
    	class="com.afkir.action.UserAction" method="listUser" >
            <result name="success">pages/user.jsp</result>
        </action>		
     
      </package>	
    </struts>
    user.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
    27
    28
    29
    30
    <%@ taglib prefix="s" uri="/struts-tags" %>
    <html>
    <head>
    </head>
     
    <body>
    <h1>Struts 2 + Hibernate integration example</h1>
     
    <h2>All Customers</h2>
     
    <s:if test="userList.size() > 0">
    <table border="1px" cellpadding="8px">
    	<tr>
    		<th>Customer Id</th>
    		<th>Name</th>
    		<th>Created Date</th>
    	</tr>
    	<s:iterator value="userList" status="userStatus">
    		<tr>
    			<td><s:property value="id" /></td>
    			<td><s:property value="name" /></td>
    		</tr>
    	</s:iterator>
    </table>
    </s:if>
    <br/>
    <br/>
     
    </body>
    </html>
    UserAction.java :

    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
    69
    70
    71
    72
    73
    74
    package com.afkir.action;
     
    import java.util.ArrayList;
    import java.util.List;
     
    import org.apache.struts2.ServletActionContext;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
     
    import com.afkir.listener.HibernateListener;
    import com.afkir.model.User;
    import com.opensymphony.xwork2.ActionSupport;
    import com.opensymphony.xwork2.ModelDriven;
     
    public class UserAction extends ActionSupport implements ModelDriven {
     
    	User user = new User();
    	List<User> userList = new ArrayList<User>();
     
    	public String execute() throws Exception {
    		return SUCCESS;
    	}
     
    	public Object getModel() {
    		return user;
    	}
     
    	public List<User> getUserList() {
    		return userList;
    	}
     
    	public void setUserList(List<User> userList) {
    		this.userList = userList;
    	}
     
    	//save customer
    	public String addUser() throws Exception{
     
    		//get hibernate session from the servlet context
    		SessionFactory sessionFactory = 
    	         (SessionFactory) ServletActionContext.getServletContext()
                         .getAttribute(HibernateListener.KEY_NAME);
     
    		Session session = sessionFactory.openSession();
     
    		session.beginTransaction();
    		session.save(user);
    		session.getTransaction().commit();
     
    		//reload the customer list
    		userList = null;
    		userList = session.createQuery("from User").list();
     
    		return SUCCESS;
     
    	}
     
    	//list all customers
    	public String listUser() throws Exception{
     
    		//get hibernate session from the servlet context
    		SessionFactory sessionFactory = 
    	         (SessionFactory) ServletActionContext.getServletContext()
                         .getAttribute(HibernateListener.KEY_NAME);
     
    		Session session = sessionFactory.openSession();
     
    		userList = session.createQuery("from User").list();
     
    		return SUCCESS;
     
    	}	
     
    }
    Voilà les erreurs que j'ai quand j'accède à ce lien :
    http://localhost:8082/Struts2Hiberna...rAction.action

    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
    java.lang.NullPointerException 
        com.afkir.action.UserAction.listUser(UserAction.java:66)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        java.lang.reflect.Method.invoke(Unknown Source)
        com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
        com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
        org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
        org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
        org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
        org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:510)
        org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
        org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
        org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        java.lang.Thread.run(Unknown Source)

    Il me parait que le problème vient de la méthode listUser() de la classe UserAction.

    J'ai besoin de votre renseignements,
    Merci d'avance.

  2. #2
    Membre confirmé
    Homme Profil pro
    Ed Nat
    Inscrit en
    Janvier 2013
    Messages
    325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Ed Nat
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2013
    Messages : 325
    Points : 562
    Points
    562
    Par défaut
    Bonsoir,
    c'est le ServletActionContext.getServletContext().getAttribute(...) qui retourne NULL, et donc le SessionFactory Hibernate qui n'a pas été instancié.

    Peux-tu nous montrer le fichier de conf Hibernate, et le listener Hibernate déclaré dans web.xml ?

  3. #3
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    Mon fichier hibernate.cfg.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
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
      <session-factory>
        <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/bdd_test</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="show_sql">true</property>
        <property name="format_sql">true</property>
        <property name="use_sql_comments">false</property>
        <mapping resource="com/afkir/hibernate/User.hbm.xml" />
      </session-factory>
    </hibernate-configuration>
    Ma classe HibernateListener :

    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
    public class HibernateListener implements ServletContextListener{
     
        private Configuration config;
        private SessionFactory factory;
        private String path = "/hibernate.cfg.xml";
        private static Class clazz = HibernateListener.class;
     
        public static final String KEY_NAME = clazz.getName();
     
    	public void contextDestroyed(ServletContextEvent event) {
    	  //
    	}
     
    	public void contextInitialized(ServletContextEvent event) {
     
    	 try { 
    	        URL url = HibernateListener.class.getResource(path);
    	        config = new Configuration().configure(url);
    	        factory = config.buildSessionFactory();
     
    	        //save the Hibernate session factory into serlvet context
    	        event.getServletContext().setAttribute(KEY_NAME, factory);
    	  } catch (Exception e) {
    	         System.out.println(e.getMessage());
    	   }
    	}
    }

  4. #4
    Membre confirmé
    Homme Profil pro
    Ed Nat
    Inscrit en
    Janvier 2013
    Messages
    325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Ed Nat
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2013
    Messages : 325
    Points : 562
    Points
    562
    Par défaut
    La config Hibernate a l'air correcte, et le listener l'est également.

    Par contre, l'impossibilité d'instancier le SessionFactory peut provenir de Librairies non définies en tant que Web Libraries (copiées dans WEB-INF/Lib) et ajoutées directement dans le buildPath (comme sur le screen fourni où j'ai signalé une lib mal déclarée en rouge).

    Toutes les lib (*.jar) sont-elles sans exception dans WEB-INF/Lib ?
    N'y a t-il aucune erreur signalée au démarrage du contexte ?
    Images attachées Images attachées  

  5. #5
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    Bonjour,

    Je vous remercie infiniment pour l'interet que vous donnez à mon problème.

    Voilà une photo qui illustre les libs des jar que j'ai :

    Images attachées Images attachées  

  6. #6
    Membre confirmé
    Homme Profil pro
    Ed Nat
    Inscrit en
    Janvier 2013
    Messages
    325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Ed Nat
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2013
    Messages : 325
    Points : 562
    Points
    562
    Par défaut
    Bonjour,
    je viens de voir :
    il manque la classe du driver jdbc dans hibernate.cfg.xml :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    <hibernate-configuration>
      <session-factory>
      ...
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
      ...
      </session-factory>
    <hibernate-configuration>

  7. #7
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    Mais il existe mysql-connector-java 5.1.9 dans la lib Maven

  8. #8
    Membre confirmé
    Homme Profil pro
    Ed Nat
    Inscrit en
    Janvier 2013
    Messages
    325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Ed Nat
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2013
    Messages : 325
    Points : 562
    Points
    562
    Par défaut
    oui, mais encore faut-il que Hibernate sache quel driver jdbc utiliser...

  9. #9
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    Qu'est ce que je dois faire pour que Hibernate sache le driver

  10. #10
    Membre confirmé
    Homme Profil pro
    Ed Nat
    Inscrit en
    Janvier 2013
    Messages
    325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Ed Nat
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2013
    Messages : 325
    Points : 562
    Points
    562
    Par défaut
    Je t'ai mis la ligne à ajouter 3 messages plus haut...

    Dans hibernate.cfg.xml, ajouter
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
    entre <session-factory> et </session-factory>

  11. #11
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    Meme je l'ai ajouté, ça reste les memes erreurs

  12. #12
    Membre confirmé
    Homme Profil pro
    Ed Nat
    Inscrit en
    Janvier 2013
    Messages
    325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Ed Nat
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2013
    Messages : 325
    Points : 562
    Points
    562
    Par défaut
    Pourtant, cette ligne était manquante, et elle est indispensable.

    Ce qui est étonnant, c'est que l'erreur provoquée par l'absence de déclaration du driver ne soit pas signalée...
    par un message du genre
    java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/...
    Peux tu mettre les logs affichés dans la console au démarrage du contexte

  13. #13
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    Voilà l'erreur que j'ai :

    entity class not found: com.afkir.hibernate.User

  14. #14
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    Voilà les logs affichés lors du démarrage du serveur :

    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
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    févr. 05, 2013 1:22:05 PM org.hibernate.cfg.Environment buildBytecodeProvider
    Infos: Bytecode provider name : cglib
    févr. 05, 2013 1:22:05 PM org.hibernate.cfg.Environment <clinit>
    Infos: using JDK 1.4 java.sql.Timestamp handling
    févr. 05, 2013 1:22:05 PM org.hibernate.cfg.Configuration configure
    Infos: configuring from url: file:/Q:/Apache%20Software%20Foundation/Tomcat%206.0/webapps/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2HibernateExample/WEB-INF/classes/hibernate.cfg.xml
    févr. 05, 2013 1:22:05 PM org.hibernate.cfg.Configuration addResource
    Infos: Reading mappings from resource : com/afkir/hibernate/User.hbm.xml
    févr. 05, 2013 1:22:05 PM org.hibernate.util.DTDEntityResolver resolveEntity
    Grave: Don't use old DTDs, read the Hibernate 3.x Migration Guide!
    févr. 05, 2013 1:22:08 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
    Infos: Mapping class: com.afkir.hibernate.User -> user
    févr. 05, 2013 1:22:08 PM org.hibernate.cfg.Configuration doConfigure
    Infos: Configured SessionFactory: null
    févr. 05, 2013 1:22:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: Using Hibernate built-in connection pool (not for production use!)
    févr. 05, 2013 1:22:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: Hibernate connection pool size: 20
    févr. 05, 2013 1:22:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: autocommit mode: false
    févr. 05, 2013 1:22:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/BDD_Test
    févr. 05, 2013 1:22:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: connection properties: {user=root}
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: RDBMS: MySQL, version: 5.5.24-log
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.19 ( Revision: tonci.grgin@oracle.com-20111003110438-qfydx066wsbydkbw )
    févr. 05, 2013 1:22:09 PM org.hibernate.dialect.Dialect <init>
    Infos: Using dialect: org.hibernate.dialect.MySQLDialect
    févr. 05, 2013 1:22:09 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
    Infos: Using default transaction strategy (direct JDBC transactions)
    févr. 05, 2013 1:22:09 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
    Infos: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Automatic flush during beforeCompletion(): disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Automatic session close at end of transaction: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JDBC batch size: 15
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JDBC batch updates for versioned data: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Scrollable result sets: enabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JDBC3 getGeneratedKeys(): enabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Connection release mode: auto
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Maximum outer join fetch depth: 2
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Default batch fetch size: 1
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Generate SQL with comments: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Order SQL updates by primary key: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Order SQL inserts for batching: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
    Infos: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    févr. 05, 2013 1:22:09 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
    Infos: Using ASTQueryTranslatorFactory
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Query language substitutions: {}
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JPA-QL strict compliance: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Second-level cache: enabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Query cache: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory createCacheProvider
    Infos: Cache provider: org.hibernate.cache.NoCacheProvider
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Optimize cache for minimal puts: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Structured second-level cache entries: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Echoing all SQL to stdout
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Statistics: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Deleted entity synthetic identifier rollback: disabled
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Default entity-mode: pojo
    févr. 05, 2013 1:22:09 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Named query checking : enabled
    févr. 05, 2013 1:22:10 PM org.hibernate.impl.SessionFactoryImpl <init>
    Infos: building session factory
    entity class not found: com.afkir.hibernate.User
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Parsing configuration file [struts-default.xml]
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Unable to locate configuration files of the name struts-plugin.xml, skipping
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Parsing configuration file [struts-plugin.xml]
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Parsing configuration file [struts.xml]
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for class com.opensymphony.xwork2.ObjectFactory
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for class com.opensymphony.xwork2.conversion.impl.XWorkConverter
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.TextProvider
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.ActionProxyFactory
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.conversion.ObjectTypeDeterminer
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface org.apache.struts2.dispatcher.mapper.ActionMapper
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (jakarta) for interface org.apache.struts2.dispatcher.multipart.MultiPartRequest
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for class org.apache.struts2.views.freemarker.FreemarkerManager
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface org.apache.struts2.components.UrlRenderer
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.validator.ActionValidatorManager
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.ValueStackFactory
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionProvider
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionContextFactory
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.PatternMatcher
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface org.apache.struts2.dispatcher.StaticContentLoader
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.UnknownHandlerManager
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Overriding property struts.i18n.reload - old value: false new value: true
    févr. 05, 2013 1:22:10 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Overriding property struts.configuration.xml.reload - old value: false new value: true
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Parsing configuration file [struts-default.xml]
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Unable to locate configuration files of the name struts-plugin.xml, skipping
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Parsing configuration file [struts-plugin.xml]
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Parsing configuration file [struts.xml]
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for class com.opensymphony.xwork2.ObjectFactory
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for class com.opensymphony.xwork2.conversion.impl.XWorkConverter
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.TextProvider
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.ActionProxyFactory
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.conversion.ObjectTypeDeterminer
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface org.apache.struts2.dispatcher.mapper.ActionMapper
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (jakarta) for interface org.apache.struts2.dispatcher.multipart.MultiPartRequest
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for class org.apache.struts2.views.freemarker.FreemarkerManager
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface org.apache.struts2.components.UrlRenderer
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.validator.ActionValidatorManager
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.ValueStackFactory
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionProvider
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionContextFactory
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.PatternMatcher
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface org.apache.struts2.dispatcher.StaticContentLoader
    févr. 05, 2013 1:22:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.UnknownHandlerManager
    févr. 05, 2013 1:22:12 PM org.apache.coyote.http11.Http11Protocol start
    Infos: Démarrage de Coyote HTTP/1.1 sur http-8082
    févr. 05, 2013 1:22:12 PM org.hibernate.connection.DriverManagerConnectionProvider close
    Infos: cleaning up connection pool: jdbc:mysql://localhost/BDD_Test
    févr. 05, 2013 1:22:12 PM org.apache.jk.common.ChannelSocket init
    Infos: JK: ajp13 listening on /0.0.0.0:8099
    févr. 05, 2013 1:22:12 PM org.apache.jk.server.JkMain start
    Infos: Jk running ID=0 time=0/30  config=null
    févr. 05, 2013 1:22:12 PM org.apache.catalina.startup.Catalina start
    Infos: Server startup in 10696 ms

  15. #15
    Membre confirmé
    Homme Profil pro
    Ed Nat
    Inscrit en
    Janvier 2013
    Messages
    325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Ed Nat
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2013
    Messages : 325
    Points : 562
    Points
    562
    Par défaut
    Dans ce cas c'est normal,
    toi tu as mis ta classe User dans com.afkir.model

    il faut que le mapping définit dans le fichier xml mentionné dans hibernate.cfg.xml
    <mapping resource="com/afkir/hibernate/User.hbm.xml" />
    Corresponde au package dans lequel ta classe se trouve...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    <hibernate-mapping>
    <class 
        name="[Nom_Package].User" 
        table="USER"
             entity-name="User"
    >
    Change l'un ou l'autre des 2

    il faut que [Nom_Package] corresponde au package dans lequel ta classe User se trouve

  16. #16
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    J'ai résolu le problème de "entity not found".

    Maintenant j'ai cette erreur : Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

  17. #17
    Membre confirmé
    Homme Profil pro
    Ed Nat
    Inscrit en
    Janvier 2013
    Messages
    325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Ed Nat
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2013
    Messages : 325
    Points : 562
    Points
    562
    Par défaut
    Logiquement, il y a d'autres infos qui suivent le log :
    Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
    Sans avoir ces infos... il se peut qu'il manque 1 ou plusieurs getters/Setters sur les variables d'instance de User,
    ou que tu n'ai pas mis cette dépendance dans Maven :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.12.1.GA</version>
    </dependency>

  18. #18
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    Je possède dèja :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.11.0.GA</version>
    </dependency>
    dans mon fichier pom.xml.

    Voilà ma classe User :

    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
    package com.afkir.model;
     
    import java.io.Serializable;
     
    public class User implements Serializable {
     
    	private int id;
    	private String name;
     
    	public int getId() {
    		return id;
    	}
    	public void setId(int id) {
    		this.id = id;
    	}
    	public String getName() {
    		return name;
    	}
    	public void setName(String name) {
    		this.name = name;
    	}
    	public User(){
    	}
    	public User(int id, String name) {
    		super();
    		this.id = id;
    		this.name = name;
    	}
     
    }

  19. #19
    Membre confirmé
    Homme Profil pro
    Ed Nat
    Inscrit en
    Janvier 2013
    Messages
    325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Ed Nat
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2013
    Messages : 325
    Points : 562
    Points
    562
    Par défaut
    Ce n'est donc ni l'un ni l'autre...

    Met la trace complète de l'exception, ce sera plus facile que d'essayer de deviner
    et le fichier User.hbm.xml

  20. #20
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    Voilà mon fichier User.hbm.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
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
     
    <hibernate-mapping package="com.afkir.model">
    	<class name="User" table="user">
    		<id
    			column="id"
    			name="Id"
    			type="java.lang.Integer"
    		>
    			<generator class="identity" />
    		</id>
    		<property
    			column="name"
    			length="254"
    			name="Name"
    			not-null="true"
    			type="java.lang.String"
    		 />
    	</class>
    </hibernate-mapping>
    Mon serveur contient cette seule application, voilà les logs affichés quand je le démarre :

    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
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    févr. 05, 2013 5:52:27 PM org.apache.catalina.core.AprLifecycleListener init
    Infos: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Ruby193\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Android\android-sdk-windows;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Java\jre7\bin;C:\wamp\bin\php\php5.4.3\;D:\Programmes&Logiciels\Eclipse Indigo JEE\eclipse;;.
    févr. 05, 2013 5:52:27 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    Avertissement: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Struts2HibernateExample' did not find a matching property.
    févr. 05, 2013 5:52:27 PM org.apache.coyote.http11.Http11Protocol init
    Infos: Initialisation de Coyote HTTP/1.1 sur http-8082
    févr. 05, 2013 5:52:27 PM org.apache.catalina.startup.Catalina load
    Infos: Initialization processed in 920 ms
    févr. 05, 2013 5:52:27 PM org.apache.catalina.core.StandardService start
    Infos: Démarrage du service Catalina
    févr. 05, 2013 5:52:27 PM org.apache.catalina.core.StandardEngine start
    Infos: Starting Servlet Engine: Apache Tomcat/6.0.33
    févr. 05, 2013 5:52:28 PM org.hibernate.cfg.Environment <clinit>
    Infos: Hibernate 3.2.7
    févr. 05, 2013 5:52:28 PM org.hibernate.cfg.Environment <clinit>
    Infos: hibernate.properties not found
    févr. 05, 2013 5:52:28 PM org.hibernate.cfg.Environment buildBytecodeProvider
    Infos: Bytecode provider name : cglib
    févr. 05, 2013 5:52:28 PM org.hibernate.cfg.Environment <clinit>
    Infos: using JDK 1.4 java.sql.Timestamp handling
    févr. 05, 2013 5:52:29 PM org.hibernate.cfg.Configuration configure
    Infos: configuring from url: file:/Q:/Apache%20Software%20Foundation/Tomcat%206.0/webapps/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2HibernateExample/WEB-INF/classes/hibernate.cfg.xml
    févr. 05, 2013 5:52:29 PM org.hibernate.cfg.Configuration addResource
    Infos: Reading mappings from resource : com/afkir/hibernate/User.hbm.xml
    févr. 05, 2013 5:52:30 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
    Infos: Mapping class: com.afkir.model.User -> user
    févr. 05, 2013 5:52:30 PM org.hibernate.cfg.Configuration doConfigure
    Infos: Configured SessionFactory: null
    févr. 05, 2013 5:52:30 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: Using Hibernate built-in connection pool (not for production use!)
    févr. 05, 2013 5:52:30 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: Hibernate connection pool size: 20
    févr. 05, 2013 5:52:30 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: autocommit mode: false
    févr. 05, 2013 5:52:30 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/BDD_Test
    févr. 05, 2013 5:52:30 PM org.hibernate.connection.DriverManagerConnectionProvider configure
    Infos: connection properties: {user=root}
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: RDBMS: MySQL, version: 5.5.24-log
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.19 ( Revision: tonci.grgin@oracle.com-20111003110438-qfydx066wsbydkbw )
    févr. 05, 2013 5:52:32 PM org.hibernate.dialect.Dialect <init>
    Infos: Using dialect: org.hibernate.dialect.MySQLDialect
    févr. 05, 2013 5:52:32 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
    Infos: Using default transaction strategy (direct JDBC transactions)
    févr. 05, 2013 5:52:32 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
    Infos: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Automatic flush during beforeCompletion(): disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Automatic session close at end of transaction: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JDBC batch size: 15
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JDBC batch updates for versioned data: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Scrollable result sets: enabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JDBC3 getGeneratedKeys(): enabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Connection release mode: auto
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Maximum outer join fetch depth: 2
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Default batch fetch size: 1
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Generate SQL with comments: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Order SQL updates by primary key: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Order SQL inserts for batching: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
    Infos: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    févr. 05, 2013 5:52:32 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
    Infos: Using ASTQueryTranslatorFactory
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Query language substitutions: {}
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: JPA-QL strict compliance: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Second-level cache: enabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Query cache: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory createCacheProvider
    Infos: Cache provider: org.hibernate.cache.NoCacheProvider
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Optimize cache for minimal puts: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Structured second-level cache entries: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Echoing all SQL to stdout
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Statistics: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Deleted entity synthetic identifier rollback: disabled
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Default entity-mode: pojo
    févr. 05, 2013 5:52:32 PM org.hibernate.cfg.SettingsFactory buildSettings
    Infos: Named query checking : enabled
    févr. 05, 2013 5:52:32 PM org.hibernate.impl.SessionFactoryImpl <init>
    Infos: building session factory
    Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
    févr. 05, 2013 5:52:33 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Parsing configuration file [struts-default.xml]
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Unable to locate configuration files of the name struts-plugin.xml, skipping
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Parsing configuration file [struts-plugin.xml]
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Parsing configuration file [struts.xml]
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for class com.opensymphony.xwork2.ObjectFactory
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for class com.opensymphony.xwork2.conversion.impl.XWorkConverter
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.TextProvider
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.ActionProxyFactory
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.conversion.ObjectTypeDeterminer
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface org.apache.struts2.dispatcher.mapper.ActionMapper
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (jakarta) for interface org.apache.struts2.dispatcher.multipart.MultiPartRequest
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for class org.apache.struts2.views.freemarker.FreemarkerManager
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface org.apache.struts2.components.UrlRenderer
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.validator.ActionValidatorManager
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.ValueStackFactory
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionProvider
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionContextFactory
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.util.PatternMatcher
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface org.apache.struts2.dispatcher.StaticContentLoader
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Choosing bean (struts) for interface com.opensymphony.xwork2.UnknownHandlerManager
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Overriding property struts.i18n.reload - old value: false new value: true
    févr. 05, 2013 5:52:34 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    Infos: Overriding property struts.configuration.xml.reload - old value: false new value: true
    févr. 05, 2013 5:52:35 PM org.apache.coyote.http11.Http11Protocol start
    Infos: Démarrage de Coyote HTTP/1.1 sur http-8082
    févr. 05, 2013 5:52:36 PM org.apache.jk.common.ChannelSocket init
    Infos: JK: ajp13 listening on /0.0.0.0:8099
    févr. 05, 2013 5:52:36 PM org.apache.jk.server.JkMain start
    Infos: Jk running ID=0 time=0/87  config=null
    févr. 05, 2013 5:52:36 PM org.apache.catalina.startup.Catalina start
    Infos: Server startup in 8508 ms
    Voilà la structure de mon application :

    Images attachées Images attachées  

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Erreur "Exception in thread "main" java.lang.NullPointerException"
    Par bibouta88 dans le forum Débuter avec Java
    Réponses: 5
    Dernier message: 26/03/2013, 19h38
  2. Réponses: 0
    Dernier message: 31/08/2012, 19h55
  3. Erreur "java.lang.NullPointerException" dans un ArrayList
    Par AmeniESC dans le forum Collection et Stream
    Réponses: 4
    Dernier message: 21/03/2012, 00h12
  4. erreur dans mon code "java.lang.NullPointerException"
    Par wiss20000 dans le forum Langage
    Réponses: 12
    Dernier message: 19/04/2007, 09h08
  5. [Thread] Erreur dans une classe interne
    Par totof2308 dans le forum Général Java
    Réponses: 5
    Dernier message: 03/06/2004, 08h15

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