问题
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)
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>
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>
回答1:
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>
来源:https://stackoverflow.com/questions/9112500/resolve-jboss-data-source-configuration-issue