2013-12-08 7 views
6

मैं Grails के लिए नया हूँ। मैं postgresql 9.0 डेटाबेस सर्वर को grails 2.3.4 के साथ कनेक्ट करने का प्रयास कर रहा हूं। मैंने postgresql-9.0-801.jdbc3.jar फ़ाइल को grails एप्लिकेशन के lib फ़ोल्डर में जोड़ा है। जब मैं इंटेलिज संपादक पर एप्लिकेशन चला रहा हूं तो निम्न त्रुटि प्राप्त कर रहा हूं। जहां मैं गलत कर रहा हूं?Grails के साथ पोस्टग्रेज़ डेटाबेस को कैसे कनेक्ट करें 2.3.4

|Running Grails application Error | 2013-12-08 18:44:55,837 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool. Message: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro Line | Method ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync 
| 138 | run in java.util.concurrent.FutureTask | 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 918 | run in ''^662 | run . . in java.lang.Thread Error | 2013-12-08 18:44:55,877 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool. Message: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro Line | Method ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync 
| 138 | run in java.util.concurrent.FutureTask | 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 918 | run in ''^662 | run . . in java.lang.Thread Error | 2013-12-08 18:44:56,160 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool. Message: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro Line | Method ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync 
| 138 | run in java.util.concurrent.FutureTask | 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 918 | run in ''^662 | run . . in java.lang.Thread Error | 2013-12-08 18:44:56,174 [localhost-startStop-1] ERROR context.GrailsContextLoader - 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 'lobHandlerDetector' while setting bean property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro Message: 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 'lobHandlerDetector' while setting bean property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro Line | Method ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync 
| 138 | run in java.util.concurrent.FutureTask | 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 918 | run in ''^662 | run . . in java.lang.Thread Caused by 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 'lobHandlerDetector' while setting bean property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync 
| 138 | run in java.util.concurrent.FutureTask | 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 918 | run in ''^662 | run . . in java.lang.Thread Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDetector' while setting bean property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync 
| 138 | run in java.util.concurrent.FutureTask | 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 918 | run in ''^662 | run . . in java.lang.Thread Caused by BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync 
| 138 | run in java.util.concurrent.FutureTask | 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 918 | run in ''^662 | run . . in java.lang.Thread Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync 
| 138 | run in java.util.concurrent.FutureTask | 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 918 | run in ''^662 | run . . in java.lang.Thread Caused by SQLException: Driver:[email protected] returned null for URL:jdbc:postgres://localhost/clientpro ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync 
| 138 | run in java.util.concurrent.FutureTask | 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 918 | run in ''^662 | run . . in java.lang.Thread Error | Forked Grails VM exited with error Process finished with exit code 1 

डेटा स्रोत फ़ाइल: -

dataSource { 
    pooled = true 
    driverClassName = "org.postgresql.Driver" 
    dialect = org.hibernate.dialect.PostgreSQLDialect 
    username = "postgres" 
    password = "password" 
} 
hibernate { 
    cache.use_second_level_cache = true 
    cache.use_query_cache = true 
    cache.provider_class='org.hibernate.cache.EhCacheProvider' 
} 
// environment specific settings 
environments { 
    development { 
     dataSource { 
     dbCreate = "update" 
     url = "jdbc:postgres://localhost/clientpro" 
     username = "postgres" 
     password = "password" 
     } 
    } 
    test { 
     dataSource { 
     dbCreate = "update" 
     url = "jdbc:postgres://localhost/clientpro" 
     username = "postgres" 
     password = "password" 
     } 
    } 
    production { 
     dataSource { 
     dbCreate = "update" 
     url = "jdbc:postgres://localhost/clientpro" 
     username = "postgres" 
     password = "password" 
     } 
    } 
} 

उत्तर

14

एक अलग उपसर्ग के साथ प्रयास करें:

url = "jdbc:postgresql://localhost/clientpro" 
+0

धन्यवाद :) यह –

+1

काम किया तुम मेरे जवाब चिह्नित कर सकते हैं के रूप में [स्वीकार किए जाते हैं] (http://stackoverflow.com/help/accepted-answer), अगर यह आपके लिए काम करता है। इसके अलावा, लॉग वर्तमान स्वरूप में मुश्किल से पठनीय हैं - मैंने उन्हें पहले संपादित करने की कोशिश की, लेकिन यह वास्तव में संभव नहीं है (इसे अगली बार ध्यान में रखें)। –

+0

मुझे विश्वास नहीं है कि उनके पास इतनी बेवकूफ कॉन्फ़िगरेशन मेल नहीं है। यह मेरे लिए भी काम करता था, लेकिन दोनों के लिए काम करना समझ में आया –

संबंधित मुद्दे