【问题标题】:Facelet Richfaces Spring Security TagsFacelet Richfaces Spring Security标签
【发布时间】:2015-08-04 16:17:14
【问题描述】:

我正在尝试让 Spring Security 标记在我的 facelets 页面中工作。我按照这个文件做了所有的事情

http://docs.spring.io/autorepo/docs/webflow/2.3.x/reference/html/spring-faces.html#spring-faces-security-taglib

它要求我提供 spring faces jar 和 spring webflow jars。我给了

spring-faces-2.3.0.RELEASE.jar spring-webflow-2.3.0.RELEASE.jar

我的 Spring 版本的其余部分是 3.0.2。

现在当我启动我的服务器时,我遇到了堆栈溢出错误

Caused by: java.lang.StackOverflowError
    at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
    at java.util.concurrent.ConcurrentHashMap.get(Unknown Source)
    at org.apache.catalina.core.ApplicationContext.getAttribute(ApplicationContext.java:236)
    at org.apache.catalina.core.ApplicationContextFacade.getAttribute(ApplicationContextFacade.java:376)
    at org.apache.myfaces.context.servlet.ApplicationMap.getAttribute(ApplicationMap.java:47)
    at org.apache.myfaces.util.AbstractThreadSafeAttributeMap.get(AbstractThreadSafeAttributeMap.java:90)
    at javax.faces.application.Application.getMyfacesApplicationInstance(Application.java:100)
    at javax.faces.application.Application.setFlowHandler(Application.java:1245)
    at javax.faces.application.Application.setFlowHandler(Application.java:1248)
    at javax.faces.application.Application.setFlowHandler(Application.java:1248)

我不确定什么是版本冲突。任何帮助表示赞赏。

我的 pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>SasMrm_Jars1</groupId>
  <artifactId>SasMrm_Jars1</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>SasMrm_Jars1</name>
  <dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jms</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
        <version>3.1.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>3.1.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>3.1.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-taglibs</artifactId>
        <version>3.1.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-ldap</artifactId>
        <version>3.1.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-webflow</artifactId>
        <version>2.3.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-faces</artifactId>
        <version>2.3.2.RELEASE</version>
    </dependency>   
  </dependencies>
</project>

【问题讨论】:

  • 我刚刚放弃了让弹簧标签工作。我不能为此升级春季版本。我编写了安全实用程序类来给我分配角色。我将使用它进行访问控制。感谢您的所有帮助。

标签: spring security tags facelets


【解决方案1】:

spring-faces-2.3.0.RELEASE.jar 需要高于 3.0.2 的 Spring 版本。

查看 SpringSource Enterprise Bundle Repository 页面 here 上的子标题“必需的依赖项”。

如你所见,主要需要Spring版本3.2.5.RELEASE3.0.7.RELEASE

希望对您有所帮助。

编辑:

对于您现在使用的spring-faces-2.3.2.RELEASE.jar,以下是所需的依赖项:

【讨论】:

  • 解决了。谢谢你。 spring-faces-2.0.6 适用于我的 spring 版本。现在我的问题是版本太旧,看起来它不支持 Spring Security 标签。我得到类未找到异常 java.lang.ClassNotFoundException: org.springframework.faces.security.FaceletsAuthorizeTagUtils
  • 现在我切换到 Spring 3.2.6、Spring Security 3.2.0、Spring Faces / Webflow 2.3.2。我回到了无限循环,就像原来的帖子一样。有没有人得到正确的版本组合来使用 facelets ?非常感谢您的帮助。
  • 对新错误没问题,您是否在这里看到了类似的问题,它可能会有所帮助:stackoverflow.com/questions/28401127/…
  • @SuriG 可能会发布您的 web-inf/lib/ 内容和您的 pom.xml,我们将尝试深入了解这一点,显然仍然是依赖版本问题。我已经在上面的答案中发布了新的必需依赖项,因此我们可以对照这个检查你的 pom
  • 感谢@smoggers 抽出宝贵时间。我将我的 pom.xml 更改为每个屏幕的版本,仍然是同样的问题。发布了我的 pom.xml
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-05-02
  • 2013-07-13
  • 2023-04-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多