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 :

Spring AOP et AspectJ [Framework]


Sujet :

Spring Java

  1. #1
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    91
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2012
    Messages : 91
    Par défaut Spring AOP et AspectJ
    Salut!
    Je commence avec Spring et j'essaie d'implémenter Spring AOP avec AspectJ.
    J'ai eu un (bon) exemple quand à "la" démarche à suivre ici. J'ai essayer de faire autant avec des classes perso mais j'ai un souci : une exception est levée lors de la lecture du fichier xml, exactement sur la ligne de
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <aop:aspectj-autoproxy/>
    .
    L'exception se présente ainsi :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 29; schema_reference.4 : Echec de la lecture du document de schéma 'http://www.springframework.org/schema/aop/spring-aop-2.5.xsd/spring-spring-aop-2.5.xsd-2.0.8.xsd' pour les raisons suivantes : 1) Le document est introuvable ; 2) Le document n'a pas pu être lu ; 3) L'élément racine du document n'est pas <xsd:schema>.
    A vrai dire, je n'y comprends pas grand chose, surtout que je suis encore novice en Java.
    Quelqu'un pourrait m'aider à résoudre ce (petit) problème ?

  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
    http://www.springframework.org/schema/aop/spring-aop-2.5.xsd/spring-spring-aop-2.5.xsd-2.0.8.xsd

    -> cette adresse m'a l'air d'un beau meltingpot

    Le schema pour aop (spring 3.x) est

    http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

    cf point C.2.7 ici http://static.springsource.org/sprin...sd-config.html

  3. #3
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    91
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2012
    Messages : 91
    Par défaut
    En fait, j'utilise un fichier jar de Spring 2.5.
    Je crée le fichier xml à partir de NetBeans et les lignes d'en-tête du fichiers sont écrites automatiquement :
    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
    <?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/spring-aop-2.5.xsd"
           xmlns:context="http://www.springframework.org/schema/context/spring-context-2.5.xsd"
           xmlns:lang="http://www.springframework.org/schema/lang/spring-lang-2.5.xsd"
           xmlns:util="http://www.springframework.org/schema/util/spring-util-2.5.xsd"
           xmlns:p="http://www.springframework.org/schema/p"
     
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
              http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/aop/spring-aop-2.5.xsd/spring-spring-aop-2.5.xsd-2.0.8.xsd
              http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/context/spring-context-2.5.xsd/spring-spring-context-2.5.xsd-2.0.8.xsd
              http://www.springframework.org/schema/lang/spring-lang-2.5.xsd http://www.springframework.org/schema/lang/spring-lang-2.5.xsd/spring-spring-lang-2.5.xsd-2.0.8.xsd
              http://www.springframework.org/schema/util/spring-util-2.5.xsd http://www.springframework.org/schema/util/spring-util-2.5.xsd/spring-spring-util-2.5.xsd-2.0.8.xsd
    ">

  4. #4
    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
    Section A.2.5

    http://static.springsource.org/sprin...sd-config.html

    A mon avis, ton netbeans il a mis du gros caca comme xsd :s

  5. #5
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    91
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2012
    Messages : 91
    Par défaut
    Même quand j'enlève les dans le "xsi:schemaLocation", l'appli fonctionne normalement sans le "<aop:aspectj-autoproxy/>" mais fonctionne mal avec.

  6. #6
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    91
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2012
    Messages : 91
    Par défaut
    tchize_, j'ai respecté la syntaxe décrite dans le lien que tu as donné. C'est vrai que NetBeans à fait n'importe quoi. J'ai donc modifié l'en-tête et j'obtiens ceci :

    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
    <?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:context="http://www.springframework.org/schema/context"
           xmlns:lang="http://www.springframework.org/schema/lang"
           xmlns:util="http://www.springframework.org/schema/util"
           xmlns:p="http://www.springframework.org/schema/p"
     
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
              http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
              http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
              http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
              http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
    ">
    .
    Du coup, plus d'erreur au niveau de l'autoproxy.
    Mais l'exception s'est déplacée : "le proxy ne peut être 'casté' en la classe dont j'ai besoin". Cette exception est levée dès que j'essaie d'accéder au bean de la classe sur laquelle porte mes pointcut.
    Je n'y comprends que dalle et je ne trouve pas l'origine de cette exception.

  7. #7
    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
    on pourrait avoir la trace complète de ta nouvelle erreur ainsi que ton spring.xml (parce que celui qui tu as montré en dernier est vide)

  8. #8
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    91
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2012
    Messages : 91
    Par défaut
    Avant tout plantons le décor : il s'agit d'un petit exercice sur JavaFX qui consiste à réaliser un instrument de musique qui produit des notes de musique sur une gamme (une octave). Je me suis inspiré du tuto de reemy disponible sur un autre site.
    Pour apprendre Spring, j'ai choisi de modifier mes anciens exercices afin de mieux appréhender le gain réalisé grâce à Spring.
    Bref, j'utilise un clavier avec 8 touches.

    Ma classe touche se présente ainsi :
    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
    184
    185
    186
    187
    188
    189
    190
    191
     
    package melordispring;
     
    public class Touche extends Parent {
     
        private int larg;
        private int haut;
     
        private String noteNom;
        private String raccourci;
     
        private int positionX, positionY, noteCode;
     
        private Rectangle arriereTouche;
        private Text texteTouche;
        private SoundPlayer son;
        private Metronome metr;
        private ToutesDimensions dim;
     
        public Touche(ToutesDimensions dim, SoundPlayer sound, Metronome metr) {
     
            this.dim = dim;
            this.larg = dim.getLargeurTouche();
            this.haut = dim.getHauteurTouche();
            this.son = sound;
            this.metr = metr;
     
        }
     
        public void affichage(){
            setArriereTouche(new Rectangle(getLarg(), getHaut(), Color.WHITESMOKE));
            this.getChildren().add(getArriereTouche());
     
            setTexteTouche(new Text((getLarg() - 10) / 2, (getHaut() + 10) / 2, getNoteNom()));
            //texteTouche.setFont(new Font(25));
            getTexteTouche().setFill(Color.BLACK);
            this.getChildren().add(getTexteTouche());
     
            // effet d'éclairage sur la touche
            this.setEffect(new Lighting(new Light.Distant(-45.0, 30.0, Color.AQUA)));
     
            this.setTranslateX(getPositionX());
            this.setTranslateY(getPositionY());
     
            this.setOnMousePressed(new EventHandler<MouseEvent>(){
                @Override
                public void handle(MouseEvent me){
                    appui();
                }
            });
     
            this.setOnMouseReleased(new EventHandler<MouseEvent>(){
                @Override
                public void handle(MouseEvent me){
                    relachement();
                }
            });
     
            this.setOnMouseEntered(new EventHandler<MouseEvent>(){
                @Override
                public void handle(MouseEvent me){
                    setEffect(new Lighting(new Light.Distant(-45.0, 70.0, Color.AQUA)));
                }
            });
     
            this.setOnMouseExited(new EventHandler<MouseEvent>(){
                @Override
                public void handle(MouseEvent me){
                    setEffect(new Lighting(new Light.Distant(-45.0, 30.0, Color.AQUA)));
                }
            });
        }
     
        public void appui(){
            System.out.println(getTexteTouche().getText());
     
            getMetr().timeline.play();
     
            this.getArriereTouche().setFill(Color.DARKGREY);
            this.getTexteTouche().setFill(Color.WHITE);
            this.setTranslateY(getPositionY() + 2);
            this.getSon().noteOK(getNoteCode());
        }
     
        public void relachement(){
            getMetr().timeline.jumpTo(Duration.ZERO);
            getMetr().timeline.stop();
     
            this.getArriereTouche().setFill(Color.WHITESMOKE);
            getTexteTouche().setFill(Color.BLACK);
            this.setTranslateY(getPositionY());
            this.getSon().noteKO(getNoteCode());
        }
     
        public  int getLarg() {
            return larg;
        }
     
        public  void setLarg(int aLarg) {
            larg = aLarg;
        }
     
        public int getHaut() {
            return haut;
        }
     
        public void setHaut(int aHaut) {
            haut = aHaut;
        }
     
        public SoundPlayer getSon() {
            return son;
        }
     
        public void setSon(SoundPlayer son) {
            this.son = son;
        }
     
        public Metronome getMetr() {
            return metr;
        }
     
        public void setMetr(Metronome metr) {
            this.metr = metr;
        }
     
        public String getRaccourci() {
            return raccourci;
        }
     
        public void setRaccourci(String raccourci) {
            this.raccourci = raccourci;
        }
     
        public String getNoteNom() {
            return noteNom;
        }
     
        public void setNoteNom(String noteNom) {
            this.noteNom = noteNom;
        }
     
     
        public int getPositionX() {
            return positionX;
        }
     
        public void setPositionX(int positionX) {
            this.positionX = positionX;
        }
     
        public int getPositionY() {
            return positionY;
        }
     
        public void setPositionY(int positionY) {
            this.positionY = positionY;
        }
     
        public int getNoteCode() {
            return noteCode;
        }
     
        public void setNoteCode(int noteCode) {
            this.noteCode = noteCode;
        }
     
        public Rectangle getArriereTouche() {
            return arriereTouche;
        }
     
        public void setArriereTouche(Rectangle arriereTouche) {
            this.arriereTouche = arriereTouche;
        }
     
        public Text getTexteTouche() {
            return texteTouche;
        }
     
        public void setTexteTouche(Text texteTouche) {
            this.texteTouche = texteTouche;
        }
     
        public ToutesDimensions getDim() {
            return dim;
        }
     
        public void setDim(ToutesDimensions dim) {
            this.dim = dim;
        }
    }
    Mon fichier de configuration Spring :
    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
    <?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:context="http://www.springframework.org/schema/context"
           xmlns:p="http://www.springframework.org/schema/p"
     
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
              http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
              http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
    ">
        <aop:aspectj-autoproxy/>
     
        <bean id="dim" class="melordispring.ToutesDimensions">
            <property name="largeurFenetre" value="500"/>
            <property name="hauteurFenetre" value="500"/>
     
            <property name="largeurClavier" value="480"/>
            <property name="hauteurClavier" value="200"/>
     
            <property name="largeurTouche" value="50"/>
            <property name="hauteurTouche" value="30"/>
        </bean>
     
        <bean id="sound" class="melordispring.SoundPlayer"/>
     
        <bean id="metr" class="melordispring.Metronome"/>
     
        <bean id="change" class="melordispring.ChangementSound">
            <constructor-arg index="0" ref="sound"/>
        </bean>
     
        <bean id="clav" class="melordispring.Clavier">
            <constructor-arg index="0" ref="dim"/>
            <constructor-arg index="1" ref="sound"/>
            <constructor-arg index="2" ref="metr"/>
        </bean>
     
        <bean id="vol" class="melordispring.Volume">
            <constructor-arg index="0" ref="clav"/>
            <constructor-arg index="1" ref="sound"/>
        </bean>
     
        <bean id="touch" class="melordispring.Touche" scope="prototype">
            <constructor-arg index="0" ref="dim"/>
            <constructor-arg index="1" ref="sound"/>
            <constructor-arg index="2" ref="metr"/>
        </bean>
     
        <bean id="aspectM" class="AOP.AspectMethods"/>
     
    </beans>
    Mon aspect :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    @Aspect
    public class AspectMethods {
     
        @Before("execution(void melordispring.Touche.appui())")
        public void avantMethode(){
            System.out.println("On y va !");
        }
     
       @After("execution(void melordispring.Touche.appui())")
        public void apresMethode(){
            System.out.println("Déjà fini ?");
        }
     
    }
    et enfin le rapport complet d'erreur :
    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
    oct. 30, 2012 12:20:26 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@7aacc1: display name [org.springframework.context.support.ClassPathXmlApplicationContext@7aacc1]; startup date [Tue Oct 30 12:20:26 WET 2012]; root of context hierarchy
    oct. 30, 2012 12:20:27 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [melordispring/springXMLConfig.xml]
    oct. 30, 2012 12:20:27 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@7aacc1]: org.springframework.beans.factory.support.DefaultListableBeanFactory@117f065
    oct. 30, 2012 12:20:28 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@117f065: defining beans [org.springframework.aop.config.internalAutoProxyCreator,dim,sound,metr,change,clav,vol,touch,aspectM]; root of factory hierarchy
     
    Exception in Application start method
    java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:601)
    	at com.javafx.main.Main.launchApp(Main.java:642)
    	at com.javafx.main.Main.main(Main.java:805)
    Caused by: java.lang.RuntimeException: Exception in Application start method
    	at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
    	at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source)
    	at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source)
    	at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.ClassCastException: $Proxy9 cannot be cast to melordispring.Touche
    	at melordispring.Clavier.affichageTouches(Clavier.java:153)
    	at melordispring.MelOrdiSpring.start(MelOrdiSpring.java:40)
    	at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
    	at com.sun.javafx.application.PlatformImpl$5.run(Unknown Source)
    	at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
    	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    	at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
    	at com.sun.glass.ui.win.WinApplication$3$1.run(Unknown Source)
    	... 1 more
    Java Result: 1

  9. #9
    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
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    	at melordispring.Clavier.affichageTouches(Clavier.java:153)
    	at melordispring.MelOrdiSpring.start(MelOrdiSpring.java:40)
    On peux voir les lignes de code concernées?

  10. #10
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    91
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2012
    Messages : 91
    Par défaut
    La ligne de la classe Clavier, c'est celle où je fait appel au bean "touch" :
    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
    public class Clavier extends Parent{
        
        private String[] notes = {"Do", "Ré", "Mi", "Fa", "Sol", "La", "Si", "Do"};
        private int[] sons = {60, 62, 64, 65, 67, 69, 71, 72};
        private Touche[] touches = new Touche[8];
        private String[] raccourcis = {"A", "Z", "E", "R", "T", "Y", "U", "I"};
        
        private ToutesDimensions dim;
        
        private ApplicationContext appCtx;
    
        public ToutesDimensions getDim() {
            return dim;
        }
    
        public void setDim(ToutesDimensions dim) {
            this.dim = dim;
        }
    
        public ApplicationContext getAppCtx() {
            return appCtx;
        }
    
        public void setAppCtx(ApplicationContext appCtx) {
            this.appCtx = appCtx;
        }
        
        public void affichageTouches(){
            int larg = dim.getLargeurTouche();
            int var = -5;
            int dep = (int)(arriereClavier.getWidth() - (8 * (larg + 5))) / 2;
            
            for (int i = 0; i < 8; i++){
     >>>        touches[i] = (Touche)appCtx.getBean("touch");
                
                touches[i].setNoteNom(notes[i]);
                touches[i].setPositionX(i * (larg + 5) + dep);
                touches[i].setPositionY(100 + var);
                touches[i].setNoteCode(sons[i]);
                touches[i].setRaccourci(raccourcis[i]);
                
                touches[i].affichage();
                
                this.getChildren().add(touches[i]);
                
                var = - var;
            }
        }
    }
    La ligne de MelOrdiSpring quand à elle, c'est là que je fais appel à la méthode
    affichageTouches() de la classe Clavier :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Clavier monClavier = (Clavier) appCtx.getBean("clav");
            monClavier.setAppCtx(appCtx);
            monClavier.affichageTouches();

  11. #11
    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
    Est-ce que Parent implémente des interfaces? Par défaut, si l'objet dont tu tente de créer un proxy implémente des interface, spring utilisera un proxy jdk, qui ne fait que réimplémenter les interfaces. Sinon il utilisera CGLIB pour créer une sous classe

    Vu ton code (le cast), seule une sous classe peut être utilisée, tu peux forcer l'utilisation de CGLIB partout avec

    <aop:aspectj-autoproxy proxy-target-class="true"/>

  12. #12
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    91
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2012
    Messages : 91
    Par défaut
    C'est aussi ce que j'ai lu quelque part. J'ai donc téléchargé une bibliothèque de CGLIB et j'ai remplacé le <aop:aspectj-autoproxy/> par <aop:aspectj-autoproxy proxy-target-class="true"/>. Et là, le rapport d'erreur est encore plus long :
    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
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    oct. 30, 2012 2:07:08 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@aa2594: display name [org.springframework.context.support.ClassPathXmlApplicationContext@aa2594]; startup date [Tue Oct 30 14:07:07 WET 2012]; root of context hierarchy
    oct. 30, 2012 2:07:09 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [melordispring/springXMLConfig.xml]
    oct. 30, 2012 2:07:13 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@aa2594]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1258eb3
    oct. 30, 2012 2:07:14 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1258eb3: defining beans [org.springframework.aop.config.internalAutoProxyCreator,dim,sound,metr,change,clav,vol,touch,aspectM]; root of factory hierarchy
    
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final com.sun.javafx.scene.traversal.TraversalEngine javafx.scene.Parent.getImpl_traversalEngine()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Parent.impl_traversalEngineProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Parent.setImpl_traversalEngine(com.sun.javafx.scene.traversal.TraversalEngine)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.collections.ObservableList javafx.scene.Parent.getStylesheets()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final boolean javafx.scene.Parent.isNeedsLayout()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ReadOnlyBooleanProperty javafx.scene.Parent.needsLayoutProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Parent.layout()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setDepthTest(javafx.scene.DepthTest)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setEffect(javafx.scene.effect.Effect)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setBlendMode(javafx.scene.effect.BlendMode)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.scene.Scene javafx.scene.Node.getScene()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.BooleanProperty javafx.scene.Node.disableProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.BooleanProperty javafx.scene.Node.visibleProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final boolean javafx.scene.Node.isDisable()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.StringProperty javafx.scene.Node.idProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setDisable(boolean)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setId(java.lang.String)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setInputMethodRequests(javafx.scene.input.InputMethodRequests)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ReadOnlyObjectProperty javafx.scene.Node.boundsInLocalProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ReadOnlyObjectProperty javafx.scene.Node.boundsInParentProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.eventDispatcherProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.BooleanProperty javafx.scene.Node.focusTraversableProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.scene.transform.Transform javafx.scene.Node.getLocalToParentTransform()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.scene.transform.Transform javafx.scene.Node.getLocalToSceneTransform()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.event.EventHandler javafx.scene.Node.getOnContextMenuRequested()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.event.EventHandler javafx.scene.Node.getOnInputMethodTextChanged()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.event.EventHandler javafx.scene.Node.getOnMouseDragEntered()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:28 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setMouseTransparent(boolean)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnDragDetected(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnDragDone(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnDragDropped(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnDragEntered(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnDragExited(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnDragOver(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnKeyPressed(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnKeyReleased(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnKeyTyped(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseClicked(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseDragExited(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseDragOver(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseDragged(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseEntered(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseExited(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseMoved(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMousePressed(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseReleased(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnRotationStarted(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnScrollFinished(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnScrollStarted(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:31 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnSwipeDown(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnSwipeLeft(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnSwipeRight(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnTouchMoved(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnTouchPressed(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnTouchReleased(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnTouchStationary(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnZoomFinished(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnZoomStarted(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setPickOnBounds(boolean)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setRotationAxis(javafx.geometry.Point3D)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setTranslateX(double)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setTranslateY(double)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setTranslateZ(double)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.StringProperty javafx.scene.Node.styleProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.DoubleProperty javafx.scene.Node.translateXProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.DoubleProperty javafx.scene.Node.translateYProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.DoubleProperty javafx.scene.Node.translateZProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onMouseExitedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onMousePressedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onMouseReleasedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onRotationFinishedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onRotationStartedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onScrollFinishedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onScrollStartedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onTouchPressedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onTouchReleasedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onTouchStationaryProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onZoomFinishedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.beans.property.ObjectProperty javafx.scene.Node.onZoomStartedProperty()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnContextMenuRequested(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnInputMethodTextChanged(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseDragEntered(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnMouseDragReleased(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOnRotationFinished(javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.scene.Parent javafx.scene.Node.getParent()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.collections.ObservableMap javafx.scene.Node.getProperties()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final java.lang.String javafx.scene.Node.getId()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.scene.Cursor javafx.scene.Node.getCursor()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final double javafx.scene.Node.getOpacity()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setCursor(javafx.scene.Cursor)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setOpacity(double)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final boolean javafx.scene.Node.isFocused()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final boolean javafx.scene.Node.isVisible()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setVisible(boolean)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.scene.Node javafx.scene.Node.getClip()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final javafx.scene.input.InputMethodRequests javafx.scene.Node.getInputMethodRequests()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final boolean javafx.scene.Node.isFocusTraversable()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setClip(javafx.scene.Node)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final java.lang.String javafx.scene.Node.getStyle()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final double javafx.scene.Node.getTranslateY()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final double javafx.scene.Node.getScaleX()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final double javafx.scene.Node.getScaleY()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final double javafx.scene.Node.getTranslateX()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.addEventFilter(javafx.event.EventType,javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.removeEventFilter(javafx.event.EventType,javafx.event.EventHandler)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setStyle(java.lang.String)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final boolean javafx.scene.Node.isPressed()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.setCache(boolean)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    oct. 30, 2012 2:07:32 PM org.springframework.aop.framework.Cglib2AopProxy doValidateClass
    WARNING: Unable to proxy method [public final void javafx.scene.Node.autosize()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
    (...) <<< (c'était trop long et j'ai dû raccourcir :mouarf:)
    Exception in Application start method
    java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:601)
    	at com.javafx.main.Main.launchApp(Main.java:642)
    	at com.javafx.main.Main.main(Main.java:805)
    Caused by: java.lang.RuntimeException: Exception in Application start method
    	at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
    	at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source)
    	at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source)
    	at java.lang.Thread.run(Thread.java:722)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'touch' defined in class path resource [melordispring/springXMLConfig.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: net.sf.cglib.proxy.Enhancer.setInterceptDuringConstruction(Z)V
    	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.doGetBean(AbstractBeanFactory.java:283)
    	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 melordispring.Clavier.affichageTouches(Clavier.java:153)
    	at melordispring.MelOrdiSpring.start(MelOrdiSpring.java:40)
    	at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
    	at com.sun.javafx.application.PlatformImpl$5.run(Unknown Source)
    	at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
    	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    	at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
    	at com.sun.glass.ui.win.WinApplication$3$1.run(Unknown Source)
    	... 1 more
    Caused by: java.lang.NoSuchMethodError: net.sf.cglib.proxy.Enhancer.setInterceptDuringConstruction(Z)V
    	at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:182)
    	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
    	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:490)
    	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:365)
    	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:325)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:361)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1344)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
    	... 16 more
    Java Result: 1

  13. #13
    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
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    java.lang.NoSuchMethodError: net.sf.cglib.proxy.Enhancer.setInterceptDuringConstruction(Z)V
    Tu as probablement utiliser une version de CGLIB qui n'est pas celle avec laquelle ta version de spring a été prévue. Regarde bien dans ta version de spring, la doc, les versions des librairies dont tu as besoin. On ne peux pas mélanger les versions
    Pour le reste, ce sont des warnings inévitables quand tu fait un proxy d'un truc bourré de final

  14. #14
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    91
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2012
    Messages : 91
    Par défaut
    J'utilise spring-2.5.6.SEC03 j'ai fait un recherche et j'ai vu ici qu'il utilise cglib 2.2.
    J'en ai téléchargé 2 version mais l'exception est toujours présente.

  15. #15
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    91
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2012
    Messages : 91
    Par défaut
    Salut !
    J'ai enfin trouvé une réponse. Mon problème n'était en fait dû qu'à un manque de bibliothèques.
    En fait, la bibliothèque "cglib" s'utilise conjointement avec la bibliothèque "asm" du fait des dépendances extérieures de "cglib".
    Toutefois, "cglib" peut être utilisé seul; pour ce faire, il faut plutôt utiliser la bibliothèque "cglib-nodep".
    Merci à tchize_ pour son aide. : Ccool:

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

Discussions similaires

  1. [Framework] Spring AOP et AspectJ
    Par gh_rachid dans le forum Spring
    Réponses: 3
    Dernier message: 30/05/2014, 10h59
  2. Réponses: 36
    Dernier message: 21/03/2011, 16h54
  3. [Framework] Choisir entre Spring AOP ou le support AspectJ
    Par damien77 dans le forum Spring
    Réponses: 0
    Dernier message: 19/07/2009, 12h08
  4. [Framework] Spring AOP avec @AspectJ
    Par zooba dans le forum Spring
    Réponses: 1
    Dernier message: 27/03/2008, 17h06
  5. [Framework] Spring AOP et AspectJ
    Par Ganymede dans le forum Spring
    Réponses: 2
    Dernier message: 10/03/2008, 21h09

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