Hi, I've tried the example (Stateless Session Bean) on www.jboss.org ,
and it worked successfully.

But when the example get a reference to EJB Home interface, It uses
following.
---------------------------
InitialContext jndiContext = new InitialContext();
System.out.println("Got context");

// Get a reference to the Interest Bean
Object ref  = jndiContext.lookup("interest/Interest");
---------------------------

Now I wanna get the reference as below.
Object ref = jndiContext.lookup("java:comp/env/interest/Interest");

Although I modified jboss.xml as following, Jboss throws an exception
like jndi-name is invalid.
---------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
  <enterprise-beans>
    <session>
      <ejb-name>Interest</ejb-name>
      <jndi-name>java:comp/env/interest/Interest</jndi-name>
    </session>
  </enterprise-beans>
</jboss>
----------------------------------------------

How can I make it ???

And one more question.

The documentation( http://www.jboss.org/online-manual/HTML/ch01s12.html )
says "By default the JNDI name used to access an EJB's home interface is 
the same as the ejb-name value from ejb-jar.xml. For this example that
means that the Interest bean would be located under the JNDI
InitialContext as "Interest"."

So I removed jboss.xml from jar file, and modified a Context Lookup part
of client code like below,
------------------------------------------------------------------
Object ref  = jndiContext.lookup("interest/Interest");  // <-- Default
//I modified above to below.
Object ref  = jndiContext.lookup("Interest");           // <-- Modified
------------------------------------------------------------------

It was successful to be compiled, but when I run, I get an error like
"the name is not existing" or something like that. ( I don't remember
the exact error message)

hm ??  compilicated...
If I remove jboss.xml from jar file, how can I get the reference to the
object with InitialContext#lookup() ?

Thank you 
tony



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to