JBoss Community

Can't find stateless ejb from web project in Jboss AS 7.1

created by Ali Ben in JBoss AS 7 Development - View the full discussion

I am new to ejb and Jboss world and i am facing a problem when trying to execute a stateless bean by its remote interface,

I am doing this:

System.out.println("########### Inscrire Action #############");

        Candidat c = new Candidat(nom, prenom, mail, telephone, ecole);

        try {

            final Properties env = new Properties();

            env.put(Context.INITIAL_CONTEXT_FACTORY,

                    org.jboss.naming.remote.client.InitialContextFactory.class

                            .getName());

            env.put(Context.PROVIDER_URL, "remote://localhost:4447");

            env.put(Context.SECURITY_PRINCIPAL, "UserApp");

            env.put(Context.SECURITY_CREDENTIALS, "password");

            InitialContext remoteContext = new InitialContext(env);

            System.out.println("########## Initial Context OK ##########");

 

            servicecandidat = (CandidatSessionRemote) remoteContext

                    .lookup("java:global/EtestEAProject/EtestMetier/CandidatSession!sessions.candidat.CandidatSessionRemote");

            System.out.println("########## LookUp OK ##########");

 

            if (servicecandidat.inscrireCandidat(c))

                return SUCCESS;

            else

                return ERROR;

        }

 

The console gives the folowing naming exeption

 

15:01:45,474 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) ########## Initial Context OK ##########

 

15:01:45,680 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) ########## LookUp Exchec ##########

 

15:01:45,682 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) javax.naming.NameNotFoundException: global/EtestEAProject/EtestMetier/CandidatSession!sessions.candidat.CandidatSessionRemote -- service jboss.naming.context.java.jboss.exported.global.EtestEAProject.EtestMetier."CandidatSession!sessions.candidat.CandidatSessionRemote"

 

15:01:45,685 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)     at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

 

15:01:45,687 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)     at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

 

15:01:45,689 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)     at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)

 

15:01:45,690 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)     at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)

 

15:01:45,692 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

 

15:01:45,693 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

 

15:01:45,695 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)     at java.lang.Thread.run(Unknown Source)

 

And the ejb jar deployments says:

 

java:global/EtestEAProject/EtestMetier/CandidatSession!sessions.candidat.CandidatSessionRemote

    java:app/EtestMetier/CandidatSession!sessions.candidat.CandidatSessionRemote

    java:module/CandidatSession!sessions.candidat.CandidatSessionRemote

    java:jboss/exported/EtestEAProject/EtestMetier/CandidatSession!sessions.candidat.CandidatSessionRemote

    java:global/EtestEAProject/EtestMetier/CandidatSession!sessions.candidat.CandidatSessionLocal

    java:app/EtestMetier/CandidatSession!sessions.candidat.CandidatSessionLocal

    java:module/CandidatSession!sessions.candidat.CandidatSessionLocal

 

PLEASE help I have been stucked for more than 2 days.....

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community