Hi!

Ricky wrote:
>    Now I can accessed the ejb however I have the error :
> 
>    java.lang.ClassCastException: java.rmi.MarshalledObject
>         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:98)
>         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:617)
>         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:272)
>         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:265)
>         at javax.naming.InitialContext.lookup(InitialContext.java:354)
>         at mybean.Untitled1.main(Untitled1.java:28)

Try updating the clients jnp-client.jar file.

/Rickard

> 
>   Thanks weetat.
> 
> 
> 
> [EMAIL PROTECTED] wrote:
> >
> > If you are calling your ejb from another ejb you have to use the following
> > statement:
> >
> > Object home = ctx.lookup("java:comp/env/ejb/test");
> >
> > assuming you have linked your ejb to the other ejb in the deployment descriptor 
>using the following elements:
> >
> > <ejb-ref>
> >          <ejb-ref-name>ejb/test</ejb-ref-name>
> >          <ejb-ref-type>Session</ejb-ref-type>
> >          <home>package.testhome</home>
> >          <remote>package.testremote</remote>
> >          <ejb-link>test</ejb-link>
> >     </ejb-ref>
> >
> > Of course, you will have to replace package with the package of test and testhome 
>with what ever you called the home interface of test and testremote
> > whatever you
> > called the remote interface of test.
> >
> > If you happen to call your ejb from a client running outside of jboss you will 
>have to use the following statements:
> >
> > Properties props = new Properties();
> > props.put(Context.INITIAL_CONTEXT_FACTORY, 
>"org.jnp.interfaces.NamingContextFactory");
> > props.put(Context.PROVIDER_URL, "localhost:1099");
> > Context ctx = new InitialContext(props);
> > Object ref = ctx.lookup("test");
> >
> > If your client is running on another machine, you have to replace localhost with 
>the name of the server.
> >
> > I hope this helps!
> >
> > Thomas Kirsch
> >
> > --
> > --------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > List Help?:          [EMAIL PROTECTED]
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to