[
https://issues.jboss.org/browse/AS7-5347?page=com.atlassian.jira.plugin.s...
]
Eduardo Martins commented on AS7-5347:
--------------------------------------
Updated solution, which should solve AS7-2217 also:
The solution proposed in the linked PR is quite simple, list() looks up children entries
without dereferencing ManagedReferenceFactory values. Then, if the ManagedReferenceFactory
is an instance of InstanceTypeAwareManagedReferenceFactory, uses its method
getInstanceClassName() to obtain the entry's class name, otherwise it will use the
ManagedReferenceFactory concrete class name.
I've changed 2 ManagedReferenceFactory to support
InstanceTypeAwareManagedReferenceFactory, the one in
org.jboss.as.ejb3.deployment.processors.EjbContextJndiBindingProcessor (which is the one
related to this issue) and org.jboss.as.naming.ValueManagedReferenceFactory (needed for
existent naming tests). We should gather what others are used for bindings, and make these
support InstanceTypeAwareManagedReferenceFactory too (except when it's impossible to
know the instance class name in advance).
javax.naming.Context.list("java:module") failed
-----------------------------------------------
Key: AS7-5347
URL:
https://issues.jboss.org/browse/AS7-5347
Project: Application Server 7
Issue Type: Bug
Components: Naming
Affects Versions: 7.1.1.Final
Reporter: Cheng Fang
Assignee: Eduardo Martins
In a simple web app with ejb packaged in, invoke
InitialContext.list("java:module") within a servlet service method failed with
the following exception:
{noformat}
23:26:18,642 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/test].[test.TestServlet]]
(http-/127.0.0.1:8080-1) Servlet.service() for servlet test.TestServlet threw exception:
java.lang.RuntimeException: javax.naming.NamingException: JBAS014558: No EjbContext
available as no EJB invocation is active [Root exception is
java.lang.IllegalStateException: JBAS014558: No EjbContext available as no EJB invocation
is active]
at test.NamingTest.list(NamingTest.java:53) [classes:]
at test.TestServlet.doListing(TestServlet.java:28) [classes:]
at test.TestServlet.processRequest(TestServlet.java:22) [classes:]
at test.TestServlet.doGet(TestServlet.java:44) [classes:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
[jboss-servlet-api_3.0_spec-1.0.2.Final.jar:1.0.2.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
[jboss-servlet-api_3.0_spec-1.0.2.Final.jar:1.0.2.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
[jbossweb-7.0.16.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.16.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[jbossweb-7.0.16.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
[jbossweb-7.0.16.Final.jar:]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:156)
[jboss-as-web-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
[jbossweb-7.0.16.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[jbossweb-7.0.16.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[jbossweb-7.0.16.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
[jbossweb-7.0.16.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[jbossweb-7.0.16.Final.jar:]
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679)
[jbossweb-7.0.16.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931)
[jbossweb-7.0.16.Final.jar:]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_33]
Caused by: javax.naming.NamingException: JBAS014558: No EjbContext available as no EJB
invocation is active [Root exception is java.lang.IllegalStateException: JBAS014558: No
EjbContext available as no EJB invocation is active]
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:135)
at org.jboss.as.naming.ServiceBasedNamingStore.list(ServiceBasedNamingStore.java:166)
at org.jboss.as.naming.NamingContext.list(NamingContext.java:288)
at org.jboss.as.naming.InitialContext.list(InitialContext.java:161)
at org.jboss.as.naming.NamingContext.list(NamingContext.java:304)
at javax.naming.InitialContext.list(InitialContext.java:436) [classes.jar:1.6.0_33]
at test.NamingTest.list(NamingTest.java:51) [classes:]
... 18 more
Caused by: java.lang.IllegalStateException: JBAS014558: No EjbContext available as no EJB
invocation is active
at
org.jboss.as.ejb3.context.CurrentInvocationContext.getEjbContext(CurrentInvocationContext.java:48)
[jboss-as-ejb3-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at
org.jboss.as.ejb3.deployment.processors.EjbContextJndiBindingProcessor$1.getInstance(EjbContextJndiBindingProcessor.java:120)
[jboss-as-ejb3-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:133)
... 24 more
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira