亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

錯誤 java.lang.ClassNotFoundException: javax.

錯誤 java.lang.ClassNotFoundException: javax.

汪汪一只貓 2023-08-16 18:04:52
現在我使用以下內容:NetBeans 8.2阿帕奇湯姆貓 8.0.53JSF 2.2冰面 4.3全部在 Maven 項目中(我認為是 3.6)我試圖用我已經創建的列表填充“ace:dataTable”。當我嘗試在沒有 ace:dataTable 的情況下運行“Principal.xhtml”時,頁面加載正常,但是如果我添加帶有我想要填充的值的 ace:dataTable,它會顯示錯誤“HTTP 500 – 內部服務器錯誤”例外“javax.servlet.ServletException:javax/enterprise/context/spi/Contextual javax.faces.webapp.FacesServlet.service(FacesServlet.java:683) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter .java:52)"這是我在 pom.xml 中使用的依賴項  <dependency>            <groupId>org.icefaces</groupId>            <artifactId>icefaces</artifactId>            <version>4.3.0</version>        </dependency>        <dependency>            <groupId>org.icefaces</groupId>            <artifactId>icefaces-ace</artifactId>            <version>4.3.0</version>        </dependency>        <dependency>            <groupId>javax</groupId>            <artifactId>javaee-web-api</artifactId>            <version>7.0</version>            <scope>provided</scope>        </dependency>這也是我在 XHTML 中使用的代碼<html  xmlns="http://www.w3.org/1999/xhtml"       xmlns:ui="http://java.sun.com/jsf/facelets"       xmlns:f="http://java.sun.com/jsf/core"       xmlns:h="http://java.sun.com/jsf/html"       xmlns:icecore="http://www.icefaces.org/icefaces/core"       xmlns:ace="http://www.icefaces.org/icefaces/components">    <h:head>        <title>List Test</title>    </h:head>    <h:body>        <ace:dataTable id="test"                       value="#{personaController.listaPersona}"                       rows="5"                       var="item"                        paginator="true" styleClass="textTabla" paginatorPosition="bottom">            <ace:column>                <f:facet name="header">                    <h:outputText value="SOLICITUD" styleClass="textTablaCabeza" />                </f:facet>                <h:outputText value="#{item.nombre}"  styleClass="textTablaDetalle" />            </ace:column>        </ace:dataTable>    </h:body> </html>
查看完整描述

3 回答

?
呼喚遠方

TA貢獻1856條經驗 獲得超11個贊

看起來您在 pom 中缺少 cdi-api 所需的依賴項:


<dependency>

    <groupId>javax.enterprise</groupId>

    <artifactId>cdi-api</artifactId>

    <version>1.2</version>

</dependency>


查看完整回答
反對 回復 2023-08-16
?
米琪卡哇伊

TA貢獻1998條經驗 獲得超6個贊

try with the following dependencies


<!-- CDI required APIs -->

        <dependency>

            <groupId>org.apache.geronimo.specs</groupId>

            <artifactId>geronimo-atinject_1.0_spec</artifactId>

            <version>1.0</version>

        </dependency>

        <dependency>

            <groupId>org.apache.geronimo.specs</groupId>

            <artifactId>geronimo-jcdi_2.0_spec</artifactId>

            <version>1.1</version>

        </dependency>

        <dependency>

            <groupId>org.apache.geronimo.specs</groupId>

            <artifactId>geronimo-interceptor_1.2_spec</artifactId>

            <version>1.0</version>

        </dependency>

        <dependency>

            <groupId>org.apache.geronimo.specs</groupId>

            <artifactId>geronimo-annotation_1.3_spec</artifactId>

            <version>1.0</version>

        </dependency>


        <!-- CDI Impl -->

        <dependency>

            <groupId>org.apache.openwebbeans</groupId>

            <artifactId>openwebbeans-impl</artifactId>

            <version>${owb.version}</version>

        </dependency>

        <dependency>

            <groupId>org.apache.openwebbeans</groupId>

            <artifactId>openwebbeans-web</artifactId>

            <version>${owb.version}</version>

        </dependency>

        <dependency>

            <groupId>org.apache.openwebbeans</groupId>

            <artifactId>openwebbeans-jsf</artifactId>

            <version>${owb.version}</version>

        </dependency>


查看完整回答
反對 回復 2023-08-16
?
翻翻過去那場雪

TA貢獻2065條經驗 獲得超14個贊

最后,我需要添加 cdi-api 依賴項,并且必須手動將 .jar 添加到“WEB-INF/lib/”文件夾中



查看完整回答
反對 回復 2023-08-16
  • 3 回答
  • 0 關注
  • 162 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號