简体   繁体   English

JSF核心问题:javax.servlet.ServletException

[英]JSF Core issue: javax.servlet.ServletException

Explanation: 说明:

I have a JSF command link that sets a member in the backing bean, however, when setting the backing bean member using setPropertyActionListener I get a tag not recognized error. 我有一个JSF命令链接,该链接在backing bean中设置一个成员,但是,当使用setPropertyActionListener设置backing bean成员时,我得到了一个标记无法识别的错误。

The project builds and deploys with no issues. 该项目的构建和部署没有任何问题。 The default page is displayed then the error is thrown on the page request with the setPropertyActionListener. 将显示默认页面,然后使用setPropertyActionListener在页面请求上引发错误。

Other coworkers are able to run the application fine using the same setup. 其他同事可以使用相同的设置运行应用程序。 I am guessing I am missing a library or there is a permission issue on some directory or file. 我猜我缺少库,或者某些目录或文件存在权限问题。

Setup: 设定:

  • Netbeans 6.7.1 Netbeans 6.7.1
  • Apache Tomcat 6.0.18 Apache Tomcat 6.0.18
  • JDK 1.6 JDK 1.6
  • JavaServer Faces 1.2 JavaServer Faces 1.2
  • Facelets 小面

Code: 码:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich">

    <ui:composition template="/template.xhtml">

        <ui:define name="body">      
            <h:commandLink value="view" action="viewer">
                <f:setPropertyActionListener target="#{ViewerBean.ticket_id}" value="#{ticket.ticket_id}" />
            </h:commandLink>
        </ui:define>
    </ui:composition> 
</html>

Stacktrace: complete trace Stacktrace: 完整跟踪

javax.servlet.ServletException: /portal/index.xhtml @65,125 Tag Library supports namespace: http://java.sun.com/jsf/core , but no tag was defined for name: setPropertyActionListener javax.servlet.ServletException:/portal/index.xhtml @ 65,125标记库支持名称空间: http : //java.sun.com/jsf/core ,但未为名称定义标记:setPropertyActionListener

com.sun.facelets.tag.TagException: /portal/index.xhtml @65,125 Tag Library supports namespace: http://java.sun.com/jsf/core , but no tag was defined for name: setPropertyActionListener com.sun.facelets.tag.TagException:/portal/index.xhtml @ 65,125标记库支持名称空间: http : //java.sun.com/jsf/core ,但未为名称定义标记:setPropertyActionListener

Libraries in Apache: Apache中的库:

  • annotations-api.jar 注解-api.jar
  • catalina.jar catalina.jar
  • el-api.jar el-api.jar
  • jasper.jar jasper.jar
  • mysql-connector-java-5.1.7-bin.jar mysql-connector-java-5.1.7-bin.jar
  • tomcat-coyote.jar tomcat-土狼.jar
  • tomcat-i18n-fr.jar tomcat-i18n-fr.jar
  • catalina-ant.jar 卡塔琳娜·安东尼
  • catalina-tribes.jar 卡塔利娜部落
  • jasper-jdt.jar jasper-jdt.jar
  • tomcat-dbcp.jar tomcat-dbcp.jar
  • tomcat-i18n-ja.jar tomcat-i18n-ja.jar
  • catalina-ha.jar 卡塔利娜哈
  • commons-logging-1.1.1.jar commons-logging-1.1.1.jar
  • jasper-el.jar 贾斯珀·埃尔·贾尔
  • jsp-api.jar jsp-api.jar
  • servlet-api.jar servlet-api.jar
  • tomcat-i18n-es.jar tomcat-i18n-es.jar

Libraries in Project: 项目中的图书馆:

  • activation.jar activation.jar
  • commons-digester.jar commons-digester.jar
  • ezmorph-1.0.6.jar ezmorph-1.0.6.jar
  • jstl.jar jstl.jar
  • richfaces-ui-3.3.0.GA.jar richfaces-ui-3.3.0.GA.jar
  • commons-beanutils-1.8.0.jar commons-beanutils-1.8.0.jar
  • commons-lang-2.4.jar commons-lang-2.4.jar
  • jsf-api.jar jsf-api.jar
  • jxl.jar jxl.jar
  • standard.jar standard.jar
  • commons-beanutils.jar commons-beanutils.jar
  • commons-logging-1.1.1.jar commons-logging-1.1.1.jar
  • jsf-facelets.jar jsf-facelets.jar
  • mail.jar mail.jar
  • commons-collections-3.2.jar commons-collections-3.2.jar
  • commons-logging.jar commons-logging.jar
  • jsf-impl.jar jsf-impl.jar
  • richfaces-api-3.3.0.GA.jar richfaces-api-3.3.0.GA.jar
  • commons-collections.jar commons-collections.jar
  • el-impl-1.0.jar el-impl-1.0.jar
  • json-lib-2.2.3-jdk15.jar json-lib-2.2.3-jdk15.jar
  • richfaces-impl-3.3.0.GA.jar richfaces-impl-3.3.0.GA.jar

You do not precise which version of JSF you are using in your project. 您无法确定项目中使用的JSF版本。

Indeed, the setPropertyActionListener tag has been included in JSF 1.2 and is not available for a JSF 1.1 project. 实际上, setPropertyActionListener标记已包含在JSF 1.2中,并且不适用于JSF 1.1项目。

That may explain the problem you encounter... 那可以解释您遇到的问题...

[Edit] [编辑]

This issue has resurfaced, however, I think I have found a solution. 这个问题已经浮出水面,但是,我想我已经找到了解决方案。 I think something was wrong with my jsf-facelets.jar file. 我认为jsf-facelets.jar文件出了点​​问题。

I downloaded the newest version and added it to the project. 我下载了最新版本并将其添加到项目中。 Everything seems to be super now. 现在一切似乎都很棒。

2010.01.26 2010.01.26


I could not verify what the exact conflict was so I did a fresh install. 我无法验证确切的冲突是什么,所以我进行了全新安装。

I am on an Ubuntu box running Netbeans 6.7, which was manually installed from the Netbeans website. 我在运行Netbeans 6.7的Ubuntu机器上,该机器是从Netbeans网站手动安装的。 Apache Tomcat was installed with the IDE. IDE已安装了Apache Tomcat。

First I removed the visible directories of both Netbeans and Tomcat. 首先,我删除了Netbeans和Tomcat的可见目录。 I actually moved them to the Trash just in case some went horribly wrong. 我实际上将它们移到了“废纸rash”,以防万一某些地方出了错。

$ mv /home/bbryan/apps/netbeans6.7 /home/bbryan/.local/share/Trash
$ mv /home/bbryan/apps/apache-tomcat-6.0.18 /home/bbryan/.local/share/Trash

After these two directories were removed I removed the hidden netbeans directory. 删除这两个目录后,我删除了隐藏的netbeans目录。 This is important; 这个很重要; if you don't the next install of netbeans and tomcat will have all the same settings as before both good and bad. 如果不这样做,则下一次安装的netbeans和tomcat的设置将与之前和之后的所有设置相同。

$ mv /home/bbryan/.netbeans /home/bbryan/.local/share/Trash

Once all three directories were removed I did a fresh install and made a few minor adjustments for our local setup and BINGO. 删除所有三个目录后,我将进行全新安装,并对本地设置和BINGO进行了一些小的调整。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM