java - Hybris Commerce Cuppy 扩展安装失败

标签 java xml spring-security sap-commerce-cloud

我的环境:Win10 + Java 8 + Hybris Commerse 6.3

我已按照 https://help.hybris.com 上提供的教程步骤进行操作用于 Cuppy 安装。重建并启动应用程序后,我遇到了以下异常:

ERROR [localhost-startStop-1] [ContextLoader] Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: You cannot use a spring-security-2.0.xsd or spring-security-3.0.xsd or spring-security-3.1.xsd schema or spring-security-3.2.xsd schema or spring-security-4.0.xsd schema with Spring Security 4.1. Please update your schema declarations to the 4.1 schema.
Offending resource: class path resource [cuppy/cuppy-spring-security.xml]
        at org.springframework.beans.factory.parsing.FailFastProblemReporter.fatal(FailFastProblemReporter.java:60) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
...
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: 
Root WebApplicationContext - /cuppy: startup date [Thu Mar 30 13:15:10 EEST 2017]; parent: hybris Application context - master     

最佳答案

看起来 Cuppy 扩展没有针对 Spring Security 4.1 进行升级 Cuppy 在 cuppy-spring-security.xml 中有以下配置:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-4.0.xsd 
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd"

并且应该更改为以下内容

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-4.1.xsd 
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd"

关于java - Hybris Commerce Cuppy 扩展安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43115613/

相关文章:

java - 方法参数的继承不起作用

jquery - 支持 XHTML 文件吗?

c# - 如何在 C# 中添加具有不同前缀/命名空间的 xml 属性?

web-applications - 我的应用程序无法打开ServletContext资源

java - Spring Security CORS 过滤器不起作用

java - Spring security自定义注销空指针异常

java - Spring 安全: how to change user roles without login and logout

java - 应用程序想要访问过时版本的 Java : warning while invoking JNLP file

java - 如何在 Eclipse (Java) 和 Processing for Arduino 中使用外部库

python - 属性错误: 'NodeList' object has no attribute 'getElementsByTagName'