2013-12-14 1 views
1

Я установил spring security core plugin в свое приложение. После создания с s2-quickstart com.bahmanm.secureapp SecAppUser SecAppRole. Я получил еще 2 класса SecAppRole.groovy и SecAppUser.groovy в своем домене. Я также добавил в мой BootStrap.groovy:Grails 2 Spring Core Plugin - сервер запросил аутентификацию на основе пароля, но пароль не был указан

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 = { 
    } 
} 

Однако при запуске моего приложения я получаю:

|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 

Однако, у меня нет никакого пароля для моего сервера?!?! Что подразумевается под этим выходом? Я очень ценю ваш ответ!

ответ

4

Это не имеет ничего общего с Spring Security, это ошибка подключения пула базы данных:

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 

Проверьте информацию о подключении DataSource.groovy.

+0

У меня нет пароля для пользователя db! Мне нужен пароль или я могу просто оставить это поле пустым? – mrquad

+1

Я не уверен, я не использую Postgres много. Возможно, вам потребуется назначить хотя бы простой пароль. –

 Смежные вопросы

  • Нет связанных вопросов^_^