2 Replies Latest reply: Mar 8, 2012 1:34 PM by Jigar Naik RSS

Unable to deploy EJB after making service call: org.jboss.as.server.deployment.DeploymentUnitProcessingException: No component found for type 'com.... HelloBeanRemote' with name HelloBean

Jigar Naik Newbie

Hi,

 

I recently joined JBoss Community so i am not sure whether this is perfect place to ask this question or not.

 

Well i am developning a HelloWorld application using EJB 3 and Jboss 7 AS. but i am facing some issues while deploying the EAR on Jboss AS. Bellow is the error which i am getting when i start the server.

 

21:48:43,845 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.subunit."HelloWorldEAR.ear"."HelloWorldWeb.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."HelloWorldEAR.ear"."HelloWorldWeb.war".INSTALL: Failed to process phase INSTALL of subdeployment "HelloWorldWeb.war" of deployment "HelloWorldEAR.ear"

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_20]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_20]

        at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: No component found for type 'com.india.HelloBeanRemote' with name HelloBean

        at org.jboss.as.ejb3.deployment.processors.EjbInjectionSource.getResourceValue(EjbInjectionSource.java:68)

        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:200)

        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:168)

        at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:52)

        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:140)

        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:133)

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]

        ... 5 more

 

21:48:44,124 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "mysql-connector-java-5.1.15-bin.jar" was rolled back with no failure message

21:48:44,129 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "HelloWorldEAR.ear" was rolled back with failure message {"Failed services" => {"jboss.deployment.subunit.\"HelloWorldEAR.ear\".\"HelloWorldWeb.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"HelloWorldEAR.ear\".\"HelloWorldWeb.war\".INSTALL: Failed to process phase INSTALL of subdeployment \"HelloWorldWeb.war\" of deployment \"HelloWorldEAR.ear\""},"Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.HelloWorldEAR.HelloWorldWeb.ValidatorFactory missing [ jboss.naming.context.java.module.HelloWorldEAR.HelloWorldWeb ]","jboss.naming.context.java.module.HelloWorldEAR.HelloWorldWeb.Validator missing [ jboss.naming.context.java.module.HelloWorldEAR.HelloWorldWeb ]"]}

21:48:44,148 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Stopped deployment mysql-connector-java-5.1.15-bin.jar in 22ms

21:48:44,159 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Stopped deployment HelloWorldBean.jar in 28ms

21:48:44,164 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment HelloWorldWeb.war in 34ms

21:48:44,168 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment HelloWorldEAR.ear in 39ms

21:48:44,170 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.deployment.subunit.\"HelloWorldEAR.ear\".\"HelloWorldWeb.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"HelloWorldEAR.ear\".\"HelloWorldWeb.war\".INSTALL: Failed to process phase INSTALL of subdeployment \"HelloWorldWeb.war\" of deployment \"HelloWorldEAR.ear\""},"Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.HelloWorldEAR.HelloWorldWeb.ValidatorFactory missing [ jboss.naming.context.java.module.HelloWorldEAR.HelloWorldWeb ]","jboss.naming.context.java.module.HelloWorldEAR.HelloWorldWeb.Validator missing [ jboss.naming.context.java.module.HelloWorldEAR.HelloWorldWeb ]"]}}}

21:48:44,173 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) Composite operation was rolled back

 

Can anybody help me out in solving this issue.

 

HelloBean.java

 

package com.india;

 

import javax.ejb.LocalBean;

import javax.ejb.Stateless;

 

@Stateless(mappedName = "HelloBean")

@LocalBean

public class HelloBean implements HelloBeanRemote, HelloBeanLocal {

 

    public HelloBean() {

 

    }

 

    public String sayHello(String firstName) {

        return "Hello " + firstName;

    }

 

}

 

And there are 2 Remote and Local(HelloBeanRemote, HelloBeanLocal) Interfaces which are in Client jar file

 

Below is my Client code from which i am trying to access the EJB.

 

package com.india;

 

import java.io.IOException;

 

import javax.ejb.EJB;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

 

@WebServlet("/HelloController")

public class HelloController extends HttpServlet {

 

    private static final long serialVersionUID = 1L;

 

    @EJB(beanName="HelloBean")

    private HelloBeanRemote service;

 

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        doPost(request, response);

    }

 

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String returnValue = "";

        String firstName = "";

        if (request.getParameter("firstName") != null) {

            firstName = request.getParameter("firstName");

            returnValue = service.sayHello(firstName);

        }

        request.setAttribute("firstName", firstName);

        request.setAttribute("returnValue", returnValue);

        request.getRequestDispatcher("index.jsp").forward(request, response);

    }

 

}

 

If i remove the service call i.e

 

    @EJB(beanName="HelloBean")

    private HelloBeanRemote service;

 

service.sayHello(firstName);

 

The EAR gets deployed perfectly, but when i put this line in the servlet deployment fails.

 

    @EJB(beanName="HelloBean")

    private HelloBeanRemote service;

 

Can anybody give me some hint for solving this issue. I think this has to do something with JNDI. Am i missing something in EJB ? I don't have any other xml or configuration files as i am only using annotations.