-
1. Re: yet another jndi question...
adrian.brock Nov 6, 2002 9:55 PM (in response to craighamilton)No, it is the same one that everybody asks :-)
Look in the global namespace, it is probably
bound as your <ejb-name>
java:comp is only available from inside the bean.
Regards,
Adrian -
2. Re: yet another jndi question...
craighamilton Nov 7, 2002 3:31 AM (in response to craighamilton)In my code which looks up the ejb, it is using the value of ejb-name.
The jndiview seems to show it is bound as Activity also...
Not sure what I am missing here.
thanks,
craig -
3. Re: yet another jndi question...
adrian.brock Nov 7, 2002 11:16 AM (in response to craighamilton)Try posting your ejb-jar.xml and jboss.xml
Also, add some code to list the initial context
using the enumeration. This will tell you what is
available.
Regards,
Adrian -
4. Re: yet another jndi question...
craighamilton Nov 12, 2002 3:03 PM (in response to craighamilton)Here is my jboss.xml, and the message when I dump the context list.
thanks,
craig
ejb-jar.xml
-=-=-=-=-=-
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
Entity Bean - CMP
<display-name>Activity</display-name>
<ejb-name>Activity</ejb-name>
<local-home>com.keycurve.ejb.ActivityHome</local-home>
com.keycurve.ejb.Activity
<ejb-class>com.keycurve.ejb.ActivityBean</ejb-class>
<persistence-type>Container</persistence-type>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>activity</abstract-schema-name>
<table-name>kcactivity</table-name>
<cmp-field>
<field-name>activityID</field-name>
<column-name>activityid</column-name>
<not-null/>
</cmp-field>
<cmp-field>
<field-name>year</field-name>
<column-name>year</column-name>
<not-null/>
</cmp-field>
<cmp-field>
<field-name>description</field-name>
<column-name>description</column-name>
<not-null/>
</cmp-field>
<prim-key-class>com.keycurve.ejb.ActivityPK</prim-key-class>
False
</enterprise-beans>
</ejb-jar>
jboss.xml
-=-=-=-=-=-=
<ENTERPRISE-BEANS>
<EJB-NAME>Activity</EJB-NAME>
<JNDI-NAME>Activity</JNDI-NAME>
</ENTERPRISE-BEANS>
context dump
run.client:
[java] Item: XAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory
[java] Item: RMIXAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory
[java] Item: UserTransactionSessionFactory: org.jboss.tm.usertx.server.UserTran
[java] Item: topic: org.jnp.interfaces.NamingContext
[java] Item: queue: org.jnp.interfaces.NamingContext
[java] Item: ConnectionFactory: org.jboss.mq.SpyConnectionFactory
[java] Item: RMIConnectionFactory: org.jboss.mq.SpyConnectionFactory -
5. Re: yet another jndi question...
craighamilton Nov 12, 2002 3:05 PM (in response to craighamilton)This is the code to get the context dump. Is using "" correct?
thanks,
craig
NamingEnumeration enum = ctx.list("");
while(enum.hasMoreElements())
{
System.out.println("Item: " + enum.nextElement());
} -
6. Re: yet another jndi question...
adrian.brock Nov 12, 2002 9:10 PM (in response to craighamilton)You cannot access LocalHome over RMI,
it is only available in the same VM.
If you are in the same VM, use new InitialContext();
Regards,
Adrian -
7. Re: yet another jndi question...
craighamilton Nov 13, 2002 2:26 PM (in response to craighamilton)Adrian,
First, thanks for the help, I appreciciate it.
I am running the client from a different vm, so I am trying to obtain a reference to the remote interface for the ejb.
Don't I need to create the InitialContext as I am for this?
thanks again,
craig -
8. Re: yet another jndi question...
adrian.brock Nov 13, 2002 8:25 PM (in response to craighamilton)You only have in the ejb-jar.xml you posted.
Regards,
Adrian