1 2 Previous Next 21 Replies Latest reply on Jul 23, 2012 4:56 AM by Rajendra J

    Problems with JBoss 7 + SQL Server

    Cesar Pizolato Newbie

      Hey guys, this is my first post and i need some help... and... sorry for my bad english (:

       

      I'm trying to deploy an EAR, but i got this "error":

       

      22:10:34,071 INFO  [org.jboss.jpa] (MSC service thread 1-5) starting Persistence Unit Service 'TAXI.ear/TAXIWeb.war#SITE_WEB' 
      22:10:34,144 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-5) HCANN000001: Hibernate Commons Annotations {4.0.0.CR2}
      22:10:34,150 INFO  [org.hibernate.Version] (MSC service thread 1-5) HHH00412:Hibernate Core {4.0.0.CR2}
      22:10:34,152 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-5) HHH00206:hibernate.properties not found
      22:10:34,153 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-5) HHH00021:Bytecode provider name : javassist
      22:10:34,166 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-5) HHH00204:Processing PersistenceUnitInfo [
                name: SITE_WEB
                ...]
      22:10:34,376 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-5) HHH00130:Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
      22:11:33,773 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]. Check the server configurationfile and the server logs to find more about the status of the deployment.
      22:11:33,773 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "TAXI.ear" was rolled back with failure message Operation cancelled
      

       

       

      Someone can help me ? I'm using JBoss 7.0.2 Final.

       

      Here is my WEB/Java Resources/src/META-INF/persistence.xml.

       

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
        version="2.0">
      
        <persistence-unit name="SITE_WEB" transaction-type="JTA">
                          <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>java:/SITE_TAXI</jta-data-source>
      
        <properties>
        <property name="hibernate.show_sql" value="false" />
        <property name="hibernate.format_sql" value="false" />
        <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
        <property name="hibernate.cache.use_second_level_cache"
        value="false" />
        <property name="hibernate.cache.use_query_cache" value="false" />
        </properties>
        </persistence-unit>
      
      </persistence>
      

       

       

      Thanks

        • 1. Re: Problems with JBoss 7 + SQL Server
          Tomaz Cerar Master

          Hi,

           

          how is your datasource configured?

           

           

          cheers,

          tomaz

          • 2. Re: Problems with JBoss 7 + SQL Server
            Cesar Pizolato Newbie
            <datasource jndi-name="java:/SITE_TAXI" pool-name="SITE_TAXI"  enabled="true" jta="true" use-java-context="true" use-ccm="true">
              <connection-url>
                jdbc:sqlserver://host;databaseName=dbName
              </connection-url>
              <driver>
                JTDS
              </driver>
              <new-connection-sql>
                select 1
              </new-connection-sql>
              <transaction-isolation>
                TRANSACTION_READ_COMMITTED
              </transaction-isolation>
              <pool>
                <min-pool-size>
                5
              </min-pool-size>
              <max-pool-size>
                50
              </max-pool-size>
              <prefill>
                false
              </prefill>
              <use-strict-min>
             false
              </use-strict-min>
              <flush-strategy>
             FailingConnectionOnly
              </flush-strategy>
            </pool>
              <security>
              <user-name>
                sa
              </user-name>
              <password>
                *****
              </password>
              </security>
              <validation>
              <check-valid-connection-sql>
                select 1
              </check-valid-connection-sql>
              <validate-on-match>
               false
              </validate-on-match>
              <background-validation>
               false
              </background-validation>
              <use-fast-fail>
                false
              </use-fast-fail>
              </validation>
              <timeout>
              <blocking-timeout-millis>
                5000
              </blocking-timeout-millis>
              <idle-timeout-minutes>
                15
              </idle-timeout-minutes>
              <set-tx-query-timeout />
              </timeout>
              <statement>
              <track-statements>
                FALSE
              </track-statements>
              </statement>
              </datasource>
              <drivers>
              <driver name="JTDS" module="com.microsoft.sqlserver">
              <xa-datasource-class>
                net.sourceforge.jtds.jdbcx.JtdsDataSource
              </xa-datasource-class>
              </driver>
            </drivers>
            

             

            Message was edited by: jaikiran pai - Fixed formatting for better visibility

            • 3. Re: Problems with JBoss 7 + SQL Server
              jaikiran pai Master
              22:11:33,773 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]. Check the server configurationfile and the server logs to find more about the status of the deployment.

               

              It looks like your deployment takes more than 60 seconds to deploy. You can configure the timeout value in JBOSS_HOME/standalone/configuration/standalone.xml:

               

              <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.0">
                          <deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir" path="deployments"  deployment-timeout="300"/>
                      </subsystem>
              

               

               

              By the way, I would recommend that you upgrade to the latest released 7.1.0.CR1b.

              • 4. Re: Problems with JBoss 7 + SQL Server
                Cesar Pizolato Newbie

                Hey man, thanks for your reply.

                 

                I'm at work now, but I will do this test at lunchtime. (My SQL Server is here in my office, and i was testing remoting access, i will do this teste here in local network to see too)

                 

                But i have a question, if i remove my persistence.xml, JBoss start in 2 seconds in my Mac, when i put persistence.xml in project, this increases to more than 60 seconds ? Why ?


                • 5. Re: Problems with JBoss 7 + SQL Server
                  jaikiran pai Master

                  Cesar Pizolato wrote:

                   

                  But i have a question, if i remove my persistence.xml, JBoss start in 2 seconds in my Mac, when i put persistence.xml in project, this increases to more than 60 seconds ? Why ?


                  The presence of persistence.xml triggers the building of entity manager factory and related metadata that's required for providing JPA support. It usually depends on how many entities you have and what kind of relationship they share.

                  • 6. Re: Problems with JBoss 7 + SQL Server
                    Prasad Deshpande Expert

                    I faced such problem when there is a problem with jdbc driver installation. My guess is on your JDBC driver.. Most probably, check your jdbc driver.

                     

                    1. Whether it's properly installed....

                    2. To me it seems you are using JTDS driver but connection URL you are using is more like microsoft driver "jdbc:sqlserver://host;databaseName=dbName" whereas for JTDS I use format like jdbc:jtds:sqlserver://<host>:<port>/<DB_NAME>;tds=8.0;lastupdatecount=true;tds=8.0;lastupdatecount=true;prepareSQL=0

                     

                    Couple of observations:

                    3. If you decide to use microsoft driver, then use microsoft Datasource class.

                    4. you are using <datasource>, but your driver class is <xa-datasource-class>..

                    • 7. Re: Problems with JBoss 7 + SQL Server
                      Cesar Pizolato Newbie

                      Thanks for both replys. Well, I still can't solve my problem. This is my configuration.

                       

                      In JBOSS_HOME/modules/ i create this structure:/com/microsoft/sqlserver/main/

                      Inside this folder i have: sqljdbc4.jar and module.xml

                       

                      <?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>

                       

                      My persistence.xml is exactly this (with no Entity maps yet)

                       

                      <persistence xmlns="http://java.sun.com/xml/ns/persistence"

                          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                          xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"

                          version="2.0">

                          <persistence-unit name="SITE_WEB" transaction-type="JTA">

                              <provider>org.hibernate.ejb.HibernatePersistence</provider>

                              <jta-data-source>java:/SITE_TAXI</jta-data-source>

                             <properties>

                                  <property name="hibernate.show_sql" value="false" />

                                  <property name="hibernate.format_sql" value="false" />

                                  <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />

                                  <property name="hibernate.cache.use_second_level_cache"

                                      value="false" />

                                  <property name="hibernate.cache.use_query_cache" value="false" />

                              </properties>

                          </persistence-unit>

                      </persistence>

                       

                       

                      And my standalone.xml

                       

                      <datasource jndi-name="java:/SITE_TAXI" pool-name="SITE_TAXI"

                                          enabled="true" jta="true" use-java-context="true" use-ccm="true">

                                          <connection-url>

                                              jdbc:sqlserver://ip_local_now_i_was_i_my_office;databaseName=db_name

                                          </connection-url>

                                          <driver>

                                              JTDS

                                          </driver>

                                          <new-connection-sql>

                                              select 1

                                          </new-connection-sql>

                                          <transaction-isolation>

                                              TRANSACTION_READ_COMMITTED

                                          </transaction-isolation>

                                          <pool>

                                              <min-pool-size>

                                                  5

                                              </min-pool-size>

                                              <max-pool-size>

                                                  50

                                              </max-pool-size>

                                              <prefill>

                                                  false

                                              </prefill>

                                              <use-strict-min>

                                                  false

                                              </use-strict-min>

                                              <flush-strategy>

                                                  FailingConnectionOnly

                                              </flush-strategy>

                                          </pool>

                                          <security>

                                              <user-name>

                                                  sa

                                              </user-name>

                                              <password>

                                                  fit01032007

                                              </password>

                                          </security>

                                          <validation>

                                              <check-valid-connection-sql>

                                                  select 1

                                              </check-valid-connection-sql>

                                              <validate-on-match>

                                                  false

                                              </validate-on-match>

                                              <background-validation>

                                                  false

                                              </background-validation>

                                              <use-fast-fail>

                                                  false

                                              </use-fast-fail>

                                          </validation>

                                          <timeout>

                                              <blocking-timeout-millis>

                                                  5000

                                              </blocking-timeout-millis>

                                              <idle-timeout-minutes>

                                                  15

                                              </idle-timeout-minutes>

                                              <set-tx-query-timeout />

                                          </timeout>

                                          <statement>

                                              <track-statements>

                                                  FALSE

                                              </track-statements>

                                          </statement>

                                      </datasource>

                                      <drivers>

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

                                              <xa-datasource-class>

                                                  net.sourceforge.jtds.jdbcx.JtdsDataSource

                                              </xa-datasource-class>

                                          </driver>

                                      </drivers>

                       

                      Anything wrong?

                      • 8. Re: Problems with JBoss 7 + SQL Server
                        Cesar Pizolato Newbie

                        I tried to change my drivers to:

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

                             <driver-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</driver-class>

                        </driver>

                         

                        And connection url to:

                        <connection-url>

                              jdbc:jtds:sqlserver://192.168.0.11:1433/tradeit_marcelo;tds=8.0;lastupdatecount=true;tds=8.0;lastupdatecount=true;prepareSQL=0

                        </connection-url>

                         

                        But, i have this error now in JBoss

                           New missing/unsatisfied dependencies:

                              service jboss.jdbc-driver.JTDS (missing)

                         

                        What i have to do? What is the better way? This or the posted up?

                        • 9. Re: Problems with JBoss 7 + SQL Server
                          Prasad Deshpande Expert

                          Cesar Pizolato wrote:

                           

                          <datasource jndi-name="java:/SITE_TAXI" pool-name="SITE_TAXI"

                                              enabled="true" jta="true" use-java-context="true" use-ccm="true">

                                              <connection-url>

                                                  jdbc:sqlserver://ip_local_now_i_was_i_my_office;databaseName=db_name

                                              </connection-url>

                                              <driver>

                                                  JTDS

                                              </driver>

                                              <new-connection-sql>

                                                  select 1

                                              </new-connection-sql>

                                              <transaction-isolation>

                                                  TRANSACTION_READ_COMMITTED

                                              </transaction-isolation>

                                              <pool>

                                                  <min-pool-size>

                                                      5

                                                  </min-pool-size>

                                                  <max-pool-size>

                                                      50

                                                  </max-pool-size>

                                                  <prefill>

                                                      false

                                                  </prefill>

                                                  <use-strict-min>

                                                      false

                                                  </use-strict-min>

                                                  <flush-strategy>

                                                      FailingConnectionOnly

                                                  </flush-strategy>

                                              </pool>

                                              <security>

                                                  <user-name>

                                                      sa

                                                  </user-name>

                                                  <password>

                                                      fit01032007

                                                  </password>

                                              </security>

                                              <validation>

                                                  <check-valid-connection-sql>

                                                      select 1

                                                  </check-valid-connection-sql>

                                                  <validate-on-match>

                                                      false

                                                  </validate-on-match>

                                                  <background-validation>

                                                      false

                                                  </background-validation>

                                                  <use-fast-fail>

                                                      false

                                                  </use-fast-fail>

                                              </validation>

                                              <timeout>

                                                  <blocking-timeout-millis>

                                                      5000

                                                  </blocking-timeout-millis>

                                                  <idle-timeout-minutes>

                                                      15

                                                  </idle-timeout-minutes>

                                                  <set-tx-query-timeout />

                                              </timeout>

                                              <statement>

                                                  <track-statements>

                                                      FALSE

                                                  </track-statements>

                                              </statement>

                                          </datasource>

                                          <drivers>

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

                                                  <xa-datasource-class>

                                                      net.sourceforge.jtds.jdbcx.JtdsDataSource

                                                  </xa-datasource-class>

                                              </driver>

                                          </drivers>

                           

                          Anything wrong?

                          As I said, <connection-url> you are using is for microsoft jdbc driver, whereas net.sourceforge.jtds.jdbcx.JtdsDataSource is JTDS jdbc driver. You have to change your driver class to use microsoft one (which I think is com.microsoft.sqlserver.jdbc.SQLServerDriver).

                          • 10. Re: Problems with JBoss 7 + SQL Server
                            Prasad Deshpande Expert

                            Cesar Pizolato wrote:

                             

                            I tried to change my drivers to:

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

                                 <driver-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</driver-class>

                            </driver>

                             

                            And connection url to:

                            <connection-url>

                                  jdbc:jtds:sqlserver://192.168.0.11:1433/tradeit_marcelo;tds=8.0;lastupdatecount=true;tds=8.0;lastupdatecount=true;prepareSQL=0

                            </connection-url>

                             

                            But, i have this error now in JBoss

                               New missing/unsatisfied dependencies:

                                  service jboss.jdbc-driver.JTDS (missing)

                             

                            What i have to do? What is the better way? This or the posted up?

                            This (JTDS) won't work as your module is using microsoft jdbc driver (<resource-root path="sqljdbc4.jar"/> in your earlier post). You'll need to install/replace that with JTDS driver which something like jtds<version>.jar

                            • 11. Re: Problems with JBoss 7 + SQL Server
                              Prasad Deshpande Expert

                              Here is my JTDS module.xml

                               

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

                                <resources>

                                  <resource-root path="jtds-1.2.jar"/>

                                      <!-- Insert resources here -->

                                </resources>

                                <dependencies>

                                  <module name="javax.api"/>

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

                                </dependencies>

                              </module>

                               

                              and here is my datasource

                               


                              <datasource jndi-name="java:jboss/datasources/eFpNonXADataSource" pool-name="eFpNonXaDS" enabled="true">

                              <connection-url>jdbc:jtds:sqlserver://<IP>:<port>/<db>;tds=8.0;lastupdatecount=true;tds=8.0;lastupdatecount=true;prepareSQL=0</connection-url>

                              <driver>mssqlNonXA</driver>

                              <security>

                              <user-name>sdsd</user-name>

                              <password>sds</password>

                              </security>

                              </datasource>

                              <drivers>

                              <driver name="mssqlNonXA" module="com.mssql">

                              <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>

                              </driver>

                              </drivers>

                               

                              Hope this helps

                              • 12. Re: Problems with JBoss 7 + SQL Server
                                Cesar Pizolato Newbie

                                I tried the another JAR, but i still have this error now:

                                 

                                New missing/unsatisfied dependencies:

                                      service jboss.jdbc-driver.mssqlNonXA (missing)

                                 

                                Where i have to put jtds-1.2.5.jar / module.xml ?

                                 

                                I tried this folders:

                                 

                                modules/net/sourceforge/jtds/jdbc/

                                modules/net/sourceforge/jtds/jdbc/main/

                                modules/net/sourceforge/jtds/

                                modules/net/sourceforge/jtds/main/

                                • 13. Re: Problems with JBoss 7 + SQL Server
                                  Prasad Deshpande Expert
                                  New missing/unsatisfied dependencies:

                                        service jboss.jdbc-driver.mssqlNonXA (missing)

                                  That is a name in my standalone.xml for <driver> tag.. you'll need yours..

                                   

                                  You'll firstly need to install a module driver for jtds. You can do so as following

                                   

                                  1. Create directory structure as <jboss_home>/modules/net/sourceforge/jtds/main/

                                  2. Inside that put jtds-1.2.5.jar & module.xml

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

                                  <module xmlns="urn:jboss:module:1.0" name="net.sourceforge.jtds">

                                    <resources>

                                      <resource-root path="jtds-1.2.jar"/>

                                          <!-- Insert resources here -->

                                    </resources>

                                    <dependencies>

                                      <module name="javax.api"/>

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

                                    </dependencies>

                                  </module>

                                  3. Now "net.sourceforge.jtds" is the name of your module which you need to use in your datasources subsystem like..

                                   

                                  <drivers>

                                  <driver name="mssqlNonXA" module="net.sourceforge.jtds">

                                  <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>

                                  </driver>

                                  </drivers>

                                  4. and now you can use "mssqlNonXA" as driver name in your datasource/driver tag as show in my earlier post.

                                  1 of 1 people found this helpful
                                  • 14. Re: Problems with JBoss 7 + SQL Server
                                    Cesar Pizolato Newbie

                                    Finally friends, now it's working !! Thank you for your help and congratulations for the great work done in JBoss.

                                    1 2 Previous Next