VinceSSJ | Est ce que tu pourrais détailler un peu SVP ? Je ne comprends pas tout.
"C'est bien de savoir comment ça marche, mais c'est géré pour toi. "
je n'en comprends pas le sens cherché.
"Fichier de properties + EJB Stateless qui tape dedans. "
Que veux tu dire par là ? que la classe constante se comporte comme un fichier properties ? Oui on va dire que c'est ça
EDIT :
En fait j'avais pas vu mais au lancement de l'appli dans le log tous les noms JNDI s'affichent
Code :
- INFO: EJB5181:Portable JNDI names for EJB AdminBean: [java:global/EAR_GdP2/ProjetGdP-ejb/AdminBean, java:global/EAR_GdP2/ProjetGdP-ejb/AdminBean!interfaces.AdminLocal]
|
Donc j'ai mis mes lookup adaptés :
Code :
- AdminLocal al = (AdminLocal)ctx.lookup("java:global/EAR_GdP2/ProjetGdP-ejb/AdminBean!interfaces.AdminLocal" );
|
Sauf que là j'ai une autre erreur.. GlassFish ne peut pas créer le bean...
Code :
- GRAVE: EJB5070: Exception creating stateless session bean : [AdminBean]
- ATTENTION: EJB5184:A system exception occurred during an invocation on EJB AdminBean, method: public util.data.Constante beans.AdminBean.getConstante(java.lang.String,java.lang.String)
- ATTENTION: javax.ejb.EJBException: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB
- at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:454)
- at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2547)
- at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1899)
- at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
- at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
- at $Proxy330.getConstante(Unknown Source)
- at util.Constantes.getString(Constantes.java:331)
- at util.Constantes.<clinit>(Constantes.java:275)
- at webGdP.servlet.filtre.AccessFilter.init(AccessFilter.java:98)
- at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
- at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
- at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
- at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
- at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
- at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
- at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
- at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
- at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
- at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
- at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
- at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
- at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
- at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
- at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
- at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
- at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:353)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
- at org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:126)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
- at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
- at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
- at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
- at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
- at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
- at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
- at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
- at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
- at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
- at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
- at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
- at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
- at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
- at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
- at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
- at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
- at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
- at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
- at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
- at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
- at java.lang.Thread.run(Thread.java:662)
- Caused by: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB
- at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:726)
- at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:247)
- at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:449)
- ... 58 more
- Caused by: javax.ejb.CreateException: Could not create stateless EJB
- at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:534)
- at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:95)
- at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:724)
- ... 60 more
- Caused by: java.lang.IllegalStateException: Exception lors de la tentative d'injection de l'élément Remote ejb-ref name=util.BaseBean/lcf,Remote 3.x interface =beans.ConnexionFactory,ejb-link=null,lookup=,mappedName=,jndi-name=beans.ConnexionFactory,refType=Session dans class util.BaseBean : Lookup failed for 'java:comp/env/util.BaseBean/lcf' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
- at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:137)
- at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
- at org.jboss.weld.bean.SessionBean$1.inject(SessionBean.java:172)
- at org.glassfish.weld.services.JCDIServiceImpl.injectEJBInstance(JCDIServiceImpl.java:223)
- at com.sun.ejb.containers.BaseContainer.injectEjbInstance(BaseContainer.java:1678)
- at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:494)
- ... 62 more
- Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Exception lors de la tentative d'injection de l'élément Remote ejb-ref name=util.BaseBean/lcf,Remote 3.x interface =beans.ConnexionFactory,ejb-link=null,lookup=,mappedName=,jndi-name=beans.ConnexionFactory,refType=Session dans class util.BaseBean : Lookup failed for 'java:comp/env/util.BaseBean/lcf' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
- at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:703)
- at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:470)
- at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:171)
- at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:130)
- ... 67 more
- Caused by: javax.naming.NamingException: Lookup failed for 'java:comp/env/util.BaseBean/lcf' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=util.BaseBean/lcf,Remote 3.x interface =beans.ConnexionFactory,ejb-link=null,lookup=,mappedName=,jndi-name=beans.ConnexionFactory,refType=Session' . Actual (possibly internal) Remote JNDI name used for lookup is 'beans.ConnexionFactory#beans.ConnexionFactory' [Root exception is javax.naming.NamingException: Lookup failed for 'beans.ConnexionFactory#beans.ConnexionFactory' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: beans.ConnexionFactory#beans.ConnexionFactory not found]]]
- at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
- at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
- at javax.naming.InitialContext.lookup(InitialContext.java:392)
- at javax.naming.InitialContext.lookup(InitialContext.java:392)
- at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:599)
- ... 70 more
- Caused by: javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=util.BaseBean/lcf,Remote 3.x interface =beans.ConnexionFactory,ejb-link=null,lookup=,mappedName=,jndi-name=beans.ConnexionFactory,refType=Session' . Actual (possibly internal) Remote JNDI name used for lookup is 'beans.ConnexionFactory#beans.ConnexionFactory' [Root exception is javax.naming.NamingException: Lookup failed for 'beans.ConnexionFactory#beans.ConnexionFactory' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: beans.ConnexionFactory#beans.ConnexionFactory not found]]
- at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:191)
- at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl$EjbReferenceProxy.create(ComponentEnvManagerImpl.java:1109)
- at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:776)
- at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:744)
- at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:169)
- at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
- ... 74 more
- Caused by: javax.naming.NamingException: Lookup failed for 'beans.ConnexionFactory#beans.ConnexionFactory' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: beans.ConnexionFactory#beans.ConnexionFactory not found]
- at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
- at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
- at javax.naming.InitialContext.lookup(InitialContext.java:392)
- at javax.naming.InitialContext.lookup(InitialContext.java:392)
- at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:186)
- ... 79 more
- Caused by: javax.naming.NameNotFoundException: beans.ConnexionFactory#beans.ConnexionFactory not found
- at com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:248)
- at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:215)
- at com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:77)
- at com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:119)
- at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:505)
- ... 83 more
|
Mais quand je regarde à la fin je m'aperçois que ça vient des autres lookup que je n'ai pas encore fait donc je persévère
Message édité par VinceSSJ le 06-07-2012 à 16:28:54
|