Jboss配置的连接池报 org.jboss.deployment.DeploymentException: Error during deploy;

本文将详细指导您如何在JBoss环境下解决部署程序时出现的JNDI绑定错误问题,包括修改jboss-web.xml配置文件及web.xml中的资源引用配置,确保数据库连接正常加载。

jboss 下部署程序,启动时报:

org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: resource-ref: jdbc/has no valid JNDI binding. Check the jboss-web/resource-ref.)

解决办法,

需要在添加WEB-INF/jboss-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <resource-ref>
        <res-ref-name>jdbc/salesmgmt</res-ref-name>
        <jndi-name>java:/jdbc/salesmgmt</jndi-name>
    </resource-ref>
	<resource-ref>
        <res-ref-name>jdbc/homelink</res-ref-name>
        <jndi-name>java:/jdbc/homelink</jndi-name>
    </resource-ref>
</jboss-web>
 



再在web.xml:

 
<resource-ref>
		<res-ref-name>jdbc/salesmgmt</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>

	<resource-ref>
		<res-ref-name>jdbc/homelink</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>

 


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

16:51:33,561 ERROR [URLDeploymentScanner] Incomplete Deployment listing: --- Incompletely deployed packages --- org.jboss.deployment.DeploymentInfo@ebb24ee4 { url=file:/opt/jboss-4.2.2.GA/server/default/deploy/acs.ear } deployer: org.jboss.deployment.EARDeployer@225b1b status: Deployment FAILED reason: URL file:/opt/jboss-4.2.2.GA/server/default/tmp/deploy/tmp3003181215135402123acs.ear-contents/acs-war-exp.war/ deployment failed state: FAILED watch: file:/opt/jboss-4.2.2.GA/server/default/deploy/acs.ear altDD: null lastDeployed: 1742892691824 lastModified: 1742892691617 mbeans: --- MBeans waiting for other MBeans --- ObjectName: jboss.j2ee:service=EjbModule,module=acs-ejb.jar State: FAILED Reason: org.jboss.deployment.DeploymentException: Error while fixing table name; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: com.mysql.jdbc.Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: com.mysql.jdbc.Driver)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: com.mysql.jdbc.Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: com.mysql.jdbc.Driver)))) ObjectName: jboss.web.deployment:war=acs-war.war,id=225351972 State: FAILED Reason: org.jboss.deployment.DeploymentException: URL file:/opt/jboss-4.2.2.GA/server/default/tmp/deploy/tmp3003181215135402123acs.ear-contents/acs-war-exp.war/ deployment failed --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM --- ObjectName: jboss.j2ee:service=EjbModule,module=acs-ejb.jar State: FAILED Reason: org.jboss.deployment.DeploymentException: Error while fixing table name; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested t
最新发布
03-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值