2 Replies Latest reply on Apr 7, 2009 8:18 PM by cshannon

    Can't use MySql under JBOSSWS (Works under JBOSS)

      I have successfully deployed a MySql connection under JBoss, but when trying to reference the same connection under a JBoss-WS I get the error:

      java.lang.RuntimeException: mapped-name is required for jdbc/MySqlDS of deployment xxxx.war

      I have added the resource information to the web.xml and the jboss-web.xml files in the jbossws-sar but it doesnt work, the service still fails to deploy.

      Does anyone know how to set up MySql under JBossWS?

      Currently using JBOSS 5.0.1.GA and JBOSSWS 3.1.0.GA on Ubuntu and Java 6

        • 1. Re: Can't use MySql under JBOSSWS (Works under JBOSS)
          peterj

           

          have added the resource information to the web.xml and the jboss-web.xml files in the jbossws-sar


          Try adding it to the WEB-INF directory in your WAR file. (I assume you have a POJO-based web service and not an EJB-based web service.)

          If that doesn't work, post the full stack trace and the contents of the web.xml and jboss-web.xml file. And let us know what kind of web service you have.

          • 2. Re: Can't use MySql under JBOSSWS (Works under JBOSS)

            Thanks for taking a look at this. The resource ref is in my web.xml file, like I said it works perfectly under JBOSS, the webservice I am doing is just a helloworld, the only difference is that I try to connect to the database. All code that works fine. It is some kind of configuration problem.

            web.xml

            <web-app>
            <resource-ref>
             <description>MySql Dataset Definition</description>
             <res-ref-name>jdbc/MySqlDS</res-ref-name>
             <jndi-name>java:/MySqlDS</jndi-name>
             <res-type>javax.sql.DataSource</res-type>
             <res-auth>Container</res-auth>
            </resource-ref>
            <display-name>postSubmission</display-name>
            </web-app>


            and my jboss-web.xml
            <?xml version="1.0" encoding="ISO-8859-1"?>
            <!DOCTYPE jboss-web
             PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
             "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
            <jboss-web>
            
             <!-- A security domain that restricts access
             <security-domain>java:/jaas/JBossWS</security-domain>
             -->
             <context-root>jbossws</context-root>
            <resource-ref>
             <res-ref-name>jdbc/MySqlDS</res-ref-name>
             <jndi-name>java:/MySqlDS</jndi-name>
            </resource-ref>
            </jboss-web>


            It's like JBOSSWS cant find the mysql-ds.xml or something. I tried to copy that into the jbossws deployment folder but then it error-ed out saying that it was already defined.