3 Replies Latest reply on Nov 25, 2008 2:24 PM by peterj

    Problem with minimal server

    swedenewbie

      Hi all!

      I'm using jboss-5.0.0.CR1, and with the "default" server everything works just fine. But when I'm trying to use the "minimal" server something goes wrong, (propobly because my lack of knowlage in jboss).
      In server.log I can see that my .jar file has been fully deployed, but it is not possible to connect to it. The message when I run the client is that the bean is not bound.

      Before I put my .jar file in the deploy-dir it is empty, is this correct or should there be some default files?

      Thanks in advance!

        • 1. Re: Problem with minimal server
          peterj

          Sounds like your bean (or client) relies on some service not present in "minimal".

          Some more specifics about the app (in the deployed jar file) and the client might help.

          • 2. Re: Problem with minimal server
            swedenewbie

            Hi again!

            My bean looks like:

            package tmp;
            import javax.ejb.Stateless;
            @Stateless
            public class CalculatorBean implements CalulatorRemote {
             public int add(int a, int b) {
             return a + b;
             }
            }
            


            And the client looks like:
            All needed stuff
            Properties props = new Properties();
            props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
             "org.jboss.naming.NamingContextFactory"=;
            props.setProperty(Context.PROVIDER_URL, "192.168.0.100:1099");
            
            Context ic = new InitialContext(props);
            Object o = ic.lookup("CalculatorBean/remote");
            CalculatorRemote cr = (CalculatorRemote) o;
            
            System.out.println("sum: " + cr.add(2, 4));
            


            As you can see, I don't use any special services in the sever.

            The exception is:
            javax.naming.NameNotFoundException: CalculatorBean not bound...
            


            I start jboss from commandline: run.bat -c minimal -b 0.0.0.0

            From server.log I get:

            2008-11-25 19:24:33,890 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] (main) Add deployment: vfszip:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/RemoveMe-ejb.jar
            2008-11-25 19:24:33,890 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] (main) Scheduling deployment: vfszip:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/RemoveMe-ejb.jar parent=null
            2008-11-25 19:24:33,890 DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] (main) Deploying vfszip:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/RemoveMe-ejb.jar
            2008-11-25 19:24:33,921 DEBUG [org.jboss.deployers.vfs.plugins.classloader.InMemoryClassesDeployer] (main) Dynamic class root for vfszip:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/RemoveMe-ejb.jar is vfsmemory://5c4o02s-z3ugym-fnyvn2da-1-fnyvnla9-7
            2008-11-25 19:24:33,921 DEBUG [org.jboss.classloader.spi.base.BaseClassLoader] (main) Created BaseClassLoader@e59e40{vfszip:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/RemoveMe-ejb.jar} with policy VFSClassLoaderPolicy@f8ae79{name=vfszip:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/RemoveMe-ejb.jar domain=null roots=[MemoryContextHandler@8827766[path=classes context=vfsmemory://5c4o02s-z3ugym-fnyvn2da-1-fnyvnla9-7 real=vfsmemory://5c4o02s-z3ugym-fnyvn2da-1-fnyvnla9-7/classes], DelegatingHandler@24134853[path=RemoveMe-ejb.jar context=file:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/ real=vfszip:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/RemoveMe-ejb.jar]] delegates=null exported=[tmp, META-INF] <IMPORT-ALL>NON_EMPTY}
            2008-11-25 19:24:33,921 DEBUG [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (main) ClassLoaderDomain@970c0e{<DEFAULT>} registerClassLoader BaseClassLoader@e59e40{vfszip:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/RemoveMe-ejb.jar}
            2008-11-25 19:24:33,921 DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] (main) Fully Deployed vfszip:/C:/jboss/jboss-5.0.0.CR1/server/minimal/deploy/RemoveMe-ejb.jar
            2008-11-25 19:24:33,921 DEBUG [org.jboss.bootstrap.microcontainer.ServerImpl] (main) Installing life thread Thread[JBossLifeThread,5,jboss]
            2008-11-25 19:24:33,937 INFO [org.jboss.bootstrap.microcontainer.ServerImpl] (main) JBoss (Microcontainer) [5.0.0.CR1 (build: SVNTag=JBoss_5_0_0_CR1 date=200806301254)] Started in 25s:172ms


            Is there an obvious reason why this does not work? What do I miss?



            • 3. Re: Problem with minimal server
              peterj

              The 'minimal' configuration does not support EJB deployment. The CalculatorBean class gets deployed (as a POJO), but the @Stateless annotation is ignored (requires an EJB deployer, which is not in 'minimal'). That in turn prevents the JNDI name from being registered.

              You should be using the 'default' configuration.