If you intend to use RMI/IIOP you should not specify this on client side:
JNDIParm.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
but instead:
JNDIParm.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.cosnaming.CNCtxFactory");
JNDIParm.put(Context.PROVIDER_URL, "<an IOR String you can find in server.log>");
The IOR: String should be in a line of server.log that looks like:
2002-06-11 10:02:15,709 INFO [org.jboss.iiop.CorbaORBService] Naming:
[IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F6E746578744578743A312E300000000000020000000000000034000102000000000D3139322E392E3230302E3237000021EB000000114A426F73732F4E616D696E672F726F6F7400000000000000000000010000002C0000000000000001000000010000001C00000000000100010000000105010001000101090000000105010001]
That's the part between the 2 square brackets.
If you follow this list you should find some messages about this. I've not yet
succedeed in binding an
Object into the JNDI Naming Context.
But I've got the reference on the Root context (my problem seems to elsewher). So you
should be able to
retreive your EJBHome reference
using this way
lee a �crit :
> Hi,
>
> I make a ejb and a test client,I want test RMI/IIOP in JBoss.
>
> My problem is:
>
> In JBoos/IIOP project
> page(http://www.jboss.org/developers/projects/jboss/iiop.jsp),there
> say:"To specify that an EJB should be deployed in an IIOP container,
> include in its jboss.xml file a configuration-name entry for one of the
> IIOP container configurations:
>
> <configuration-name>IIOP Stateless SessionBean</configuration-name> "
>
> but if I don't add the line and I start JBoss and goto
>
>JNDIView(http://localhost:8082/InvokeAction//jboss%3Aservice%3DJNDIView/action=listXML?action=listXML)
> I'll get some lines like below:
> ...
> file%/C%/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/WellProd.jar
> java:comp WellDayData env org.jnp.interfaces.NamingContext java:
> ...
> comp javax.naming.Context Global WellDayData $Proxy25
> ...
> And I can use a few lines like below in client to get the EJB's Home
> Interface sucessfully:
>
> java.util.Hashtable JNDIParm = new java.util.Hashtable();
> JNDIParm.put(Context.PROVIDER_URL, "localhost");
> JNDIParm.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.jnp.interfaces.NamingContextFactory");
> Context ctx = new InitialContext(JNDIParm);
> Object ref = ctx.lookup("WellDayData");
>
> If I add the line,then I get lines like below:
> ...
> file%/C%/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/WellProd.jar
> java:comp WellDayData env org.jnp.interfaces.NamingContext java:
> ...
> comp javax.naming.Context Global WellDayData javax.ejb.EJBHome
>
> When I run the client code,the program will raise a exception at the
> last like below:
>
> javax.naming.NamingException: Could not dereference object. Root
> exception is java.lang.ClassCastException
>
> at
>
>com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:296)
>
> at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
>
> at
> org.jboss.ejb.plugins.iiop.HomeFactory.getObjectInstance(HomeFactory.java:42)
>
> at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:538)
>
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
>
> at javax.naming.InitialContext.lookup(InitialContext.java:350)
>
> at tstejb.WellDayDataTestClient1.<init>(WellDayDataTestClient1.java:27)
>
> at tstejb.WellDayDataTestClient1.main(WellDayDataTestClient1.java:142)
>
> Who can give me an explain?
>
> _______________________________________________________________
>
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -
>http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
--
[EMAIL PROTECTED] - Atlantide - http://www.ago.fr/atlantide/
Technopole Brest Iroise BP 80802 - Site du Vernis - 29608 Brest cedex - France
Tel. : +33 2 98 05 43 21 - Fax. : +33 2 98 05 20 34
e-mail: [EMAIL PROTECTED]
Centre Affaires Oberthur - 74D, rue de Paris - 35700 Rennes - France
Tel. : +33 2 99 84 15 84 - Fax : +33 2 99 84 15 85
e-mail: [EMAIL PROTECTED]
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user