Name Not Bound
shogun1234 Oct 13, 2005 10:37 AMHi,
I encounter an error named "Name Nout Bound" when using client access to the ejb resided on the server.
I encountered that error before, it should be the jndi name not found on the server.
but I do not know how to check by JNDIView when having access to the url, e.g., http://localhost:8080; because I often check on the console to see if there's key word appeared like " ... deploy ... Hello.jar".
the env I use is jboss 3.2.7 (4.0.2 have the same problem, too.) xdoclet 1.2.3. jdk 1.5.0_05. debian sarge 3.1 r0a (stable) with kernel manually built ( version 2.6.12.4 )
code is as below:
session bean
package sb; /** * @ejb.bean * name="Hello" * type="Stateful" * view-type="remote" */ public abstract class HelloBean implements javax.ejb.SessionBean { /** * @ejb.interface-method */ public String sayHello() { System.out.println("hello!"); return "hello!"; } /** * @ejb.create-method */ public void ejbCreate() { System.out.println("ejbCreate!"); } }
client
package sb; import javax.naming.InitialContext; import javax.rmi.PortableRemoteObject; public class Client { public static void main(String[] args) throws Exception{ InitialContext ctx = new InitialContext(); HelloHome home = (HelloHome)PortableRemoteObject.narrow( ctx.lookup("Hello"), HelloHome.class); Hello hello = home.create(); String message = hello.sayHello(); System.out.println(message); System.out.println("END"); } }
build.xml
<target name="generate" depends="clear,init"> <ejbdoclet destdir="target/src" excludedtags="@version,@author,@todo" ejbspec="2.0" > <fileset dir="src"> <include name="**/*Bean.java"/> </fileset> <session/> <entitycmp/> <remoteinterface/> <homeinterface/> <deploymentdescriptor destdir="target/meta-inf" /> <jboss version="3.0" destdir="target/meta-inf" /> </ejbdoclet> <javac destdir="target/classes" classpathref="class.path" debug="on" deprecation="on" optimize="off" > <src path="src"/> <src path="target/src"/> </javac> </target>
How to adjust it?
I appreciate any suggestion,sincerely.