3 Replies Latest reply on Nov 7, 2006 8:57 AM by Scott Stark

    Ejb3ClientDeployer handling j2ee14 clients

    Scott Stark Master

      So can we look at handling j2ee14 client deployments in the Ejb3ClientDeployer? Right now its blowing up on such deployments because they have no main class setting. I don't see why we can't default to a jboss main class in such a circumstance and build the env based on the descriptors with no injection.

      00:03:43,684 ERROR [Ejb3ClientDeployer] Error during deployment: jar:file:/home/svn/JBossHead/jboss-head/testsuite/output/lib/app-client.ear!/app-client.jar
      org.jboss.deployers.spi.DeploymentException: Could not deploy jar:file:/home/svn/JBossHead/jboss-head/testsuite/output/lib/app-client.ear!/app-client.jar
       at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:93)
       at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:53)
       at org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer.deploy(AbstractSimpleRealDeployer.java:53)
       at org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer.commitDeploy(AbstractSimpleDeployer.java:52)
       at org.jboss.deployers.plugins.deployer.DeployerWrapper.commitDeploy(DeployerWrapper.java:145)
       at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:440)
       at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:381)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:795)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:266)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
       at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:816)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:417)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.Exception: Main-Class is null
       at org.jboss.ejb3.deployers.Ejb3ClientDeployer.getMainClassName(Ejb3ClientDeployer.java:164)
       at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:79)
       ... 56 more
      00:03:43,688 INFO [Ejb3Deployment] EJB3 deployment time took: 0
      




        • 1. Re: Ejb3ClientDeployer handling j2ee14 clients
          Scott Stark Master

          So I have added a general org.jboss.client.AppClientMain that can handle any app client type by allowing for alternate launchers that implement:

          public interface AppClientLauncher
          {
           /**
           * Launch a javaee client application.
           *
           * @param clientClass - the class whose main(String[]) will be invoked
           * @param clientName - the client name that maps to the server side JNDI ENC.
           * May be null indicating the name should be taken from the client jar
           * descriptors/annotations.
           * @param args - the args to pass to main method
           * @throws Throwable
           */
           public void launch(String clientClass, String clientName, String[] args)
           throws Throwable;
          }
          


          and org.jboss.ejb3.client.ClientLauncher now implements this interface. An ordered list fo such launchers can be passed to the AppClientMain. The first to succeed defines the launcher behavior. These changes are checked in but I'm still testing them.


          • 2. Re: Ejb3ClientDeployer handling j2ee14 clients
            Carlo de Wolf Master

            Even in J2EE 1.4 Main-Class is mandatory (J2EE 1.4 9.5).

            I don't like the interface, it depends on exceptions to make a choice. If the client launcher isn't written neatly it could leave mess around. Can we have a isCapable method or something?

            • 3. Re: Ejb3ClientDeployer handling j2ee14 clients
              Scott Stark Master

              We have never required that Main-Class be specified. In the past you could run the client anyway you wanted. All that was required was the property jndi InitialContext factory.

              So you want a pre-check method that mirror the current lauch signature? That would be fine and cleans up the AppClientMain lauch loop.