小编Duf*_*uff的帖子

HsqlDB上的触发器语法:expected;

我使用hsqldb进行单元测试.我的作品使用的是Oracle 11G Db.当我像上面那样运行我的启动脚本时:

<jdbc:embedded-database id="dataSource" type="HSQL">
</jdbc:embedded-database>

<jdbc:initialize-database data-source="dataSource" ignore-failures="DROPS">
  <jdbc:script location="classpath:/sql/init-cct-schema.sql" separator=";" />
  <jdbc:script location="classpath:/sql/init-cct-insert.sql" separator=";" />
</jdbc:initialize-database>
Run Code Online (Sandbox Code Playgroud)

我真的是HSQL文档中的触发器示例.

我看到这篇文章:但他的解决方案对我不起作用,或者我不明白.

我总是有这个错误:

java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
    at 
...
    ... 38 more
Caused by: org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement at line 9 of resource class path resource [sql/init-cct-schema.sql]:  CREATE TRIGGER TI_TYPE_MVT BEFORE INSERT ON TYPE_MVT     REFERENCING NEW AS newrow FOR EACH ROW     BEGIN ATOMIC       IF newrow.TYPE_MVT_PK is null THEN         SET …
Run Code Online (Sandbox Code Playgroud)

syntax triggers unit-testing hsqldb

6
推荐指数
1
解决办法
7862
查看次数

使用JAAS获取具有Spring安全性的LDAP密码

我有一个使用LDAP身份验证的Java EE Web应用程序.我使用Spring安全性使用以下代码连接到我的LDAP:

<bean id="ldapContextSource" class="com.myapp.security.authentication.MySecurityContextSource">
    <constructor-arg index="0" value="${ldap.url}" />
    <constructor-arg index="1" ref="userConnexion" />
</bean>

<security:authentication-manager alias="authenticationManager">
<security:authentication-provider ref="ldapAuthProvider" />
</security:authentication-manager>

<bean id="userConnexion" class="com.myapp.util.security.WebsphereCredentials">
    <constructor-arg value="${ldap.authJndiAlias}" />
</bean>

<bean id="ldapAuthProvider" class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider">
    <constructor-arg>
        <bean class="org.springframework.security.ldap.authentication.BindAuthenticator">
            <constructor-arg ref="ldapContextSource" />
            <property name="userSearch" ref="userSearch" />
        </bean>
    </constructor-arg>
    <constructor-arg>
        <bean class="com.myapp.security.authentication.MyAuthoritiesPopulator" >
            <property name="userService" ref="userService" />
        </bean>
    </constructor-arg>
    <property name="userDetailsContextMapper" ref="myUserDetailsContextMapper"/>
    <property name="hideUserNotFoundExceptions" value="false" />
</bean>
Run Code Online (Sandbox Code Playgroud)

实际上,我的bean 在此响应中WebsphereCredentials使用WebSphere私有类WSMappingCallbackHandlerFactory:如何从部署到Websphere 6.1的EJB访问身份验证别名

我们可以在官方websphere文档中看到它:http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic =% 2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp% 2Fae %2Frsec_pluginj2c.html

但我不想要它,因为:

  1. 我认为我的应用程序可以访问我的WebSphere实例中的所有JAAS登录(不确定).
  2. 此类在HUGE …

authentication websphere ldap spring-security jaas

4
推荐指数
1
解决办法
4555
查看次数