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 - 27 Jul 2004 09:00 GMT
> Hi,
> I'm a total EJB newbie. I've tried to use EJBs with Struts. After
[quoted text clipped - 23 lines]
> THX,
> Mike
Probably a silly question, but you are import-ing your MyEJBHome class
aren't you? Otherwise, it sounds like a classpath issue
Craig Andrews - 05 Aug 2004 13:51 GMT
> Hi,
> I'm a total EJB newbie. I've tried to use EJBs with Struts. After
[quoted text clipped - 3 lines]
> web-console listing.
> Any ideas, why i can't resolve the class?
You have to deploy the interfaces to the EJB with the web application as
well as with the EJB itself. So, your .EAR file would contain:
mypackage.ejb.MyBean
mypackage.interfaces.MyBean
mypackage.interfaces.MyBeanHome
and your .WAR file would contain
mypackage.web.MyStrutsApp
mypackage.interfaces.MyBean
mypackage.interfaces.MyBeanHome
HTH

Signature
Craig Andrews <craig@simplyspiffing.com