1 Reply Latest reply on Oct 30, 2012 1:57 AM by Smitha K

    org.jboss.deployers.spi.DeploymentException:Getting deployment  issues while loading EJB ear

    Smitha K Newbie

      To call   EJB deployed as an ear on JBOSS from a remote client.

       

      1] EJB application on JBOSS has the following structures:-

       

      a)It has  Meta-INF folder containign application.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>

      <application>
        <display-name>MyFirstBean</display-name>
        <description>Application description</description>
        <module>
          <ejb>ejb.jar</ejb>
        </module>
      </application>

      b) it has ejb.jar

      which has following files and meta-inf which has ejb.jar.xml

      <?xml version="1.0"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar>
        <description>A simple session bean</description>
        <display-name>Simple Message EJB</display-name>
        <enterprise-beans>
          <session>
            <ejb-name>FirstEJBBean</ejb-name>
            <home>FirstEJBHome</home>
            <remote>FirstEJBObject</remote>
            <ejb-class>FirstEJBBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
          </session>
        </enterprise-beans>
      </ejb-jar>


      c) It has jboss.xml

       

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <jboss>
        <enterprise-beans>
          <session>
            <ejb-name>FirstEJBBean</ejb-name>
            <jndi-name>ejb/FirstEJBBean</jndi-name>
         </session>
        </enterprise-beans>
      </jboss>


       

      d)And it has FirstEJBBean.class

      FirstEJBHome.class

      FirstEJBObject.class

       

      org.jboss.deployers.spi.DeploymentException: Verification of Enterprise Beans fa

      iled, see above for error messages.

              at org.jboss.ejb.deployers.EjbDeployer.deploy(EjbDeployer.java:275)

              at org.jboss.ejb.deployers.EjbDeployer.deploy(EjbDeployer.java:74)

              at org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.de

      ploy(AbstractSimpleVFSRealDeployer.java:56)

              at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.i

      nternalDeploy(AbstractSimpleRealDeployer.java:62)

              at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(

      AbstractRealDeployer.java:50)

              at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(Deployer

      Wrapper.java:171)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(Deployer

      sImpl.java:1439)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi

      rst(DeployersImpl.java:1157)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi

      rst(DeployersImpl.java:1210)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.install(Deployers

      Impl.java:1098)

              at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra

      ctControllerContext.java:348)

              at org.jboss.dependency.plugins.AbstractController.install(AbstractContr

      oller.java:1631)

              at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra

      ctController.java:934)

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr

      actController.java:1082)

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr

      actController.java:984)

              at org.jboss.dependency.plugins.AbstractController.change(AbstractContro

      ller.java:822)

              at org.jboss.dependency.plugins.AbstractController.change(AbstractContro

      ller.java:553)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.process(Deployers

      Impl.java:781)

              at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeploye

      rImpl.java:702)

              at org.jboss.system.server.profileservice.repository.MainDeployerAdapter

      .process(MainDeployerAdapter.java:117)

              at org.jboss.profileservice.management.upload.remoting.AbstractDeployHan

      dler.start(AbstractDeployHandler.java:263)

              at org.jboss.profileservice.management.upload.remoting.AbstractDeployHan

      dler.invoke(AbstractDeployHandler.java:177)

              at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)

              at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalCli

      entInvoker.java:106)

              at org.jboss.remoting.Client.invoke(Client.java:1724)

              at org.jboss.remoting.Client.invoke(Client.java:629)

              at org.jboss.profileservice.management.upload.remoting.StreamingDeployme

      ntTarget.invoke(StreamingDeploymentTarget.java:305)

              at org.jboss.profileservice.management.upload.remoting.StreamingDeployme

      ntTarget.start(StreamingDeploymentTarget.java:190)

              at org.jboss.profileservice.management.upload.DeploymentProgressImpl.sta

      rt(DeploymentProgressImpl.java:231)

              at org.jboss.profileservice.management.upload.DeploymentProgressImpl.run

      (DeploymentProgressImpl.java:88)

              at org.rhq.plugins.jbossas5.util.DeploymentUtils.run(DeploymentUtils.jav

      a:120)

              at org.rhq.plugins.jbossas5.AbstractManagedDeploymentComponent.invokeOpe

      ration(AbstractManagedDeploymentComponent.java:181)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

      java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

      sorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread

      .call(ResourceContainer.java:482)

              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

              at java.util.concurrent.FutureTask.run(FutureTask.java:138)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec

      utor.java:886)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

      .java:908)

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

      13:33:34,163 INFO  [DeployHandler] Failed to complete command: [start] for deplo

      yment: names=[vfszip:/D:/Softwares/jboss/jboss-5.1.0.GA/server/default/deploy/Fi

      rstEJBBean.ear/], copyContent=true

      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incompl

      ete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

       

       

      The client class is as  follows:-

       


      import java.rmi.RemoteException;
      import java.util.Hashtable;

      import javax.ejb.CreateException;
      import javax.ejb.EJBException;
      import javax.ejb.EJBHome;
      import javax.ejb.EJBObject;
      import javax.ejb.SessionBean;
      import javax.ejb.SessionContext;
      import javax.naming.Context;
      import javax.naming.InitialContext;
      import javax.naming.NamingException;
      import javax.rmi.PortableRemoteObject;

      public class FirstEJBClient  {

      public static void main(String args[])
      {
       
      try {
       
        Hashtable environment = new Hashtable();
              environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
              environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              environment.put(Context.PROVIDER_URL, "jnp://localhost:1099"); // remote machine IP
          //    environment.put(Context.PROVIDER_URL, "localhost"); // remote machine IP
              InitialContext context = new InitialContext(environment);
          
              Object obj = context.lookup("ejb/FirstEJBBean"); //ejb-name
              System.out.println("-->> lookup object successfully");


             
        FirstEJBHome ejbHome = (FirstEJBHome) PortableRemoteObject.narrow(obj,EJBHome.class);
        try {
         FirstEJBObject firstEJBObject =(FirstEJBObject) ejbHome.create();
         firstEJBObject.firstHello();
        
        } catch (RemoteException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
        } catch (CreateException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
        }

       

       

      } catch (NamingException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }



      }
      }