Newsgroup: it.comp.java
Titolo: Errore EJB

Salve a tutti,
sto riprendendo in mano dopo tanto tempo gli EJB ... ho trovato, per
iniziare, questo tutorial:
http://wiki.netbeans.org/CreatingEJB3UsingNetbeansAndGlassfish
mostra come creare - con l'accoppiata Netbeans e Glassfish - una
pagina web che invoca una servlet la quale, a sua volta, invoca un
session bean che ritorna il classico Hello World!
Tuttavia quando vado a cliccare sul link ottengo il seguente errore:
WebModule[/EnterpriseApplicationWithEJB-war]StandardWrapper.Throwable
java.lang.RuntimeException: WEB5002: Exception in handleBeforeEvent.
        at com.sun.web.server.J2EEInstanceListener.handleBeforeEvent
(J2EEInstanceListener.java:263)
        at com.sun.web.server.J2EEInstanceListener.instanceEvent
(J2EEInstanceListener.java:119)
        at org.apache.catalina.util.InstanceSupport.fireInstanceEvent
(InstanceSupport.java:347)
        at org.apache.catalina.core.StandardWrapper.loadServlet
(StandardWrapper.java:1179)
        at org.apache.catalina.core.StandardWrapper.allocate
(StandardWrapper.java:848)
        at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invokeInternal
(StandardContextValve.java:287)
        at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:218)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:
94)
        at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke
(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:222)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:1096)
        at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:166)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:1096)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service
(CoyoteAdapter.java:288)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter
(DefaultProcessorTask.java:647)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess
(DefaultProcessorTask.java:579)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process
(DefaultProcessorTask.java:831)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask
(DefaultReadTask.java:341)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask
(DefaultReadTask.java:263)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask
(DefaultReadTask.java:214)
        at com.sun.enterprise.web.portunif.PortUnificationPipeline
$PUTask.doTask(PortUnificationPipeline.java:380)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run
(TaskBase.java:265)
        at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run
(SSLWorkerThread.java:106)
Caused by: com.sun.enterprise.InjectionException: Exception attempting
to inject Unresolved Ejb-Ref TestServlet/testEJB@jndi:
stateless.TestEJBRemote@null@stateless.TestEJBRemote@Session@null into
class TestServlet
        at com.sun.enterprise.util.InjectionManagerImpl._inject
(InjectionManagerImpl.java:387)
        at com.sun.enterprise.util.InjectionManagerImpl.inject
(InjectionManagerImpl.java:206)
        at com.sun.enterprise.util.InjectionManagerImpl.injectInstance
(InjectionManagerImpl.java:117)
        at com.sun.web.server.J2EEInstanceListener.handleBeforeEvent
(J2EEInstanceListener.java:259)
        ... 31 more
Caused by: javax.naming.NameNotFoundException:
stateless.TestEJBRemote#stateless.TestEJBRemote not found
        at com.sun.enterprise.naming.TransientContext.doLookup
(TransientContext.java:216)
        at com.sun.enterprise.naming.TransientContext.lookup
(TransientContext.java:188)
        at com.sun.enterprise.naming.SerialContextProviderImpl.lookup
(SerialContextProviderImpl.java:74)
        at
com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup
(LocalSerialContextProviderImpl.java:111)
        at com.sun.enterprise.naming.SerialContext.lookup
(SerialContext.java:409)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.sun.enterprise.naming.NamingManagerImpl.lookup
(NamingManagerImpl.java:944)
        at com.sun.enterprise.naming.java.javaURLContext.lookup
(javaURLContext.java:173)
        at com.sun.enterprise.naming.SerialContext.lookup
(SerialContext.java:407)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.sun.enterprise.util.InjectionManagerImpl._inject
(InjectionManagerImpl.java:287)
        ... 34 more
