This content has been marked as final.
Show 3 replies
-
1. Re: Problem with minimal server
peterj Nov 24, 2008 2:51 PM (in response to swedenewbie)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 Nov 25, 2008 1:47 PM (in response to 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 Nov 25, 2008 2:24 PM (in response to swedenewbie)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.