Précédent   Forum des professionnels en informatique > Java > Serveurs, conteneurs, et Java EE > GlassFish
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 10/12/2011, 20h40   #1
Invité régulier
 
Homme roger tagne
Etudiant du Genie Logiciel
Inscription : juillet 2011
Messages : 29
Détails du profil
Informations personnelles :
Nom : Homme roger tagne
Localisation : Cameroun

Informations professionnelles :
Activité : Etudiant du Genie Logiciel
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : juillet 2011
Messages : 29
Points : 6
Points : 6
Par défaut Couche Service [EJB]

Salut les gars. lors du deploiement d'un module EJB que j'ai developpe , les serveur Glassfish me renvoit cette Exception :

Une erreur s'est produite
Error during deployment : Com/Elect/GLEP/clients/Locator/Service (wrong name: Com/Elect/GLEP/Clients/Locator/Service)

A premiere vue, cette exception est situee sur ma Couche Service. celle-ci (couche service) ne presente a priori aucune erreur . donc je ne comprends pas d'ou cette erreur. aidez moi a y voir plus clair .

voici ma couche service qui s'inspire de celle D'antonio Convalves :
Code :
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
 
 
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
 
package Com.Elect.GLEP.Clients.Locator ;
 
/**
 *
 * 
 */
import Com.Elect.GLEP.clients.Locator.ServiceLocatorException;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
 
import Com.Elect.GLEP.Util.Constants;
 
/**
 * This class enables Swing client to look for resources (like home, remote interfaces...).
 * It follows the singleton pattern
 */
 
public class Service {
 
    // ======================================
    // =             Attributes             =
    // ======================================
 
    private final String cname = this.getClass().getName() ;
    private Logger logger = Logger.getLogger(Constants.LOGGER_CLIENT) ;
 
    private Context initalContext ;
    private Map<String, Object> cache ;
 
 
    // ======================================
    // =             Singleton              =
    // ======================================
 
 
    private static final Service instance = new Service();
 
    public static Service getInstance() {
        return instance;
    }
 
    private Service() throws ServiceLocatorException {
 
        try {
            initalContext = new InitialContext();
            cache = new HashMap<String, Object>();
        } catch (Exception e) {
            throw new ServiceLocatorException(e);
        }
 
    }
 
    // ======================================
    // =           Business methods         =
    // ======================================
 
    /**
     * will get the ejb Local home factory. If this ejb home factory has already been
     * clients need to cast to the type of EJBHome they desire
     *
     * @param jndiName JNDI name of the EJB that we are looking for
     * @return the EJB Home corresponding to the homeName
     * @throws ServiceLocatorException thrown if lookup problems
     */
 
    public Object getRemoteInterface(String jndiName) throws ServiceLocatorException {
 
        String methodName = "getRemoteInterface" ;
        logger.entering(cname, methodName, jndiName) ;
        Object remoteInterface = getRemoteObject(jndiName) ;
        return remoteInterface ;
    }
 
    /**
     * @param connFactoryName Name of the connection factory that we are looking for
     * @return the factory for the factory to get queue connections from
     * @throws ServiceLocatorException thrown if lookup problems
     */
 
    public ConnectionFactory getConnectionFactory(String connFactoryName) throws ServiceLocatorException {
 
        String methodName = "getConnectionFactory";
        logger.entering(cname, methodName, connFactoryName);
        ConnectionFactory factory = (ConnectionFactory) getRemoteObject(connFactoryName);
 
        return factory;
    }
 
    public Destination getDestination(String destinationName) {
        String methodName = "getDestination" ;
        logger.entering(cname, methodName, destinationName) ;
        Destination destination = (Destination) getRemoteObject(destinationName) ;
        return destination;
    }
 
 
    // ======================================
    // =            Private methods         =
    // ======================================
 
    private synchronized Object getRemoteObject(String jndiName) throws ServiceLocatorException {
        String methodName = "getObject" ;
        logger.entering(cname, methodName, jndiName) ;
 
        Object remoteObject = cache.get(jndiName);
 
        if (remoteObject == null) {
            try {
                remoteObject = initalContext.lookup(jndiName);
                cache.put(jndiName, remoteObject);
            } catch (Exception e) {
                throw new ServiceLocatorException(e);
            }
        }
        return remoteObject;
    }
 
}
bza88 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 22h33.


 
 
 
 
Partenaires

Hébergement Web