Oops, I mean "java:comp/env/ejb/Cart".
Cathleen Dull wrote:
>
> Derek;
>
> Try using "java:comp/env/ejb/cart.CartBean" in the lookup.
>
> Cathy
>
> > Derek Akers wrote:
> >
> >
> > I am trying to access an ejb (stateful session) from a jsp using:
> >
> > Context initialContext = new InitialContext();
> > CartHome cartHome =
> >
>(CartHome)javax.rmi.PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/cart"),CartHome.class);
> >
> > where the bean is cart.CartBean
> > the home interface is cart.CartHome
> > the remote interface is cart.Cart
> >
> > (cart is the package)
> >
> > but I keep getting the error
> >
> > error: File
> > D:\orion\applications\cart\cart-web\WEB-INF\classes\CartHome.class
> > does not contain type CartHome as expected, but type cart.CartHome.
> > Please remove the file, or make sure it appears in the correct
> > subdirectory of the class path.
> > Now, I have tried putting the *.java files in classes\cart directory,
> > but this does not work. Does anyone have any ideas as to how to fix
> > this problem so I can access the bean? <jsp:useBean../> does not
> > work. Are there other simple ways which I can use to access this
> > bean?