3 Replies Latest reply on Feb 18, 2009 7:56 AM by chong ming

    Cannot connect to the JNDI: No valid JNDI mapping

    chong ming Newbie

      Greetings,

      currently i doing my school project using the jboss-4.0.3SP1, spring and hibernate. My codes are just to save a new user into a database. However when i run my codes in jboss, it hit this error:

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

      I tried to find the jboss-web folder but i cant find. Am i on the roght track? This is what i have set up in my application:

      This is what i set up in the mssql-ds.xml:

      <local-tx-datasource>
      <jndi-name>graffitiDB</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/graffiti</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>data</user-name>
      base

      <type-mapping>mySQL</type-mapping>


      </local-tx-datasource>


      Inside the web.xml, this is what i put for the <resource-ref>

      <resource-ref>
      <res-ref-name>jdbc/graffitiDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>


      My codes can be download from here: http://www.nabble.com/file/p22038655/source.zip

      Thanks for the help in advance :)