Home > Archive > Java Beans > July 2004 > Using Entity Beans with Struts
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Using Entity Beans with Struts
|
|
|
| Hi,
I'm a total EJB newbie. I've tried to use EJBs with Struts. After
deploying a simple entity bean (BMP) and struts app on JBoss 3.2.3
with Tomcat I get this error message:
java.lang.Error: Unresolved compilation problems:
MyEJBHome cannot be resolved or is not a type
MyEJBHome cannot be resolved or is not a type
MyEJBHome cannot be resolved or is not a type
My bean class/interfaces are
class: MyEJBBean
interfaces: MyEJBHome and MyEJB
I try to call the bean with:
InitialContext ctx = new InitialContext();
Object ref = ctx.lookup("ejb/MyEJBBean");
MyEJBHome myEJB = (MyEJBHome)PortableRemoteObject.narrow(ref,MyEJBHome.class);
the jndi name is ok. Both apps has been deployd, they are in the
web-console listing.
Any ideas, why i can't resolve the class?
THX,
Mike
| |
| Murray 2004-07-28, 9:01 pm |
|
"Mike" <mikes_world@gmx.de> wrote in message
news:786255cd.0407261229.3ae3142c@posting.google.com...
> Hi,
> I'm a total EJB newbie. I've tried to use EJBs with Struts. After
> deploying a simple entity bean (BMP) and struts app on JBoss 3.2.3
> with Tomcat I get this error message:
>
> java.lang.Error: Unresolved compilation problems:
> MyEJBHome cannot be resolved or is not a type
> MyEJBHome cannot be resolved or is not a type
> MyEJBHome cannot be resolved or is not a type
>
> My bean class/interfaces are
>
> class: MyEJBBean
> interfaces: MyEJBHome and MyEJB
>
> I try to call the bean with:
>
> InitialContext ctx = new InitialContext();
> Object ref = ctx.lookup("ejb/MyEJBBean");
> MyEJBHome myEJB =
(MyEJBHome)PortableRemoteObject.narrow(ref,MyEJBHome.class);
>
> the jndi name is ok. Both apps has been deployd, they are in the
> web-console listing.
> Any ideas, why i can't resolve the class?
>
> THX,
> Mike
Probably a silly question, but you are import-ing your MyEJBHome class
aren't you? Otherwise, it sounds like a classpath issue
|
|
|
|
|