1 Reply Latest reply on Apr 3, 2008 1:15 PM by Heiko Dähn

    Starting JBoss AS programmatically.

    Heiko Dähn Newbie

      I try to start the JBoss AS programmatically. (JBoss 4.2.1.GA)

      this is the simple code:

      org.jboss.Main.main(new String[]{});

      these are my VM arguments:
      -Djboss.bind.address= -server
      -Djava.endorsed.dirs=C:/jboss/lib/endorsed -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -classpath C:/jboss/bin/run.jar

      I start this from eclipse.
      The server starts, but the EJB3Deployer runs in a NullPointerException:

      13:45:26,781 WARN [ServiceController] Problem creating service jboss.ejb3:service=EJB3Deployer
       at org.jboss.ejb3.EJB3Deployer.createService(EJB3Deployer.java:307)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
       at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      later starts some JMS, Quartz, JNDI - stuff

      The server is aviable, but I can not deploy any ejb3 components.

      Can anybody help me?

        • 1. Re: Starting JBoss AS programmatically.
          Heiko Dähn Newbie

          I could solve this problem.

          The EJB3Deployer needs the persistence.properties. And if there no persistence.properties then gives the NullPointerException.

          Now I have an other problem:

          I use the port-bindings.xml for binding dynamic port numbers. That works fine except the jndi-port is mulish. For any reason the defaultInitCtx has still the property: java.naming.provider.url=localhost:1099. The port 1099 is not aviable and the rebind failed.
          I think the defaultcontext comes from the jndi.properties of the twiddle.jar in jboss.home/bin-folder.

          Has anyone an idea?
          how does I start the server from my client in the right way?
          (It should start in the same VM and in should able to start more than one clients.)