1 Reply Latest reply on Sep 13, 2015 2:53 AM by S K

    Accessing EJB 2 method gives error: WFLYEE0042: Failed to construct component instance

    S K Newbie

      Hi,

       

      I am basically trying to migrate an ear application from JBoss 4.2 to wildfly 9. I'm trying to deploy a EJB 2 stateless session bean. After doing the JNDI lookup, when I try to invoke a business method it fails with the following erro:

       

      17:18:25,647 ERROR [org.jboss.as.ejb3.invocation] (default task-5) WFLYEJB0034: EJB Invocation failed on component TestService for method public abstract java.lang.String in.hinote.ejb.TestServiceLocal.foo(java.lang.String): java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)

          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)

          at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)

          at org.jboss.as.ejb3.component.stateless.StatelessSessionComponent$1.create(StatelessSessionComponent.java:64)

          at org.jboss.as.ejb3.component.stateless.StatelessSessionComponent$1.create(StatelessSessionComponent.java:61)

          at org.jboss.as.ejb3.pool.AbstractPool.create(AbstractPool.java:60)

          at org.jboss.as.ejb3.pool.strictmax.StrictMaxPool.get(StrictMaxPool.java:124)

          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:47)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.interceptors.EjbExceptionTransformingInterceptorFactories$2.processInvocation(EjbExceptionTransformingInterceptorFactories.java:103)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

          at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:634)

          at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

          at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)

          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)

          at in.hinote.ejb.TestServiceLocal$$$view9.foo(Unknown Source)

          at in.hinote.actions.TestAction.execute(TestAction.java:40)

          at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)

          at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)

          at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)

          at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

          at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)

          at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

          at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

          at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

          at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

          at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

          at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

          at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

          at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

          at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)

          at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

          at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

          at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

          at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)

          at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)

          at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)

          at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)

          at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

          at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

          at java.lang.Thread.run(Thread.java:745)

       

      And in the action I have the following code:

       

      InitialContext context = new InitialContext();

      Object objref = context.lookup("java:app/WildEarEJB/TestService!in.hinote.ejb.TestServiceLocalHome");

      TestServiceLocalHome home = (TestServiceLocalHome) PortableRemoteObject.narrow(objref, TestServiceLocalHome.class);

      TestServiceLocal testService = home.create();

      testService.foo("Test");

       

      JNDI lookup seems to be working. It fails only when I call the business method: testService.foo(). Am I missing anything?