Resolve Jboss data source configuration issue

牧云@^-^@ 提交于 2019-12-11 07:45:52

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!