有关第五章的部署问题

org.jboss.deployment.DeploymentInfo@f3f37282{url=file:/c:/jboss-3.2.3/server/default/deploy/cmpweb.war/}
deployer: org.jboss.web.tomcat.tc4.EmbeddedTomcatService@2d59a3
status:Deploryment FAILED reason: Error during deploy; -nested throwable:{javax.naming.NamingException:ejb-local-ref:'ejb/CustomerManager',with web.xml ejb-link:'CustomerManager' failed to resolve to an ejb with a LocalHome}
state:Failed
watch:file:c:/jboss-3.2.3/server/default/deploy/cmpweb.war/WEB-INF/web.xml

web.xml如下:




action
org.apache.struts.action.ActionServlet

debug
2


config
/WEB-INF/struts-config.xml

2


action
*.do


/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld


/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld


/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld


/WEB-INF/struts-template.tld
/WEB-INF/struts-template.tld


http://java.sun.com/jstl/core
/WEB-INF/c.tld


http://java.sun.com/jstl/core_rt
/WEB-INF/c-rt.tld


http://java.sun.com/jstl/fmt
/WEB-INF/fmt.tld


http://java.sun.com/jstl/fmt_rt
/WEB-INF/fmt-rt.tld


http://java.sun.com/jstl/sql
/WEB-INF/sql.tld


http://java.sun.com/jstl/sql_rt
/WEB-INF/sql-rt.tld


http://java.sun.com/jstl/xml
/WEB-INF/x.tld


http://java.sun.com/jstl/xml_rt
/WEB-INF/x-rt.tld


ejb/CustomerManager
Session
com.jdon.ejb.CustomerManagerLocalHome
com.jdon.ejb.CustomerManagerLocal
CustomerManager

ejb-jar.xml如下:





CustomerManager
CustomerManager
com.jdon.ejb.CustomerManagerLocalHome
com.jdon.ejb.CustomerManagerLocal
com.jdon.ejb.CustomerManagerBean
Stateless
Container


ejb/Customer
Entity
com.jdon.ejb.CustomerHome
com.jdon.ejb.CustomerLocal
Customer



ejb/Subscription
Entity
com.jdon.ejb.SubscriptionHome
com.jdon.ejb.SubscriptionLocal
Subscription



ejb/Address
Entity
com.jdon.ejb.AddressHome
com.jdon.ejb.AddressLocal
Address



EJBController
EJBController
com.jdon.controller.ejb.EJBControllerLocalHome
com.jdon.controller.ejb.EJBControllerLocal
com.jdon.controller.ejb.EJBControllerBean
Stateful
Container


Customer
Customer
com.jdon.ejb.CustomerHome
com.jdon.ejb.CustomerLocal
com.jdon.ejb.CustomerBean
Container
java.lang.String
False
2.x
Customer

id


firstName


lastName

id


findByFN

java.lang.String


SELECT OBJECT(s) FROM Customer AS s WHERE s.firstName=?1



findByLN

java.lang.String


SELECT OBJECT(s) FROM Customer AS s WHERE s.lastName=?1



Address
Address
com.jdon.ejb.AddressHome
com.jdon.ejb.AddressLocal
com.jdon.ejb.AddressBean
Container
java.lang.String
False
2.x
Address

addressID


street


city


zip


state


customerID

addressID


Subscription
Subscription
com.jdon.ejb.SubscriptionHome
com.jdon.ejb.SubscriptionLocal
com.jdon.ejb.SubscriptionBean
Container
java.lang.String
False
2.x
Subscription

title


type

title


findAllSubscriptions


SELECT OBJECT(s) FROM Subscription AS s





customer-subscription

customer
CustomerRelationshipRole
Many

customer
Customer


subscription
subscription
java.util.Collection



subscription
SubscriptionRelationshipRole
Many

subscription
Subscription


customer
customer
java.util.Collection




customer-address

customer
CustomerRelationshipRole
One

customer
Customer


address
address
java.util.Collection



address
AddressRelationshipRole
Many


address
Address







CustomerManager
*

Required



EJBController
*

Required



Customer
*

Required



Address
*

Required



Subscription
*

Required


jboss.xml如下:



CustomerManager
CustomerManager

ejb/Customer
Customer


ejb/Subscription
Subscription


ejb/Address
Address



EJBController
EJBControllerLocal


Customer
Customer


Address
Address


Subscription
Subscription


跪请各位大侠赐教

关键是这一句:
status:Deploryment FAILED reason: Error during deploy; -nested throwable:{javax.naming.NamingException:ejb-local-ref:'ejb/CustomerManager',with web.xml ejb-link:'CustomerManager' failed to resolve to an ejb with a LocalHome}

在web.xml中有一个JNDI名称'ejb/CustomerManager',但是无法找到ejb/CustomerManager所指的ejb。

这属于ejb的JNDI名称引用问题,是EJB应用中最烦人的东西,如果你解决不了,就不要在程序中调用'ejb/CustomerManager 直接使用CustomerManager作为JNDI名称调用ejb