为了账号安全,请及时绑定邮箱和手机立即绑定

错误 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条经验 获得超13个赞

最后,我需要添加 cdi-api 依赖项,并且必须手动将 .jar 添加到“WEB-INF/lib/”文件夹中



查看完整回答
反对 回复 2023-08-16
  • 3 回答
  • 0 关注
  • 86 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信