Pessoal estou brincando aqui com o Security, estou pegando um erro esquizzzzzzzzzzzzito !
[quote]Your login attempt was not successful, try again.
Reason: PreparedStatementCallback; SQL [SELECT users.username,users.password, authorities.authority FROM sigi.users,sigi.authorities]; O índice da coluna está fora do intervalo: 1, número de colunas: 0.; nested exception is org.postgresql.util.PSQLException: O índice da coluna está fora do intervalo: 1, número de colunas: 0.; nested exception is org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [SELECT users.username,users.password, authorities.authority FROM sigi.users,sigi.authorities]; O índice da coluna está fora do intervalo: 1, número de colunas: 0.; nested exception is org.postgresql.util.PSQLException: O índice da coluna está fora do intervalo: 1, número de colunas: 0.[/quote]
http://lh6.ggpht.com/_nTzBoYSeT2I/TG5ixqLVkhI/AAAAAAAAECU/jpRbUiQnks8/s800/erro.png
o meu arquivo de configuração : aplicationContext.xml
ta assim:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:lang="http://www.springframework.org/schema/lang"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.xsd
http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang-2.5.xsd">
<context:property-placeholder location="classpath:application.properties"/>
<context:component-scan base-package="org.primefaces.examples.moviecollector" />
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="prime-moviecollector"/>
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="databasePlatform" value="${database.target}"/>
<property name="showSql" value="${database.showSql}" />
<property name="generateDdl" value="${database.generateDdl}" />
</bean>
</property>
</bean>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" destroy-method="close">
<property name="driverClassName" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="url" value="jdbc:postgresql://localhost:5432/nutec"/>
<property name="username" value="root"/>
<property name="password" value="debian23"/>
</bean>
<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<security:http auto-config='true'>
<security:intercept-url pattern="/**" access="ROLE_USER" />
<!--<security:intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />-->
<security:concurrent-session-control max-sessions="1"/>
<security:logout logout-url="/logout" logout-success-url="/"/>
</security:http>
<security:authentication-provider>
<security:jdbc-user-service data-source-ref="dataSource"
users-by-username-query="SELECT users.username,users.password,
authorities.authority FROM sigi.users,sigi.authorities"/>
</security:authentication-provider>
</beans>
este select:
SELECT users.username,users.password,users.enabled,users.authorities FROM sigi.users
Retorna os valores que a documentação pedi !:
http://lh6.ggpht.com/_nTzBoYSeT2I/TG6kY9HoABI/AAAAAAAAEC8/uSWIaa3h8fY/s800/select.png