私のWebサービスで私の機能を記憶していますが、問題はTomcatに基づいてサーバーを再起動するとサーバーがpersistent_loginsテーブルからすべてのレコードを削除したことです。春のセキュリティはすべて私のトークンを覚えています
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa-1.8.xsd">
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
</mvc:message-converters>
</mvc:annotation-driven>
<context:component-scan base-package="com.bitcointech.*" />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
id="entityManagerFactory">
<property name="packagesToScan" value="com.bitcointech.entities" />
<property name="dataSource" ref="dataSource" />
<property name="jpaProperties">
<props>
<prop key="hibernate.databasePlatform">
org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<property name="persistenceProvider">
<bean class="org.hibernate.jpa.HibernatePersistenceProvider" />
</property>
</bean>
<mvc:resources mapping="/resources/**" location="/WEB-INF/resources/"
cache-period="31556926"/>
<mvc:annotation-driven />
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean class="org.springframework.orm.jpa.JpaTransactionManager"
id="transactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<jpa:repositories base-package="com.bitcointech.repositories"
entity-manager-factory-ref="entityManagerFactory">
</jpa:repositories>
春のセキュリティファイル:
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.2.xsd">
<http auto-config="true" use-expressions="true">
<intercept-url pattern="/admin**" access="hasRole('ROLE_USER')" />
<intercept-url pattern="/advance**" access="hasRole('ROLE_USER')" />
<intercept-url pattern="/changeState**" access="hasRole('ROLE_USER')"/>
<intercept-url pattern="/history**" access="hasRole('ROLE_USER')"/>
<form-login
login-page="/login"
default-target-url="/admin"
authentication-failure-url="/login?error"
username-parameter="token"
password-parameter="password" />
<logout logout-success-url="/admin" />
<csrf/>
<session-management>
<concurrency-control max-sessions="10" session-registry-alias="sessionRegistry" />
</session-management>
<remember-me token-validity-seconds="31536000"
remember-me-parameter="remember-me"
data-source-ref="dataSource" />
</http>
<authentication-manager>
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query=
"select token, password, enabled from users where token = ?"
authorities-by-username-query=
"select token, role from user_roles where token = ?" />
</authentication-provider>
</authentication-manager>
任意のアイデアはどのようにそれを変更するには、ここに私のサーブレット構成ファイルはありますか?
[OK]を、動作しているようですが、私は一つの例外を持っていますこれは: "org.springframework.beans.factory.parsing.BeanDefinitionParsingException:設定の問題:user-service-ref属性をchildelementsのuser-service、jdbc-user-serviceまたはldapと組み合わせて使用することはできません-user-service '" – Dragomirus2
これらの設定を表示してください – fg78nc