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

Wildfly/JBoss Java Discussion :

javax.naming.NameNotFoundException: remote not bound


Sujet :

Wildfly/JBoss Java

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Février 2007
    Messages : 12
    Points : 10
    Points
    10
    Par défaut javax.naming.NameNotFoundException: remote not bound
    Bonjour à tous,

    je sais que le meme titre de post se trouve juste en dessous de celui-ci mais le problème est un poil différent et l'on m'a dit d'ouvrir une nouvelle discussion.

    Je vous expose le probleme, je développe sous netbeans 5.5 et JBoss 4.0.5.
    Nous developpons une application dont la database existe deja et se trouve sous mysql. J'ai donc installé la db sur mon ordi et a partir de celle-ci, j'ai créé mes entity grace a netbeans (menu: create entity from database) . J'ai ensuite créé ma persistence Unit avec une nouvelle data source pour mysql. Apres cela j'ai créé mes sessions beans pour mes entity et jusque la tout va bien.

    Le premier probleme est arrivé qd j'ai voulu ecrire un petit client utilisant le jndi context, voir ici.

    Ensuite sont arrivés les problemes de '-' (tirets) dans les noms de mes table sql

    Ensuite, le code des entity généré a partir de la db etait assez bizarre:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "reqPersonsA")
        private Collection<PersonsLanguages> personsLanguagesCollection;
     
        @OneToMany(cascade = CascadeType.ALL, mappedBy = "reqPersonsA1")
        private Collection<PersonsLanguages> personsLanguagesCollection1;
    Il m'a créé dans casi toutes mes classes des variables en double apparemment, se terminant par '1'...

    Autre exemple ici:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     @JoinColumn(name = "CONTACT", referencedColumnName = "ID")
        @ManyToOne
        private Representatives contact;
     
     
        @JoinColumn(name = "CONTACT", referencedColumnName = "ID")
        @ManyToOne
        private Representatives contact1;
    J'ai donc mis en commentaire tous les bouts de code qui avait l'air en double car j'avais alors des noms de colonnes redondant dans mes tables et netbeans plantait lors du déployement.

    Une fois le code corrigé, et que mon projet se déployait enfin correctement, je retombe sur mon premier probleme qui est maintenant:

    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
    javax.naming.NameNotFoundException: remote not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
            at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
            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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
            at sun.rmi.transport.Transport$1.run(Transport.java:153)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
            at java.lang.Thread.run(Thread.java:613)
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
            at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
            at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at client.InitDB.main(InitDB.java:23)

    Et la je seche completement, je ne vois pas d'ou vient l'erreur. Voici le code des classes impliquées:


    Mon client:
    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
    package client;
     
     
    import bo.ReqPersonsA;
    import dao.ReqPersonsAFacadeLocal;
    import java.util.Hashtable;
    import java.util.Properties;
    import javax.ejb.EJB;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
     
    public class InitDB {
     
    	// @EJB private static JoueurDao jB;
     
    	public static void main(String[] args) {
     
    		try {
     
    			Context jndiContext = getInitialContext();
     
    			Object ref = jndiContext.lookup("EAW2/ReqPersonsAFacade/remote");
    			ReqPersonsAFacadeLocal rpdao = (ReqPersonsAFacadeLocal) ref;
     
     
     
                            ReqPersonsA rp1 = new ReqPersonsA();
                            rp1.setName("Alejandro");
                            rp1.setForname("Alonzo");
                            rp1.setMaidenName("DeBosque");
                            rp1.setAliase("El chiquito");
                            rp1.setSex('M');
                            rp1.setNationality("Spain");
     
    			rpdao.create(rp1);
                            rp1.setId(rp1.getId());
                            System.out.println("Ajout personne ok");
     
     
    		} catch (javax.naming.NamingException ne) {
    			ne.printStackTrace();
    		}
     
    	}
     
    	private static Context getInitialContext() throws NamingException {
     
     
                    Properties env = new Properties();
                    env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                    env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
                    env.put(Context.PROVIDER_URL, "localhost:1099");
     
    		return new InitialContext(env);
    	}
     
     
     
    }
    ReqPersonsAFacade
    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
     
     
     
    package dao;
     
    import bo.ReqPersonsA;
    import java.util.List;
    import javax.ejb.Remote;
    import javax.ejb.Local;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
     
    /**
     *
     * @author imacx
     */
    @Stateless
     
    public class ReqPersonsAFacade implements ReqPersonsAFacadeLocal {
     
        @PersistenceContext
        private EntityManager em;
     
        /** Creates a new instance of ReqPersonsAFacade */
        public ReqPersonsAFacade() {
        }
     
        public void create(ReqPersonsA reqPersonsA) {
            em.persist(reqPersonsA);
        }
     
        public void edit(ReqPersonsA reqPersonsA) {
            em.merge(reqPersonsA);
        }
     
        public void destroy(ReqPersonsA reqPersonsA) {
            em.merge(reqPersonsA);
            em.remove(reqPersonsA);
        }
     
        public ReqPersonsA find(Object pk) {
            return (ReqPersonsA) em.find(ReqPersonsA.class, pk);
        }
     
        public List findAll() {
            return em.createQuery("select object(o) from ReqPersonsA as o").getResultList();
        }
     
    }

    ReqPersonsAFacadeLocal
    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
    package dao;
     
    import bo.ReqPersonsA;
    import java.util.List;
    import javax.ejb.Local;
    import javax.ejb.Remote;
     
    /**
     *
     * @author imacx
     */
    @Local
    public interface ReqPersonsAFacadeLocal {
        void create(ReqPersonsA reqPersonsA);
     
        void edit(ReqPersonsA reqPersonsA);
     
        void destroy(ReqPersonsA reqPersonsA);
     
        ReqPersonsA find(Object pk);
     
        List findAll();
     
    }

    ReqPersonsA
    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
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
     
    package bo;
     
    import java.io.Serializable;
    import java.util.Collection;
    import java.util.Date;
    import javax.persistence.CascadeType;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.Lob;
    import javax.persistence.OneToMany;
    import javax.persistence.Table;
    import javax.persistence.Temporal;
    import javax.persistence.TemporalType;
     
    /**
     * Entity class ReqPersonsA
     * 
     * @author imacx
     */
    @Entity
    @Table(name = "req_persons_a")
    public class ReqPersonsA implements Serializable {
     
        @Id
        @Column(name = "ID", nullable = false)
        private Integer id;
     
        @Column(name = "NAME")
        private String name;
     
        @Column(name = "FORNAME")
        private String forname;
     
        @Column(name = "MAIDEN_NAME")
        private String maidenName;
     
        @Column(name = "ALIASE")
        private String aliase;
     
        @Column(name = "SEX")
        private Character sex;
     
        @Column(name = "NATIONALITY")
        private String nationality;
     
        @Column(name = "BIRTH_DATE")
        @Temporal(TemporalType.DATE)
        private Date birthDate;
     
        @Column(name = "BIRTH_PLACE")
        private String birthPlace;
     
        @Lob
        @Column(name = "PHOTO")
        private byte [] photo;
     
        @Lob
        @Column(name = "DISTINCTIVE_MARKS")
        private String distinctiveMarks;
     
        @Lob
        @Column(name = "FINGERPRINTS")
        private byte [] fingerprints;
     
        @Lob
        @Column(name = "ADN")
        private String adn;
     
        @Lob
        @Column(name = "ADDRESS")
        private String address;
     
        @OneToMany(cascade = CascadeType.ALL, mappedBy = "reqPersonsA")
        private Collection<PersonsLanguages> personsLanguagesCollection;
     
    //    @OneToMany(cascade = CascadeType.ALL, mappedBy = "reqPersonsA1")
    //    private Collection<PersonsLanguages> personsLanguagesCollection1;
     
        @OneToMany(cascade = CascadeType.ALL, mappedBy = "personId")
        private Collection<EuArrestWarrant> euArrestWarrantCollection;
     
        /** Creates a new instance of ReqPersonsA */
        public ReqPersonsA() {
        }
     
        /**
         * Creates a new instance of ReqPersonsA with the specified values.
         * @param id the id of the ReqPersonsA
         */
        public ReqPersonsA(Integer id) {
            this.id = id;
        }
     
        /**
         * Gets the id of this ReqPersonsA.
         * @return the id
         */
        public Integer getId() {
            return this.id;
        }
     
        /**
         * Sets the id of this ReqPersonsA to the specified value.
         * @param id the new id
         */
        public void setId(Integer id) {
            this.id = id;
        }
     
        /**
         * Gets the name of this ReqPersonsA.
         * @return the name
         */
        public String getName() {
            return this.name;
        }
     
        /**
         * Sets the name of this ReqPersonsA to the specified value.
         * @param name the new name
         */
        public void setName(String name) {
            this.name = name;
        }
     
        /**
         * Gets the forname of this ReqPersonsA.
         * @return the forname
         */
        public String getForname() {
            return this.forname;
        }
     
        /**
         * Sets the forname of this ReqPersonsA to the specified value.
         * @param forname the new forname
         */
        public void setForname(String forname) {
            this.forname = forname;
        }
     
        /**
         * Gets the maidenName of this ReqPersonsA.
         * @return the maidenName
         */
        public String getMaidenName() {
            return this.maidenName;
        }
     
        /**
         * Sets the maidenName of this ReqPersonsA to the specified value.
         * @param maidenName the new maidenName
         */
        public void setMaidenName(String maidenName) {
            this.maidenName = maidenName;
        }
     
        /**
         * Gets the aliase of this ReqPersonsA.
         * @return the aliase
         */
        public String getAliase() {
            return this.aliase;
        }
     
        /**
         * Sets the aliase of this ReqPersonsA to the specified value.
         * @param aliase the new aliase
         */
        public void setAliase(String aliase) {
            this.aliase = aliase;
        }
     
        /**
         * Gets the sex of this ReqPersonsA.
         * @return the sex
         */
        public Character getSex() {
            return this.sex;
        }
     
        /**
         * Sets the sex of this ReqPersonsA to the specified value.
         * @param sex the new sex
         */
        public void setSex(Character sex) {
            this.sex = sex;
        }
     
        /**
         * Gets the nationality of this ReqPersonsA.
         * @return the nationality
         */
        public String getNationality() {
            return this.nationality;
        }
     
        /**
         * Sets the nationality of this ReqPersonsA to the specified value.
         * @param nationality the new nationality
         */
        public void setNationality(String nationality) {
            this.nationality = nationality;
        }
     
        /**
         * Gets the birthDate of this ReqPersonsA.
         * @return the birthDate
         */
        public Date getBirthDate() {
            return this.birthDate;
        }
     
        /**
         * Sets the birthDate of this ReqPersonsA to the specified value.
         * @param birthDate the new birthDate
         */
        public void setBirthDate(Date birthDate) {
            this.birthDate = birthDate;
        }
     
        /**
         * Gets the birthPlace of this ReqPersonsA.
         * @return the birthPlace
         */
        public String getBirthPlace() {
            return this.birthPlace;
        }
     
        /**
         * Sets the birthPlace of this ReqPersonsA to the specified value.
         * @param birthPlace the new birthPlace
         */
        public void setBirthPlace(String birthPlace) {
            this.birthPlace = birthPlace;
        }
     
        /**
         * Gets the photo of this ReqPersonsA.
         * @return the photo
         */
        public byte [] getPhoto() {
            return this.photo;
        }
     
        /**
         * Sets the photo of this ReqPersonsA to the specified value.
         * @param photo the new photo
         */
        public void setPhoto(byte [] photo) {
            this.photo = photo;
        }
     
        /**
         * Gets the distinctiveMarks of this ReqPersonsA.
         * @return the distinctiveMarks
         */
        public String getDistinctiveMarks() {
            return this.distinctiveMarks;
        }
     
        /**
         * Sets the distinctiveMarks of this ReqPersonsA to the specified value.
         * @param distinctiveMarks the new distinctiveMarks
         */
        public void setDistinctiveMarks(String distinctiveMarks) {
            this.distinctiveMarks = distinctiveMarks;
        }
     
        /**
         * Gets the fingerprints of this ReqPersonsA.
         * @return the fingerprints
         */
        public byte [] getFingerprints() {
            return this.fingerprints;
        }
     
        /**
         * Sets the fingerprints of this ReqPersonsA to the specified value.
         * @param fingerprints the new fingerprints
         */
        public void setFingerprints(byte [] fingerprints) {
            this.fingerprints = fingerprints;
        }
     
        /**
         * Gets the adn of this ReqPersonsA.
         * @return the adn
         */
        public String getAdn() {
            return this.adn;
        }
     
        /**
         * Sets the adn of this ReqPersonsA to the specified value.
         * @param adn the new adn
         */
        public void setAdn(String adn) {
            this.adn = adn;
        }
     
        /**
         * Gets the address of this ReqPersonsA.
         * @return the address
         */
        public String getAddress() {
            return this.address;
        }
     
        /**
         * Sets the address of this ReqPersonsA to the specified value.
         * @param address the new address
         */
        public void setAddress(String address) {
            this.address = address;
        }
     
        /**
         * Gets the personsLanguagesCollection of this ReqPersonsA.
         * @return the personsLanguagesCollection
         */
        public Collection<PersonsLanguages> getPersonsLanguagesCollection() {
            return this.personsLanguagesCollection;
        }
     
        /**
         * Sets the personsLanguagesCollection of this ReqPersonsA to the specified value.
         * @param personsLanguagesCollection the new personsLanguagesCollection
         */
        public void setPersonsLanguagesCollection(Collection<PersonsLanguages> personsLanguagesCollection) {
            this.personsLanguagesCollection = personsLanguagesCollection;
        }
     
    //    /**
    //     * Gets the personsLanguagesCollection1 of this ReqPersonsA.
    //     * @return the personsLanguagesCollection1
    //     */
    //    public Collection<PersonsLanguages> getPersonsLanguagesCollection1() {
    //        return this.personsLanguagesCollection1;
    //    }
    //
    //    /**
    //     * Sets the personsLanguagesCollection1 of this ReqPersonsA to the specified value.
    //     * @param personsLanguagesCollection1 the new personsLanguagesCollection1
    //     */
    //    public void setPersonsLanguagesCollection1(Collection<PersonsLanguages> personsLanguagesCollection1) {
    //        this.personsLanguagesCollection1 = personsLanguagesCollection1;
    //    }
     
        /**
         * Gets the euArrestWarrantCollection of this ReqPersonsA.
         * @return the euArrestWarrantCollection
         */
        public Collection<EuArrestWarrant> getEuArrestWarrantCollection() {
            return this.euArrestWarrantCollection;
        }
     
        /**
         * Sets the euArrestWarrantCollection of this ReqPersonsA to the specified value.
         * @param euArrestWarrantCollection the new euArrestWarrantCollection
         */
        public void setEuArrestWarrantCollection(Collection<EuArrestWarrant> euArrestWarrantCollection) {
            this.euArrestWarrantCollection = euArrestWarrantCollection;
        }
     
        /**
         * Returns a hash code value for the object.  This implementation computes 
         * a hash code value based on the id fields in this object.
         * @return a hash code value for this object.
         */
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (this.id != null ? this.id.hashCode() : 0);
            return hash;
        }
     
        /**
         * Determines whether another object is equal to this ReqPersonsA.  The result is 
         * <code>true</code> if and only if the argument is not null and is a ReqPersonsA object that 
         * has the same id field values as this object.
         * @param object the reference object with which to compare
         * @return <code>true</code> if this object is the same as the argument;
         * <code>false</code> otherwise.
         */
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof ReqPersonsA)) {
                return false;
            }
            ReqPersonsA other = (ReqPersonsA)object;
            if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
            return true;
        }
     
        /**
         * Returns a string representation of the object.  This implementation constructs 
         * that representation based on the id fields.
         * @return a string representation of the object.
         */
        @Override
        public String toString() {
            return "bo.ReqPersonsA[id=" + id + "]";
        }
     
    }
    Viendrait-elle du chemin que j'utilise qd je fais mon lookup?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Object ref = jndiContext.lookup("EAW2/ReqPersonsAFacade/remote");
    Merci pour votre aide

  2. #2
    Membre confirmé Avatar de toomsounet
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    481
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 481
    Points : 576
    Points
    576
    Par défaut
    @Local
    public interface ReqPersonsAFacadeLocal {
    void create(ReqPersonsA reqPersonsA);


    et

    Object ref = jndiContext.lookup("EAW2/ReqPersonsAFacade/remote");

    c'est un session bean accessible en local, tu ne devrais pas écrire plutot:
    Object ref = jndiContext.lookup("EAW2/ReqPersonsAFacade/local");

    ?

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Février 2007
    Messages : 12
    Points : 10
    Points
    10
    Par défaut
    Non,sinon j'ai cette erreur ci:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    Exception in thread "main" javax.ejb.EJBException: Invalid invocation of local interface (null container)
            at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:75)
            at $Proxy0.create(Unknown Source)
            at client.InitDB.main(InitDB.java:36)
    Et en cherchant, j'ai vu qu'il fallait mettre /remote. Chose que j'ai d'ailleurs toujours fait dans mes autres programmes sans avoir d'erreur.

  4. #4
    Membre éclairé Avatar de XmasRock
    Inscrit en
    Janvier 2007
    Messages
    729
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 729
    Points : 821
    Points
    821
    Par défaut
    une interface @Local ne peut pas être invoquée en dehors du conteneur. Il te faut une interface marquée @Remote implémentée par ton bean.

  5. #5
    Membre éclairé Avatar de XmasRock
    Inscrit en
    Janvier 2007
    Messages
    729
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 729
    Points : 821
    Points
    821
    Par défaut
    Dans la console JMX de ton JBoss AS (http://localhost:8080/jmx-console) cliques sur le lien JNDIView et invoke l'operation "list" tu verras les éléments disponibles dans l'arbre JNDI. La partie globale est visible de l'exterieur.

    http://jboss.org/wiki/Wiki.jsp?page=...hTheJMXConsole

  6. #6
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Février 2007
    Messages : 12
    Points : 10
    Points
    10
    Par défaut
    Voila l'élément disponible dans l'arbre jndi global:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    EAW2 (class: org.jnp.interfaces.NamingContext)
      |   +- ReqPersonsAFacade (class: org.jnp.interfaces.NamingContext)
      |   |   +- local (proxy: $Proxy132 implements interface dao.ReqPersonsAFacadeLocal,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
    Et si je mets @remote sur l'interface 'ReqPersonsAFacadeLocal', j'ai toujours la meme erreur

  7. #7
    Membre éclairé Avatar de XmasRock
    Inscrit en
    Janvier 2007
    Messages
    729
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 729
    Points : 821
    Points
    821
    Par défaut
    Tu ne devrais pas.
    Il faut refaire un point:
    - Ton client invoque bien jndiContext.lookup("EAW2/ReqPersonsAFacade/remote");
    - Ton arbre JNDI montre bien :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    EAW2 (class: org.jnp.interfaces.NamingContext)
      |   +- ReqPersonsAFacade (class: org.jnp.interfaces.NamingContext)
      |   |   +- remote (proxy: $Proxy132 implements interface dao.ReqPersonsAFacade,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
    ou dao.ReqPersonsAFacade est l'interface avec @Remote d'où la présence de javax.ejb.EJBObject dans l'arbre JNDI à la place de javax.ejb.EJBLocalObject

    Chez moi ça fonctionne bien.

  8. #8
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Février 2007
    Messages : 12
    Points : 10
    Points
    10
    Par défaut
    Ok, mez culpa, j'ai remplacé le @Local par @Remote mais j'avais pas redéployé...

    Apres un redeploy, tout s'est bien passé, ce cher Alejandro est dans ma DB

    Merci à toi!

  9. #9
    Membre du Club
    Inscrit en
    Mars 2007
    Messages
    61
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 61
    Points : 44
    Points
    44
    Par défaut
    salut a tous,

    j'ai presque le meme sujet , mais voici mon erreur:

    ERROR [STDERR] java.lang.ClassCastException: $Proxy84
    2007-03-13 17:12:17,477 ERROR [STDERR] at web.UserInfo.authentifier(UserInfo.java:149)
    2007-03-13 17:12:17,477 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2007-03-13 17:12:17,477 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    2007-03-13 17:12:17,477 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    2007-03-13 17:12:17,477 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
    2007-03-13 17:12:17,477 ERROR [STDERR] at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
    2007-03-13 17:12:17,477 ERROR [STDERR] at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
    2007-03-13 17:12:17,477 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:312)
    2007-03-13 17:12:17,477 ERROR [STDERR] at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
    2007-03-13 17:12:17,477 ERROR [STDERR] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)

  10. #10
    Membre éclairé Avatar de XmasRock
    Inscrit en
    Janvier 2007
    Messages
    729
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 729
    Points : 821
    Points
    821
    Par défaut
    C'est pas du tout le même sujet.
    Peux-tu ouvrir une nouvelle discussion et donner plus d'info sur ton problème stp ?

  11. #11
    Membre à l'essai
    Étudiant
    Inscrit en
    Avril 2008
    Messages
    23
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2008
    Messages : 23
    Points : 13
    Points
    13
    Par défaut
    Bonjour,
    J'ai vu le sujet et je pense avoir le même problème mais avec quelques différences dans le Global JNDI NameSpace.

    Voici l'erreur que j'ai dans la console de JBoss 4.2:

    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
     
    FATAL [application] com.ServiceLocatorException: javax.naming.NameNotFoundException: GestionInfoClient not bound
    javax.faces.el.EvaluationException: com.ServiceLocatorException: javax.naming.NameNotFoundException: GestionInfoClient not bound
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
    	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
    	at javax.faces.component.UICommand.broadcast(UICommand.java:383)
    	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
    	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
    	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
    	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
    	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: com.ServiceLocatorException: javax.naming.NameNotFoundException: GestionInfoClient not bound
    	at com.ServiceLocator.getRemoteInterface(ServiceLocator.java:41)
    	at controll.InfoClient.getSessionFacadeDAORemote(InfoClient.java:103)
    	at controll.InfoClient.execute(InfoClient.java:93)
    	at controll.InfoClient.test(InfoClient.java:76)
    	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.el.parser.AstValue.invoke(AstValue.java:131)
    	at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
    	at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
    	... 26 more
    Et ceci est le Global JNDI Namespace :

    Global JNDI Namespace

    +- InfoClientXmlShemaDAO (class: org.jnp.interfaces.NamingContext)
    | +- local (proxy: $Proxy97 implements interface dao.InfoClientXmlShemaDAOLocal,interface org.jboss.ejb3.JBossProxy)
    +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
    +- jmx (class: org.jnp.interfaces.NamingContext)
    | +- invoker (class: org.jnp.interfaces.NamingContext)
    | | +- RMIAdaptor (proxy: $Proxy47 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
    | +- rmi (class: org.jnp.interfaces.NamingContext)
    | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
    +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
    +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
    +- UserTransactionSessionFactory (proxy: $Proxy14 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
    +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
    +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
    +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
    +- CompteDAO (class: org.jnp.interfaces.NamingContext)
    | +- local (proxy: $Proxy94 implements interface dao.CompteDAOLocal,interface org.jboss.ejb3.JBossProxy)
    +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
    +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
    +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
    +- queue (class: org.jnp.interfaces.NamingContext)
    | +- A (class: org.jboss.mq.SpyQueue)
    | +- testQueue (class: org.jboss.mq.SpyQueue)
    | +- ex (class: org.jboss.mq.SpyQueue)
    | +- DLQ (class: org.jboss.mq.SpyQueue)
    | +- D (class: org.jboss.mq.SpyQueue)
    | +- C (class: org.jboss.mq.SpyQueue)
    | +- B (class: org.jboss.mq.SpyQueue)
    +- topic (class: org.jnp.interfaces.NamingContext)
    | +- testDurableTopic (class: org.jboss.mq.SpyTopic)
    | +- testTopic (class: org.jboss.mq.SpyTopic)
    | +- securedTopic (class: org.jboss.mq.SpyTopic)
    +- console (class: org.jnp.interfaces.NamingContext)
    | +- PluginManager (proxy: $Proxy48 implements interface org.jboss.console.manager.PluginManagerMBean)
    +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
    +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
    +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
    +- persistence.units:jar=SabEjb.jar,unitName=SABProject (class: org.hibernate.impl.SessionFactoryImpl)
    +- GestionInfoClientRemote (class: org.jnp.interfaces.NamingContext)
    | +- local (proxy: $Proxy101 implements interface service.GestionInfoClientLocal,interface org.jboss.ejb3.JBossProxy)
    | +- remote (proxy: $Proxy100 implements interface service.GestionInfoClientRemote,interface org.jboss.ejb3.JBossProxy)
    +- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)
    +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
    Merci

  12. #12
    Membre à l'essai
    Étudiant
    Inscrit en
    Avril 2008
    Messages
    23
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2008
    Messages : 23
    Points : 13
    Points
    13
    Par défaut
    Ca pourra peut être vous aider pour m'aider

    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
    public Object getRemoteInterface(String jndiName)throws ServiceLocatorException 
    	{
    	System.out.println("1");
    	Object remoteInterface = cache.get(jndiName);
    	System.out.println("2");
    	if (remoteInterface == null) {
    		try {
    			System.out.println("3");
    			remoteInterface = initalContext.lookup(jndiName);
    			System.out.println("4");
    			cache.put(jndiName, remoteInterface);
    			System.out.println("5");
    	} catch (Exception e) {
    		throw new ServiceLocatorException(e);}}
       return remoteInterface;}
     
    }
    et le résultat dans la console est :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    17:27:04,239 INFO  [STDOUT] 1
    17:27:04,240 INFO  [STDOUT] 2
    17:27:04,240 INFO  [STDOUT] 3
    17:27:04,240 INFO  [STDOUT] GestionInfoClient not bound
    17:27:04,240 FATAL [application] com.ServiceLocatorException: javax.naming.NameNotFoundException: GestionInfoClient not bound
    L'exécution s'arrête au niveau de :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    remoteInterface = initalContext.lookup(jndiName);

  13. #13
    Futur Membre du Club
    Inscrit en
    Mars 2010
    Messages
    10
    Détails du profil
    Informations forums :
    Inscription : Mars 2010
    Messages : 10
    Points : 5
    Points
    5
    Par défaut
    slt, c'est un ancien sujet
    prière de m'aider vue que j'ai le meme probleme que notre ami.

    moi je ne vois pas l'arbre jboss.system.type=jndiView

    comment la faire apparaitre??

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

Discussions similaires

  1. Réponses: 9
    Dernier message: 05/06/2010, 22h04
  2. javax.naming.NameNotFoundException: LocalMonBean not bound
    Par neyo_am dans le forum Wildfly/JBoss
    Réponses: 7
    Dernier message: 21/07/2009, 23h25
  3. JBoss 4.2.3 javax.naming.NameNotFoundException: Bean not bound
    Par altair_606 dans le forum Wildfly/JBoss
    Réponses: 7
    Dernier message: 11/06/2009, 17h10
  4. [JNDI] javax.naming.NameNotFoundException: PremierEJB3 not bound
    Par champion dans le forum Java EE
    Réponses: 2
    Dernier message: 19/02/2008, 11h03
  5. [EJB Stateless] javax.naming.NameNotFoundException: ejb not bound
    Par slymira dans le forum Java EE
    Réponses: 18
    Dernier message: 04/07/2005, 15h30

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