CAS JPA服务注册表未创建

时间:2016-04-16 21:18:09

标签: single-sign-on cas

我使用this overlay模板(版本4.2)作为我的服务管理Web控制台。现在我运行它并且它在json服务注册模式下工作,我想使用JPA服务注册,我在CAS git页面上阅读文档对于此版本here。我按照那里的说明操作,但我得到以下错误:


Caused by: org.postgresql.util.PSQLException: ERROR: relation "registeredserviceimpl" does not exist

根据文档,如果我有权限Create / Alter,则应自动创建表。表" registeredserviceimpl_props"已创建,但表" registeredserviceimpl"我运行app后没有创建。我不知道这个版本的表模式(4.2.x)手动创建表。 这是我的cas-management.properties:

cas.host=https://localhost:8443
cas.prefix=${cas.host}
cas.securityContext.casProcessingFilterEntryPoint.loginUrl=${cas.prefix}/login
cas-management.host=https://localhost:2525
cas-management.prefix=${cas-management.host}/cas-management
cas-management.securityContext.serviceProperties.service=${cas-management.prefix}/callback
cas-management.securityContext.serviceProperties.adminRoles=ROLE_ADMIN
pac4j.callback.defaultUrl=/manage.html
cas-management.viewResolver.basename=default_views
svcreg.database.ddl.auto=create-drop
svcreg.database.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
svcreg.database.hibernate.batchSize=10
svcreg.database.driverClass=org.postgresql.Driver
svcreg.database.url=jdbc:postgresql://localhost:5432/CAS-Server
svcreg.database.user=ali
svcreg.database.password=123456
svcreg.database.pool.minSize=6
svcreg.database.pool.maxSize=18
svcreg.database.pool.maxWait=10000
svcreg.database.pool.maxIdleTime=120
svcreg.database.pool.acquireIncrement=6
svcreg.database.pool.idleConnectionTestPeriod=30
svcreg.database.pool.connectionHealthQuery=select 1
svcreg.database.pool.acquireRetryAttempts=5
svcreg.database.pool.acquireRetryDelay=2000

这是我的managementConfigContext.xml:

<bean>


 <?xml version="1.0" encoding="UTF-8"?>



<!--
This bean defines the security roles for the Services Management application.  Simple deployments can use the in-memory version.
More robust deployments will want to use another option, such as the Jdbc version.

The name of this should remain "authorizationGenerator" in order for the pac4j security context to find it.
 -->
<util:properties id="userProperties" location="classpath*:user-details.properties" />

<bean id="authorizationGenerator" class="org.pac4j.core.authorization.generator.SpringSecurityPropertiesAuthorizationGenerator">
    <constructor-arg name="properties" ref="userProperties" />
</bean>

<!-- 
Bean that defines the attributes that a service may return.  This example uses the Stub/Mock version.  A real implementation
may go against a database or LDAP server.  The id should remain "attributeRepository" though.
 -->
<bean id="attributeRepository"
      class="org.jasig.services.persondir.support.StubPersonAttributeDao" p:backingMap-ref="backingMap">
</bean>

<util:map id="backingMap">
    <entry key="uid" value="uid"/>
    <entry key="eduPersonAffiliation" value="eduPersonAffiliation"/>
    <entry key="groupMembership" value="groupMembership"/>
</util:map>




<bean id="auditTrailManager" class="org.jasig.inspektr.audit.support.Slf4jLoggingAuditTrailManager"/>

<bean
        id="dataSource"
        class="com.mchange.v2.c3p0.ComboPooledDataSource"
        p:driverClass="${svcreg.database.driverClass}"
        p:jdbcUrl="${svcreg.database.url}"
        p:user="${svcreg.database.user}"
        p:password="${svcreg.database.password}"
        p:initialPoolSize="${svcreg.database.pool.minSize}"
        p:minPoolSize="${svcreg.database.pool.minSize}"
        p:maxPoolSize="${svcreg.database.pool.maxSize}"
        p:maxIdleTimeExcessConnections="${svcreg.database.pool.maxIdleTime}"
        p:checkoutTimeout="${svcreg.database.pool.maxWait}"
        p:acquireIncrement="${svcreg.database.pool.acquireIncrement}"
        p:acquireRetryAttempts="${svcreg.database.pool.acquireRetryAttempts}"
        p:acquireRetryDelay="${svcreg.database.pool.acquireRetryDelay}"
        p:idleConnectionTestPeriod="${svcreg.database.pool.idleConnectionTestPeriod}"
        p:preferredTestQuery="${svcreg.database.pool.connectionHealthQuery}"
        />


<util:list id="packagesToScan">
    <value>org.jasig.cas.services</value>
    <value>org.jasig.cas.support.oauth.services</value>
</util:list>

<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
      id="jpaVendorAdapter"
      p:generateDdl="true"
      p:showSql="true" />

<alias name="jpaServiceRegistryDao" alias="serviceRegistryDao" />

0 个答案:

没有答案