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 :

Erreur bizarre sur une Property


Sujet :

Spring Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Rédacteur
    Avatar de romaintaz
    Homme Profil pro
    Java craftsman
    Inscrit en
    Juillet 2005
    Messages
    3 790
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Java craftsman
    Secteur : Finance

    Informations forums :
    Inscription : Juillet 2005
    Messages : 3 790
    Par défaut Erreur bizarre sur une Property
    Bonjour,

    Je travaille sur un projet pour lequel nous utilisons (entre autres) Spring en version 2.0.6.
    Depuis le début de semaine, nous avons divisé notre projet en deux sur CVS (en gros on a fait une branche pour continuer à travailler sur la version 1.0, tandis que le head permet de travailler sur la 2.0). Les sources diffèrent très peu pour le moment (on a changé les versions des pom.xml, pas grand chose de plus).

    Le souci c'est que depuis cette division, les projets du Head (2.0) ne démarrent plus et nous lancent une erreur vraiment bizarre :


    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
    2008-04-30 09:52:44 ERROR [ContextLoader] [IP=] [user=] Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoXml' defined in class path resource [spring-persistence-dbxml-jndi.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager': no matching editors or conversion strategy found
    Caused by: 
    org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
    PropertyAccessException 1:
    org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager': no matching editors or conversion strategy found
    Caused by: 
    java.lang.IllegalArgumentException: Cannot convert value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager': no matching editors or conversion strategy found
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:815)
        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1126)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:448)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    2008-04-30 09:52:46 ERROR [[/web-portal]] [IP=] [user=] 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 'daoXml' defined in class path resource [spring-persistence-dbxml-jndi.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager': no matching editors or conversion strategy found
    Caused by: 
    org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
    PropertyAccessException 1:
    org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager': no matching editors or conversion strategy found
    Caused by: 
    java.lang.IllegalArgumentException: Cannot convert value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager] for property 'xmlManager': no matching editors or conversion strategy found
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:815)
        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1126)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:448)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    30 avr. 2008 09:52:46 org.apache.catalina.core.StandardContext start
    GRAVE: Error listenerStart
    Je trouve ça bizarre d'avoir ce message : "Cannot convert value of type [com.sleepycat.dbxml.XmlManager] to required type [com.sleepycat.dbxml.XmlManager]"...

    Le contenu du fichier spring-persistence-dbxml-jndi.xml est le suivant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd">
     
        <bean id="daoXml" class="mon.projet.persistence.xml.DaoXmlImpl">
            <property name="xmlManager">
                <bean class="org.springframework.jndi.JndiObjectFactoryBean">
                    <property name="jndiName" value="java:comp/env/bdbXmlManager"/>
                </bean>    
            </property>
        </bean>     
     
        <bean id="lsoXmlDao" class="mon.projet.persistence.xml.lso.LsoXmlDaoImpl">
            <property name="daoXml" ref="daoXml"/> 
        </bean>
    </beans>
    bdbXmlManager est défini dans Tomcat :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <Resource name="bdbXmlManager" auth="Container" type="com.sleepycat.dbxml.XmlManager" factory="mon.projet.init.tomcat.bdb.BerkeleyDbXmlManagerFactory"/>
    Le plus étrange c'est que les projets sur la branche (version 1.0) fonctionnent correctement...
    Vraiment, là je lutte, je ne trouve aucune nouvelle piste à explorer... Une idée ?
    Nous sommes tous semblables, alors acceptons nos différences !
    --------------------------------------------------------------
    Liens : Blog | Page DVP | Twitter
    Articles : Hudson | Sonar | Outils de builds Java Maven 3 | Play! 1 | TeamCity| CitConf 2009
    Critiques : Apache Maven

  2. #2
    Membre Expert Avatar de KiLVaiDeN
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    2 890
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 2 890
    Par défaut
    Bonjour,

    Ton erreur est étrange, et peut-être serait-elle résolue si tu passais à la dernière version de Spring 2.0.8.

    Sinon, si j'étais toi, j'essaierais de séparer les déclarations de beans sur plusieurs lignes pour voir si il n'y a pas un problème d'imbrication ( ton property qui contient un bean )

    Fais plutôt quelque chose comme ça :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    <bean id class>
    </bean>
     
    <bean id class>
       <property name ref/>
    </bean>
     
    etc..
    A part ça je ne vois pas..

    A+

  3. #3
    Rédacteur
    Avatar de romaintaz
    Homme Profil pro
    Java craftsman
    Inscrit en
    Juillet 2005
    Messages
    3 790
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Java craftsman
    Secteur : Finance

    Informations forums :
    Inscription : Juillet 2005
    Messages : 3 790
    Par défaut
    Merci pour ta réponse...

    J'ai testé la séparation des définitions des beans, ça ne m'a pas avancé d'un poil, hélas Le message reste le même...
    Nous sommes tous semblables, alors acceptons nos différences !
    --------------------------------------------------------------
    Liens : Blog | Page DVP | Twitter
    Articles : Hudson | Sonar | Outils de builds Java Maven 3 | Play! 1 | TeamCity| CitConf 2009
    Critiques : Apache Maven

  4. #4
    Membre Expert Avatar de KiLVaiDeN
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    2 890
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 2 890
    Par défaut
    Essaie alors plutôt d'injecter dans une interface pour voir ( XmlManagerInterface ), sinon je ne vois qu'une grosse scéance de débuggage en vue pour toi !

Discussions similaires

  1. Réponses: 6
    Dernier message: 29/05/2008, 13h06
  2. Erreur bizarre sur une méthode
    Par mhamedbj dans le forum Servlets/JSP
    Réponses: 4
    Dernier message: 13/03/2008, 14h58
  3. Erreur unlink sur une image
    Par V_R46 dans le forum Langage
    Réponses: 3
    Dernier message: 27/07/2006, 13h00
  4. erreur bizarre dans une page asp
    Par leclone dans le forum ASP
    Réponses: 1
    Dernier message: 19/05/2006, 02h28
  5. Erreur etrange sur une requete
    Par mael94420 dans le forum ASP
    Réponses: 3
    Dernier message: 12/03/2006, 23h25

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