解决Jboss数据源配置问题 [英] Resolve Jboss data source configuration issue
本文介绍了解决Jboss数据源配置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 jboss 5.0 AS 中配置了数据源之后,我部署了 jbpm Web应用程序. 我收到了例外.
After configuring the datasources in the jboss 5.0 AS, I deployed the jbpm web application. Im getting the the exception.
java.lang.RuntimeException: mapped-name is required for simpleds of deployment webapple.war
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceEnvRefs(WebResourceHand
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(WebResourceHandler.java:325)
web.xml配置为
The web.xml configuration is
<resource-env-ref>
<resource-env-ref-name>simpleds</resource-env-ref-name>
<resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
</resource-env-ref>
mysql-ds.xml配置为
The mysql-ds.xml configuration is
<datasources><xa-datasource>
<jndi-name>simpleds</jndi-name>
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:mysql://localhost:3306/testdb</xa-datasource-property>
<user-name>abc</user-name>
<password>abc</password></xa-datasource></datasources>
推荐答案
在JBoss 5AS中部署Web应用程序时,我们必须在web-inf的jboss-web.xml中定义数据源.
While deploying a web application in JBoss 5AS, We have to define the datasource in jboss-web.xml in web-inf.
<?xml version="1.0" encoding="UTF-8"?><jboss-web><resource-ref>
<res-ref-name>java:simpleds</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:simpleds</jndi-name>
</resource-ref>
这篇关于解决Jboss数据源配置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文