StandardWrapperValve[TestServlet]: PWC1382: Allocate exception for
servlet TestServlet
java.lang.RuntimeException: WEB5002: Exception in handleBeforeEvent.
        at com.sun.web.server.J2EEInstanceListener.handleBeforeEvent
(J2EEInstanceListener.java:263)
        at com.sun.web.server.J2EEInstanceListener.instanceEvent
(J2EEInstanceListener.java:119)
        at org.apache.catalina.util.InstanceSupport.fireInstanceEvent
(InstanceSupport.java:347)
        at org.apache.catalina.core.StandardWrapper.loadServlet
(StandardWrapper.java:1179)
        at org.apache.catalina.core.StandardWrapper.allocate
(StandardWrapper.java:848)
        at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invokeInternal
(StandardContextValve.java:287)
        at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:218)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:
94)
        at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke
(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:222)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:1096)
        at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:166)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke
(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:1096)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service
(CoyoteAdapter.java:288)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter
(DefaultProcessorTask.java:647)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess
(DefaultProcessorTask.java:579)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process
(DefaultProcessorTask.java:831)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask
(DefaultReadTask.java:341)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask
(DefaultReadTask.java:263)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask
(DefaultReadTask.java:214)
        at com.sun.enterprise.web.portunif.PortUnificationPipeline
$PUTask.doTask(PortUnificationPipeline.java:380)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run
(TaskBase.java:265)
        at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run
(SSLWorkerThread.java:106)
Caused by: com.sun.enterprise.InjectionException: Exception attempting
to inject Unresolved Ejb-Ref TestServlet/testEJB@jndi:
stateless.TestEJBRemote@null@stateless.TestEJBRemote@Session@null into
class TestServlet
        at com.sun.enterprise.util.InjectionManagerImpl._inject
(InjectionManagerImpl.java:387)
        at com.sun.enterprise.util.InjectionManagerImpl.inject
(InjectionManagerImpl.java:206)
        at com.sun.enterprise.util.InjectionManagerImpl.injectInstance
(InjectionManagerImpl.java:117)
        at com.sun.web.server.J2EEInstanceListener.handleBeforeEvent
(J2EEInstanceListener.java:259)
        ... 31 more
Caused by: javax.naming.NameNotFoundException:
stateless.TestEJBRemote#stateless.TestEJBRemote not found
        at com.sun.enterprise.naming.TransientContext.doLookup
(TransientContext.java:216)
        at com.sun.enterprise.naming.TransientContext.lookup
(TransientContext.java:188)
        at com.sun.enterprise.naming.SerialContextProviderImpl.lookup
(SerialContextProviderImpl.java:74)
        at
com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup
(LocalSerialContextProviderImpl.java:111)
        at com.sun.enterprise.naming.SerialContext.lookup
(SerialContext.java:409)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.sun.enterprise.naming.NamingManagerImpl.lookup
(NamingManagerImpl.java:944)
        at com.sun.enterprise.naming.java.javaURLContext.lookup
(javaURLContext.java:173)
        at com.sun.enterprise.naming.SerialContext.lookup
(SerialContext.java:407)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.sun.enterprise.util.InjectionManagerImpl._inject
(InjectionManagerImpl.java:287)
Qualcuno potrebbe illuminarmi sul problema?

 Qualcuno potrebbe illuminarmi sul problema?
Ipotesi.
Stai usando GlassFish Prelude?? Forse � quello il problema.

 Stai usando GlassFish Prelude?? Forse è quello il problema.
Bingo!
Ho startato Glassfish 2.1, invece del v3 Prelude Domain e ora
funziona.
Come mai il Prelude non funziona?

 Come mai il Prelude non funziona?
Perch� � un  prototipo-tecnologico che manca di features.
adesso � uscita la definitiva.

 Come mai il Prelude non funziona?
P.s: Sono stato utile.....!!!!!
EVVIVVA!!


:-))))))
Per la cronaca, ho scaricato la nuova versione di Glassfish ... ora
funziona!!!