7 Replies Latest reply on Mar 22, 2013 2:11 AM by nickarls

    JBoss 7 JNDI Not bound for MSSQL driver

    geetha2

      Hi,

       

      I am trying to resolve this JNDI bound issue from 1 day and cannot do it. Please help!!

       

      I get this error while trying to bound JNDI to SQL server driver.

       

      JBAS014775:New missing/unsatisfied dependencies:
        service jboss.jdbc-driver.sqlserver (missing) dependents: [service jboss.data-source.java:jboss/datasources/MySqlDS]

       

      Jboss-web.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-web xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">

      <!-- <context-root>cms</context-root>  -->

         <resource-ref>

               <res-ref-name>jboss/datasources/MySqlDS</res-ref-name>

               <jndi-name>java:jboss/datasources/MySqlDS</jndi-name>

           </resource-ref>

      </jboss-web>

       

      standalone.xml

       

      <datasources>

                      <datasource jndi-name="java:jboss/datasources/MySqlDS" pool-name="main_pool" enabled="true" use-java-context="false">

                          <connection-url>jdbc:sqlserver://insdevapp:1433;databaseName=MyDBName</connection-url>

                          <driver>sqlserver</driver>

                          <security>

                              <user-name>XXX</user-name>

                              <password>YYY</password>

                          </security>

                      </datasource>

                      <drivers>

                          <driver name="sqljdbc4" module="com.microsoft.sqlserver">

                              <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</xa-datasource-class>

                          </driver>

                      </drivers>

         </datasources>

       

      Under modules\com\microsoft\sqlserver I placed module.xml and sqljdbc4.jar

       

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.0" name="com.microsoft.sqlserver">

          <resources>

              <resource-root path="sqljdbc4.jar"/>

          </resources>

          <dependencies>

              <module name="javax.api"/>

              <module name="javax.transaction.api"/>

          </dependencies>

      </module>

        • 1. Re: JBoss 7 JNDI Not bound for MSSQL driver
          wdfink

          I suppose you miss a directory in the structure.

          The module need to be under modules/com/microsoft/sqlserver/main

          See wiki

          • 2. Re: JBoss 7 JNDI Not bound for MSSQL driver
            geetha2

            It is still the same, I placed both files under main

            JBAS014775:New missing/unsatisfied dependencies:
              service jboss.jdbc-driver.sqljdbc (missing) dependents: [service jboss.data-source.java:jboss/datasources/MySqlDS]

             

            On the other hand, I tried to add driver using standalone@localhost:9999:/subsystem=datasources/jdbc-driver=sqljdbc:add(driver-name=sqljdbc,driver-module-name=com.microsoft.sqlserver,driver-xa-datasource-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver)

             

             

            For reference, (above one is modified little bit)

            <datasources>

                            <datasource jndi-name="java:jboss/datasources/MySqlDS" pool-name="main_pool" enabled="true" use-java-context="false">

                                <connection-url>jdbc:sqlserver://Cmssqldev01:1433;databaseName=CMS</connection-url>

                                <driver>sqljdbc</driver>

                                <security>

                                    <user-name>JBossSQLUser</user-name>

                                    <password>JB055U53r</password>

                                </security>

                            </datasource>

                            <drivers>

                                <driver name="sqljdbc" module="com.microsoft.sqlserver">

                                    <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</xa-datasource-class>

                                </driver>

                            </drivers>

                        </datasources>

            • 3. Re: JBoss 7 JNDI Not bound for MSSQL driver
              geetha2

              Capture.PNG

              • 4. Re: JBoss 7 JNDI Not bound for MSSQL driver
                wdfink

                You can not add the driver twice, therfor the duplicatio resource is shown

                • 5. Re: JBoss 7 JNDI Not bound for MSSQL driver
                  wdfink

                  Add the driver as module first (withut DS), you should see a log message that the driver is added.

                  Than add the datasource as shown in the wiki to see whether you see a correct message.

                  Start as simple as possible.

                  • 6. Re: JBoss 7 JNDI Not bound for MSSQL driver
                    geetha2

                    I am stuck with another issue. I get this error message that tld is not found

                     

                    ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/myapp].[jsp]] (http-localhost-127.0.0.1-8080-2) Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: File "symcs.tld" not found

                        at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) [jbossweb-7.0.13.Final.jar:]

                        at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) [jbossweb-7.0.13.Final.jar:]

                        at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116) [jbossweb-7.0.13.Final.jar:]

                        at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:177) [jbossweb-7.0.13.Final.jar:]

                        at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:386) [jbossweb-7.0.13.Final.jar:]

                        at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:448) [jbossweb-7.0.13.Final.jar:]

                        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1398) [jbossweb-7.0.13.Final.jar:]

                        at org.apache.jasper.compiler.Parser.parse(Parser.java:130) [jbossweb-7.0.13.Final.jar:]

                        at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255) [jbossweb-7.0.13.Final.jar:]

                     

                    I have placed symcs.tld under /WEB-INF/lib folder. My index.jsp has <%@ taglib uri="symcs.tld" prefix="symcs" %>

                     

                    In my web.xml also I have defined tag lib

                         <taglib>

                            <taglib-uri>symcs.tld</taglib-uri>

                             <taglib-location>WEB-INF/symcs.tld</taglib-location>

                          </taglib>

                     

                    However I get that issue? not sure what location it is looking for. I also tried <taglib-location>WEB-INF/lib/symcs.tld</taglib-location>

                    • 7. Re: JBoss 7 JNDI Not bound for MSSQL driver
                      nickarls

                      (You might want to start separate threads in the future)

                       

                      If you put the file in the lib, I think you also need the "lib" part in the taglib-location 

                       

                      http://docs.oracle.com/cd/E15051_01/wls/docs103/taglib/admin.html (one would think it applies for JBoss too, first google hit)