4 Replies Latest reply on Dec 19, 2017 12:23 PM by tarak.paruchuru

    Jboss7.2  server not able to deploy application having dependency to datasource

    tarak.paruchuru

      Server log, errors

       

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceUnproxied': Invocation of init method failed; nested except

      ion is javax.naming.NameNotFoundException: Error looking up jdbc/cts, service service jboss.naming.context.java.jdbc.cts is not started

              ... 9 more

      Caused by: javax.naming.NameNotFoundException: Error looking up jdbc/cts, service service jboss.naming.context.java.jdbc.cts is not started

              at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:132)

              at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:80)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)

              at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:120)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)

              at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_45]

       

      17:54:43,976 ERROR [org.codehaus.groovy.grails.web.context.GrailsContextLoader] (ServerService Thread Pool -- 55) Error initializing the application: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Cannot resolve reference to bean 'dataSourceLazy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceLazy': Cannot resolve reference to bean 'dataSourceUnproxied' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceUnproxied': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Error looking up jdbc/cts, service service jboss.naming.context.java.jdbc.cts is not started: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Cannot resolve reference to bean 'dataSourceLazy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceLazy': Cannot resolve reference to bean 'dataSourceUnproxied' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceUnproxied': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Error looking up jdbc/cts, service service jboss.naming.context.java.jdbc.cts is not started

              at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final.jar:7.2.0.Final]

              at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final.jar:7.2.0.Final]

              at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final.jar:7.2.0.Final]

       

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.driver-demander.java:/jdbc/cts, service jboss.data-source.java:/jdbc/cts, service jboss.driver-demander.java:/jdbc/taxportalmysqlDS, service jboss.data-source.java:/jdbc/taxportalmysqlDS]

      JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./GCRT: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./GCRT: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context

        • 1. Re: Jboss7.2  server not able to deploy application having dependency to datasource
          paramjindal

          Looks like your application GCRT is dependent on a datasource java:/jdbc/cts which is not registered yet.

          Check your standalone.xml file if you even have a datasource configured with this JNDI name or not. If not then you have to create this datasource first.

           

          Also you can check in the logs whether JBoss server has successfully bound this JNDI. Just search for all occurrence of the string jdbc/cts

          1 of 1 people found this helpful
          • 2. Re: Jboss7.2  server not able to deploy application having dependency to datasource
            tarak.paruchuru

            ds configuration

             

             

              <subsystem xmlns="urn:jboss:domain:datasources:1.1">

                        <datasources>

                    <datasource jta="true" jndi-name="java:/jdbc/cts" pool-name="cts" enabled="true" use-java-context="true" use-ccm="true">

                    <connection-url>jdbc:mysql://hfqafinmysql1.vm.itg.corp.us.shldcorp.com:3372/cts_dev?autoreconnect=true&amp;zeroDateTimeBehavior=convertToNull</connection-url>

                            <driver>mysql</driver>

                            <security>

                              <security-domain>mysqlDomain</security-domain>

                            </security>

             

             

                              <pool>

                                <min-pool-size>0</min-pool-size>

                                <max-pool-size>20</max-pool-size>

                                <prefill>true</prefill>

                              </pool>

             

             

                              <validation>

                                 <check-valid-connection-sql>select 1</check-valid-connection-sql>

                                 <validate-on-match>false</validate-on-match>

                                 <background-validation>false</background-validation>

                                 <exception-sorter class-name="org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter"/>

                             </validation>

                             <timeout>

                                 <blocking-timeout-millis>30000</blocking-timeout-millis>

                                 <idle-timeout-minutes>5</idle-timeout-minutes>

                                 <query-timeout>300</query-timeout>

                              </timeout>

                             <statement>

                                 <prepared-statement-cache-size>16</prepared-statement-cache-size>

                                 <share-prepared-statements>false</share-prepared-statements>

                             </statement>

             

                      <datasource jta="true" jndi-name="java:/jdbc/taxportalmysqlDS" pool-name="taxportalmysqlDS_pool" enabled="true" use-java-context="true" use-ccm="true">

                            <connection-url>jdbc:mysql://hfqafinmysql1.vm.itg.corp.us.shldcorp.com:3372/taxp_qa</connection-url>

                            <driver>mysql</driver>

                            <security>

                              <security-domain>mysqlDomain1</security-domain>

                            </security>

                            <pool>

                                <min-pool-size>0</min-pool-size>

                                <max-pool-size>20</max-pool-size>

                                <prefill>true</prefill>

                              </pool>

                              <validation>

                                 <check-valid-connection-sql>select 1</check-valid-connection-sql>

                                 <validate-on-match>false</validate-on-match>

                                 <background-validation>false</background-validation>

                                 <exception-sorter class-name="org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter"/>

                             </validation>

                             <timeout>

                                 <blocking-timeout-millis>30000</blocking-timeout-millis>

                                 <idle-timeout-minutes>5</idle-timeout-minutes>

                                 <query-timeout>300</query-timeout>

                              </timeout>

                             <statement>

                                 <prepared-statement-cache-size>16</prepared-statement-cache-size>

                                 <share-prepared-statements>false</share-prepared-statements>

                             </statement>

                           </datasource>

             

            Drivers

             

            <drivers>

                            <driver name="mysql" module="com.mysql"/>

                            <driver name="oracle" module="com.oracle"/>

                            <driver name="db2" module="com.ibm.db2">

                              <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>

                            </driver>

                         </drivers>

             

             

            Server log

            • 3. Re: Jboss7.2  server not able to deploy application having dependency to datasource
              paramjindal

              Hi Tarak,

               

              It can be a issue with your mysql driver because in the below logs you can see oracle and db2 driver has started fine but not mysql:

               

              17:54:25,813 INFO  [org.apache.coyote.http11] (MSC service thread 1-3) JBWEB003000: Coyote HTTP/1.1 starting on: http-/0.0.0.0:8180

              17:54:26,311 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.1)

              17:54:26,328 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Deploying JDBC-compliant driver class com.ibm.db2.jcc.DB2Driver (version 4.11)

              17:54:26,385 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory

               

              and later I can see :

               

              17:54:31,839 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

              17:54:31,842 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

              17:54:32,052 INFO  [org.jboss.web] (ServerService Thread Pool -- 55) JBAS018210: Register web context: /GCRT

               

              It is showing mysql as non complaint driver and from the logs it is confirmed that your "cts" and "taxportalmysqlDS" has not bounded.

               

              Can you check the mysql driver version in this environment and in other environments where your mysql datasource is wokring fine and also check the logs from one of the working environment where it is showing that driver as JDBC-compliant or non-JDBC-compliant.

               

              -Param

              1 of 1 people found this helpful
              • 4. Re: Jboss7.2  server not able to deploy application having dependency to datasource
                tarak.paruchuru

                I have my drivers with the latest one along with the path specified and thy are working fine now.