Web Filter's init() method executed before EJBs are deployed
------------------------------------------------------------
Key: JBAS-8897
URL:
https://issues.jboss.org/browse/JBAS-8897
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: EJB3
Affects Versions: 6.0.0.Final
Reporter: Jozef Hartinger
Assignee: Carlo de Wolf
Priority: Blocker
Having a singleton (or stateless session) bean
@Singleton
@Startup
@ApplicationScoped
public class Echo
{
public boolean ping()
{
return true;
}
}
and a web filter
@WebFilter(urlPatterns = "/*")
public class Filter implements javax.servlet.Filter
{
private static final Logger log = Logger.getLogger(Filter.class);
@Inject
private Echo echo;
@Override
public void init(FilterConfig filterConfig) throws ServletException
{
log.info("Init starting");
echo.ping();
log.info("Init done");
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws IOException, ServletException
{
chain.doFilter(request, response);
}
@Override
public void destroy()
{
}
}
Deployment of the application fails with the following exception:
10:56:57,152 INFO [org.jboss.seam.rest.test.compat.ejb.deployment.Filter] Init starting
10:56:57,153 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/test]] Exception
starting filter org.jboss.seam.rest.test.compat.ejb.deployment.Filter:
org.jboss.weld.exceptions.CreationException: WELD-000079 Could not find the EJB in JNDI:
class
org.jboss.seam.rest.test.compat.ejb.deployment.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$home$jharting$jboss$RESTEasy-int-clean$jboss-6$0$0$Final$server$default$deploy$test$war"-SessionBean-Echo_$$_WeldProxy
at org.jboss.weld.bean.SessionBean.create(SessionBean.java:348) [:6.0.0.Final]
at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:121)
[:6.0.0.Final]
at
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
[:6.0.0.Final]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:87)
[:6.0.0.Final]
at
org.jboss.seam.rest.test.compat.ejb.deployment.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$home$jharting$jboss$RESTEasy-int-clean$jboss-6$0$0$Final$server$default$deploy$test$war"-SessionBean-Echo_$$_WeldClientProxy.ping(org$jboss$weld$bean-jboss$classloader:id="vfs:$$$home$jharting$jboss$RESTEasy-int-clean$jboss-6$0$0$Final$server$default$deploy$test$war"-SessionBean-Echo_$$_WeldClientProxy.java)
at org.jboss.seam.rest.test.compat.ejb.deployment.Filter.init(Filter.java:29) [:]
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447)
[:6.0.0.Final]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3246)
[:6.0.0.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3843)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:294)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
[:6.0.0.Final]
at
org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:477)
[:6.0.0.Final]
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
[:6.0.0.Final]
at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0.Final]
at sun.reflect.GeneratedMethodAccessor405.invoke(Unknown Source) [:1.6.0_23]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[:1.6.0_23]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
[:6.0.0.GA]
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
[:6.0.0.GA]
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
[:6.0.0.GA]
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
[:2.2.0.GA]
at $Proxy41.start(Unknown Source) at
org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53)
[:2.2.0.GA]
at
org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:41)
[:2.2.0.GA]
at
org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:301)
[:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983)
[:2.2.0.GA]
at
org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076)
[:2.2.0.GA]
at
org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679)
[:2.2.0.GA]
at
org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106)
[:6.0.0.Final]
at
org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143)
[:0.2.2]
at
org.jboss.profileservice.plugins.deploy.actions.DeploymentStartAction.doPrepare(DeploymentStartAction.java:98)
[:0.2.2]
at
org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:101)
[:0.2.2]
at
org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87)
[:0.2.2]
at
org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234)
[:0.2.2]
at
org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213)
[:0.2.2]
at
org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150)
[:0.2.2]
at
org.jboss.profileservice.plugins.deploy.AbstractDeployHandler.startDeployments(AbstractDeployHandler.java:168)
[:0.2.2]
at
org.jboss.profileservice.management.upload.remoting.DeployHandlerDelegate.startDeployments(DeployHandlerDelegate.java:74)
[:6.0.0.Final]
at
org.jboss.profileservice.management.upload.remoting.DeployHandler.invoke(DeployHandler.java:156)
[:6.0.0.Final]
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898) [:6.0.0.Final]
at
org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
[:6.0.0.Final]
at
org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
[:6.0.0.Final]
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
[:6.0.0.Final]
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
[:6.0.0.Final]
Caused by: java.lang.RuntimeException: Error retreiving EJB from JNDI Echo (Singleton);
BeanClass: class org.jboss.seam.rest.test.compat.ejb.deployment.Echo; Local Business
Interfaces: [Business interface: class
org.jboss.seam.rest.test.compat.ejb.deployment.Echo]
at
org.jboss.weld.integration.ejb.JBossEjbServices.resolveEjb(JBossEjbServices.java:69)
[:6.0.0.Final]
at org.jboss.weld.bean.SessionBean.createReference(SessionBean.java:476)
[:6.0.0.Final]
at
org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.<init>(EnterpriseBeanProxyMethodHandler.java:75)
[:6.0.0.Final]
at org.jboss.weld.bean.SessionBean.create(SessionBean.java:331) [:6.0.0.Final]
... 56 more
Caused by: javax.naming.NameNotFoundException: no-interface not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [:5.0.5.Final]
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779) [:5.0.5.Final]
at org.jnp.server.NamingServer.getObject(NamingServer.java:785) [:5.0.5.Final]
at org.jnp.server.NamingServer.lookup(NamingServer.java:443) [:5.0.5.Final]
at org.jnp.server.NamingServer.lookup(NamingServer.java:399) [:5.0.5.Final]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728) [:5.0.5.Final]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688) [:5.0.5.Final]
at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_23]
at
org.jboss.weld.integration.ejb.JBossSessionObjectReference.<init>(JBossSessionObjectReference.java:44)
[:6.0.0.Final]
at
org.jboss.weld.integration.ejb.JBossEjbServices.resolveEjb(JBossEjbServices.java:65)
[:6.0.0.Final]
... 59 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira