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

Frameworks Web Java Discussion :

Spring Hibernate/JPA MySQL


Sujet :

Frameworks Web Java

  1. #1
    Nouveau membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Novembre 2012
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : Industrie

    Informations forums :
    Inscription : Novembre 2012
    Messages : 5
    Par défaut Spring Hibernate/JPA MySQL
    Bonjour tout le monde,

    je suis entrain de développez un site e-commerce avec spring, hibernate,Mysql,

    après avoir déployer le projet dans le serveur Tomcat à l'exécution ma page web ne se lance et m'envoie une page web avec le fameux erreur 404,

    si vous pouvez m'indiquer l'origine de cette erreur . je vous remercie d'avance

    voila l'erreur que j'obtient :

    WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/eboutique/adminCat] in DispatcherServlet with name 'appServlet'



    web.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:applicationContext.xml</param-value>
    </context-param>

    <!-- Creates the Spring Container shared by all Servlets and Filters -->
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- Processes application requests -->
    <servlet>
    <servlet-name>appServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>appServlet</servlet-name>
    <url-pattern>/</url-pattern>
    </servlet-mapping>

    </web-app>


    applicationContext.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schem...ontext-3.2.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
    <property name="url" value="jdbc:mysql://localhost:3306/sid_eboutique"></property>
    <property name="username" value="root"></property>
    <property name="password" value=""></property>
    </bean>

    <bean id="persistenceUnitManager" class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
    <property name="defaultDataSource" ref="dataSource"></property>
    <property name="persistenceXmlLocations">
    <list>
    <value>classpath*:META-INF/persistence.xml</value>
    </list>
    </property>
    </bean>

    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="persistenceUnitManager" ref="persistenceUnitManager"></property>
    <property name="persistenceUnitName" value="UP_BOUTIQUE"></property>
    </bean>
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory"></property>
    </bean>
    <tx:annotation-driven transaction-manager="transactionManager"/>
    <context:annotation-config></context:annotation-config>

    <bean id="dao" class="org.sid.eboutique.dao.BoutiqueDaoImpl"></bean>
    <bean id="metier" class="org.sid.eboutique.metier.BoutiqueMetierImpl">
    <property name="dao" ref="dao" ></property>
    </bean>


    </beans>

    AdminCategoriesControllers:

    package org.sid.eboutique.controllers;

    import org.sid.eboutique.metier.IAdminCategoriesMetier;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Controller;
    import org.springframework.ui.Model;
    import org.springframework.web.bind.annotation.RequestMapping;


    @Controller
    @RequestMapping(value="/adminCat")
    public class AdminCategoriesController {

    @Autowired
    private IAdminCategoriesMetier metier;

    @RequestMapping(value="/index")
    public String index(Model model){

    return "categories";

    }
    }

  2. #2
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    tu as mappé ta méthode sur "/adminCat" pas sur "/eboutique/adminCat"

Discussions similaires

  1. [Integration] Problème d'intégration d'un Applet JAVA tournant avec Spring / Hibernate / JPA
    Par anthony22360 dans le forum Spring
    Réponses: 1
    Dernier message: 02/07/2013, 16h41
  2. Réponses: 2
    Dernier message: 30/04/2013, 14h07
  3. [Framework] Architecture Spring + Hibernate/JPA
    Par bloub dans le forum Spring
    Réponses: 0
    Dernier message: 22/03/2012, 21h55
  4. Réponses: 1
    Dernier message: 02/12/2010, 20h59
  5. [Data] Spring hibernate JPA : second level cache
    Par nahtanojb dans le forum Spring
    Réponses: 0
    Dernier message: 11/04/2010, 18h32

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