Carol.Kar
Carol.Kar

Reputation: 5355

Grails 2 Spring Core Plugin - The server requested password-based authentication, but no password was specified

I have installed the spring security core plugin in my application. After creating with s2-quickstart com.bahmanm.secureapp SecAppUser SecAppRole. I have gotten 2 more classes SecAppRole.groovy and SecAppUser.groovy in my domain layer. I have also added into my BootStrap.groovy:

class BootStrap {

  def init = { servletContext ->
    def adminRole = new SecAppRole(authority: 'ROLE_ADMIN').save(flush: true)
    def userRole = new SecAppRole(authority: 'ROLE_USER').save(flush: true)

    def testUser = new SecAppUser(username: 'admin', enabled: true, password: 'admin')
    testUser.save(flush: true)

    SecAppUserSecAppRole.create testUser, adminRole, true

    assert SecAppUser.count() == 1
    assert SecAppRole.count() == 2
    assert SecAppUserSecAppRole.count() == 1
  }

  def destroy = {
  }
}

However when running my app I get:

|Loading Grails 2.3.4
|Configuring classpath
.
|Environment set to development
.................................
|Packaging Grails application
Precompiling AST Transformations ...
src C:\Users\GrailsWorkspace\testApplication\target\work\plugins\postgresql-extensions-0.6.1 C:\Users\GrailsWorkspace\testApplication\target\classes
Done precompiling AST Transformations!
..
|Compiling 3 source files
...................................................
|Running Grails application
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Error |
2013-12-14 20:23:19,055 [localhost-startStop-1] ERROR pool.ConnectionPool  - Unable to create initial connections of pool.
Message: The server requested password-based authentication, but no password was specified.
    Line | Method
->>  444 | doAuthentication   in org.postgresql.core.v3.ConnectionFactoryImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    173 | openConnectionImpl in     ''
|     64 | openConnection . . in org.postgresql.core.ConnectionFactory
|    136 | <init>             in org.postgresql.jdbc2.AbstractJdbc2Connection
|     29 | <init> . . . . . . in org.postgresql.jdbc3.AbstractJdbc3Connection
|     21 | <init>             in org.postgresql.jdbc3g.AbstractJdbc3gConnection
|     31 | <init> . . . . . . in org.postgresql.jdbc4.AbstractJdbc4Connection
|     24 | <init>             in org.postgresql.jdbc4.Jdbc4Connection
|    410 | makeConnection . . in org.postgresql.Driver
|    280 | connect            in     ''
|    334 | innerRun . . . . . in java.util.concurrent.FutureTask$Sync
|    166 | run                in java.util.concurrent.FutureTask
|   1110 | runWorker . . . .  in java.util.concurrent.ThreadPoolExecutor
|    603 | run                in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . . .  in java.lang.Thread
Error |
2013-12-14 20:23:19,222 [localhost-startStop-1] ERROR pool.ConnectionPool  - Unable to create initial connections of pool.
Message: The server requested password-based authentication, but no password was specified.
    Line | Method
->>  444 | doAuthentication   in org.postgresql.core.v3.ConnectionFactoryImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    173 | openConnectionImpl in     ''
|     64 | openConnection . . in org.postgresql.core.ConnectionFactory
|    136 | <init>             in org.postgresql.jdbc2.AbstractJdbc2Connection
|     29 | <init> . . . . . . in org.postgresql.jdbc3.AbstractJdbc3Connection
|     21 | <init>             in org.postgresql.jdbc3g.AbstractJdbc3gConnection
|     31 | <init> . . . . . . in org.postgresql.jdbc4.AbstractJdbc4Connection
|     24 | <init>             in org.postgresql.jdbc4.Jdbc4Connection
|    410 | makeConnection . . in org.postgresql.Driver
|    280 | connect            in     ''
|    334 | innerRun . . . . . in java.util.concurrent.FutureTask$Sync
|    166 | run                in java.util.concurrent.FutureTask
|   1110 | runWorker . . . .  in java.util.concurrent.ThreadPoolExecutor
|    603 | run                in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . . .  in java.lang.Thread
Error |
2013-12-14 20:23:19,436 [localhost-startStop-1] ERROR pool.ConnectionPool  - Unable to create initial connections of pool.
Message: The server requested password-based authentication, but no password was specified.
    Line | Method
->>  444 | doAuthentication   in org.postgresql.core.v3.ConnectionFactoryImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    173 | openConnectionImpl in     ''
|     64 | openConnection . . in org.postgresql.core.ConnectionFactory
|    136 | <init>             in org.postgresql.jdbc2.AbstractJdbc2Connection
|     29 | <init> . . . . . . in org.postgresql.jdbc3.AbstractJdbc3Connection
|     21 | <init>             in org.postgresql.jdbc3g.AbstractJdbc3gConnection
|     31 | <init> . . . . . . in org.postgresql.jdbc4.AbstractJdbc4Connection
|     24 | <init>             in org.postgresql.jdbc4.Jdbc4Connection
|    410 | makeConnection . . in org.postgresql.Driver
|    280 | connect            in     ''
|    334 | innerRun . . . . . in java.util.concurrent.FutureTask$Sync
|    166 | run                in java.util.concurrent.FutureTask
|   1110 | runWorker . . . .  in java.util.concurrent.ThreadPoolExecutor
|    603 | run                in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . . .  in java.lang.Thread
Error |
2013-12-14 20:23:19,468 [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 org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was specified.
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 org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was specified.
    Line | Method
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | 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 org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was specified.
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | 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 org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was specified.
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | 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 org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was specified.
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was specified.
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread
Caused by PSQLException: The server requested password-based authentication, but no password was specified.
->>  444 | doAuthentication in org.postgresql.core.v3.ConnectionFactoryImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    173 | openConnectionImpl in     ''
|     64 | openConnection in org.postgresql.core.ConnectionFactory
|    136 | <init>    in org.postgresql.jdbc2.AbstractJdbc2Connection
|     29 | <init> .  in org.postgresql.jdbc3.AbstractJdbc3Connection
|     21 | <init>    in org.postgresql.jdbc3g.AbstractJdbc3gConnection
|     31 | <init> .  in org.postgresql.jdbc4.AbstractJdbc4Connection
|     24 | <init>    in org.postgresql.jdbc4.Jdbc4Connection
|    410 | makeConnection in org.postgresql.Driver
|    280 | connect   in     ''
|    334 | innerRun  in java.util.concurrent.FutureTask$Sync
|    166 | run       in java.util.concurrent.FutureTask
|   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread
Error |
Forked Grails VM exited with error

However, I do not have any password for my server?!?! What is meant by this output? I really appreciate your answer!

Upvotes: 1

Views: 847

Answers (1)

Burt Beckwith
Burt Beckwith

Reputation: 75671

This has nothing to do with Spring Security, it's a database connection pool error:

2013-12-14 20:23:19,055 [localhost-startStop-1] ERROR pool.ConnectionPool  - Unable to create initial connections of pool.
Message: The server requested password-based authentication, but no password was specified.
    Line | Method
->>  444 | doAuthentication   in org.postgresql.core.v3.ConnectionFactoryImpl

Check your DataSource.groovy connection information.

Upvotes: 4

Related Questions