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

Tomcat et TomEE Java Discussion :

Message d'erreur : La ressource demandée () n'est pas disponible.


Sujet :

Tomcat et TomEE Java

  1. #1
    Membre habitué
    Femme Profil pro
    Inscrit en
    Mai 2012
    Messages
    360
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 360
    Points : 139
    Points
    139
    Par défaut Message d'erreur : La ressource demandée () n'est pas disponible.
    Bonjour,

    J'ai développé une application et je n'arrive pas à la lancer sur le serveur tomcat6.

    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
     
    27 déc. 2013 10:57:55 org.apache.catalina.core.StandardContext listenerStart
    GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in ServletContext resource [/WEB-INF/config/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/config/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No persistence unit with name 'persistenceUnit' found
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
    	at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:596)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:365)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    	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)
    Dans le doute, j'ai repris un applicationcontext.xml d'une autre application qui fonctionne, pour le copier-coller dans ma nouvel application, mais çà ne marche pas.

    Pourriez vous m'aider ?

    Merci

  2. #2
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    Tu as sans doute omis la creation de l' entitymanager . Fais nous voir ton fichier xml..
    Eric

  3. #3
    Membre habitué
    Femme Profil pro
    Inscrit en
    Mai 2012
    Messages
    360
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 360
    Points : 139
    Points
    139
    Par défaut
    Merci de votre réponse

    Voici mon fichier applicationContext.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
    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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
     
    	<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
     
    	<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
    		<property name="sessionFactory" ref="sessionFactory" />
    	</bean>	
     
    	<bean id="sessionFactory"
    		class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    		<property name="annotatedClasses">
    			<list>
    				<value>procedure.gestion.entitybeans.Classification</value>
    				<value>procedure.gestion.entitybeans.Droit</value>
    				<value>procedure.gestion.entitybeans.Personne</value>
    				<value>procedure.gestion.entitybeans.Procedure</value>
    				<value>procedure.gestion.entitybeans.Sousclasse</value>
    				<value>procedure.gestion.entitybeans.Userlogin</value>
     
    			</list>
    		</property>
    		<property name="dataSource" ref="dataSource" />
    		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
    				<prop key="hibernate.connection.release_mode">auto</prop>
    				<prop key="hibernate.bytecode.provider">javassist</prop>
    				<prop key="hibernate.show_sql">false</prop>
    				<prop key="hibernate.cache.use_second_level_cache">false</prop>
    			</props>
    		</property>
    	</bean>
     
        <bean id="dataSource"
            class="org.springframework.jdbc.datasource.DriverManagerDataSource">
            <property name="driverClassName" value="com.mysql.jdbc.Driver" />
            <property name="url" value="jdbc:mysql://localhost:3306/gestionprocedure" />
            <property name="username" value="root" />
            <property name="password" value="" />
        </bean>
     
    	<bean id="transactionProxy" abstract="true"
    		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    		<property name="transactionManager">
    			<ref bean="transactionManager"/>
    		</property>
    		<property name="transactionAttributes">
    			<props>
    				<prop key="insert*">PROPAGATION_REQUIRED</prop>
    				<prop key="update*">PROPAGATION_REQUIRED</prop>
    				<prop key="save*">PROPAGATION_REQUIRED</prop>
    				<prop key="*">PROPAGATION_REQUIRED, readOnly</prop>
    			</props>
    		</property>
    	</bean>
     
     
     
    	<bean id="entityManagerFactory"
            class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="persistenceUnitName" value="persistenceUnit" />
            <property name="dataSource" ref="dataSource" />
        </bean>  
     
     
     
    	<!-- bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
    		<property name="sessionFactory" ref="sessionFactory" />
    	</bean-->
     
    	<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    		<property name="sessionFactory" ref="sessionFactory"/>
    	</bean>
     
    	<bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
    		<property name="transactionManager" ref="transactionManager" />
    	</bean>
     
        <tx:annotation-driven transaction-manager="transactionManager" />
     
    </beans>

  4. #4
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    Esaies de commenter la ligne 67 a 73, et voir si c'est la meme erreur qui apparait.
    Eric

  5. #5
    Membre chevronné

    Profil pro
    Inscrit en
    Décembre 2011
    Messages
    974
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2011
    Messages : 974
    Points : 1 825
    Points
    1 825
    Par défaut
    tu as vraisemblablement oubliée de déclarer ta <persistence-unit> avec son nom dans le fichier persistence.xml

  6. #6
    Membre habitué
    Femme Profil pro
    Inscrit en
    Mai 2012
    Messages
    360
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 360
    Points : 139
    Points
    139
    Par défaut
    Merci beaucoup pour votre aide

    @ jeffray03 > J'ai commenté mais j'ai d'autre message d'erreurs

    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
     
    RAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personne' defined in ServletContext resource [/WEB-INF/config/spring-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [procedure.gestion.service.impl.DroitImpl] to required type [procedure.gestion.dao.IDroitDao] for property 'droitService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [procedure.gestion.service.impl.DroitImpl] to required type [procedure.gestion.dao.IDroitDao] for property 'droitService': no matching editors or conversion strategy found
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    	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)
    Je pense que cela provient du fait qu'il ne trouve pas l'entityManagerFactory dans le fichier applicationContext.xml

    @ plawyx > Le soucis est que je n'ai pas de fichier persistence.xml. Pourtant, j'ai fait un comparatif avec l'autre application qui marche, et dans celle ci, il n'y a pas, non plus, de fichier appelé persistence.xml .

  7. #7
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    as tu regardé dans le repertoire META-INF?

  8. #8
    Membre habitué
    Femme Profil pro
    Inscrit en
    Mai 2012
    Messages
    360
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 360
    Points : 139
    Points
    139
    Par défaut
    @ jeffray03 > Trop fort *0* Effectivement, je l'avais oublié. Par contre j'ai un nouveau message d'erreur.


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    27 déc. 2013 15:14:01 org.apache.catalina.core.StandardContext listenerStart
    GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personne' defined in ServletContext resource [/WEB-INF/config/spring-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [procedure.gestion.service.impl.DroitImpl] to required type [procedure.gestion.dao.IDroitDao] for property 'droitService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [procedure.gestion.service.impl.DroitImpl] to required type [procedure.gestion.dao.IDroitDao] for property 'droitService': no matching editors or conversion strategy found
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)

  9. #9
    Membre habitué
    Femme Profil pro
    Inscrit en
    Mai 2012
    Messages
    360
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 360
    Points : 139
    Points
    139
    Par défaut
    C'est bon, j'ai trouvé mon problème. Je n'avais pas donnée le même nom dans une variable

    MERCI BEAUCOUP DU COUP DE MAIN

  10. #10
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    N'y a pas de quoi.

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

Discussions similaires

  1. Réponses: 2
    Dernier message: 07/03/2013, 12h42
  2. ressource demande n'est pas disponible
    Par j_esti dans le forum Struts 1
    Réponses: 1
    Dernier message: 21/05/2008, 23h49
  3. [Tomcat 6.0] La ressource demandée n'est pas disponible
    Par Monkey_D.Luffy dans le forum JDBC
    Réponses: 14
    Dernier message: 20/05/2008, 15h41
  4. La ressource demandée n'est pas disponible.
    Par info_plus dans le forum Tomcat et TomEE
    Réponses: 1
    Dernier message: 03/04/2008, 17h49
  5. Erreur 404 - La ressource demandée (/**/) n'est pas disponible.
    Par Rom1984 dans le forum Tomcat et TomEE
    Réponses: 9
    Dernier message: 20/03/2008, 16h06

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