日期:2014-05-18  浏览次数:20748 次

tomcat下的应用怎么发到JBOSS上?出错
---   MBeans   waiting   for   other   MBeans   ---
ObjectName:   jboss.web.deployment:war=collabway20.war,id=-1857340610
    State:   FAILED
    Reason:   org.jboss.deployment.DeploymentException:   Error   during   deploy;   -   nested   throwable:   (javax.naming.NamingException:   resource-ref:   JDBC/Server2000   has   no   valid   JNDI   binding.   Check   the   jboss-web/resource-ref.)

---   MBEANS   THAT   ARE   THE   ROOT   CAUSE   OF   THE   PROBLEM   ---
ObjectName:   jboss.web.deployment:war=collabway20.war,id=-1857340610
    State:   FAILED
    Reason:   org.jboss.deployment.DeploymentException:   Error   during   deploy;   -   nested   throwable:   (javax.naming.NamingException:   resource-ref:   JDBC/Server2000   has   no   valid   JNDI   binding.   Check   the   jboss-web/resource-ref.)


------解决方案--------------------
需要WEB-INF/jboss-web.xml:
<resource-ref>
<res-ref-name> myDS </res-ref-name>
<jndi-name> java:/myDS </jndi-name>
</resource-ref>

再在web.xml:
<resource-ref>
<res-ref-name> myDS </res-ref-name>
<res-type> javax.sql.DataSource </res-type>
<res-auth> Container </res-auth>
</resource-ref>

当然,前提是已在deploy/放了连接池的配置文件