Andiappan,

Perhaps because the js engines are different for
the command line vs Orion.

Typically, js is very loosely defined, and does
transformations, coercions and therefore casts
on its own as it sees fit.

This is kind of like the Windows Assistant,
always in your way and a pain in the butt
because it may do things for you that you
don't want done or know about.

Since you are getting a cast exception, check
that the parameters you are using are of the
correct type.

If you can examine the stack you can see what
is actually being put up there, so you can decipher
what the heck is comming off it, and creating the
cast exception from what you expect.

Or the simple brut force method is to try all the
datatypes that might work, until one does. If it
doesn't work there is probably a bug that neither
you or I can resolve.

Hope this makes sense in 2000 because I haven't
programmed in five years.

Jas


Andiappan Jeyamurugan wrote:

> Hello there,
> I am trying to access the orion's demo/ejb/cart ejbeans via servlet or jsp
> file. The code is
>                 try
>                 {
>                         Hashtable env = new Hashtable();
>
> env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClie
> ntInitialContextFactory");
>
> env.put(Context.PROVIDER_URL,"ormi://10.1.1.59/ejbsamples");
>                         env.put(Context.SECURITY_PRINCIPAL,"admin");
>                         env.put(Context.SECURITY_CREDENTIALS,"123");
>                 Context context = new InitialContext(env);
>                 Object homeObject = context.lookup("java:comp/env/MyCart");
>                         CartHome home =
> (CartHome)PortableRemoteObject.narrow(homeObject, CartHome.class);
>                         }
>                 //Cart cart =
> (Cart)PortableRemoteObject.narrow(home.create(), Cart.class);
>                  }
>                 catch(Exception ee){
>                                 return "Error Becomes ..."+ee;
>                 }
> I am getting error as,
>         java.lang.ClassCastException: CartHome_StatefulSessionHomeWrapper2
>
> If I access the ejbeans from an application on command prompt, it is working
> fine.
> I really wonder why the same code is not working in servlet/beans/jsp.
> Can anyone help me?
>
> Thanks in advance
> Jeya([EMAIL PROTECTED])
> =====================================================================
> WARNING -This e-mail, including any attachments, is for the
> personal use of the recipient(s) only.
> Republication and re-dissemination, including posting to news
> groups or web pages, is strictly prohibited without the express
> prior consent of
> Thomson Legal & Regulatory Group Asia Pacific Ltd
> ACN 058 914 668
> =====================================================================


Reply via email to