JAVA - 將現有動態 Web 專案配置為 JPA 後無法部署

JAVA - 將現有動態 Web 專案配置為 JPA 後無法部署

我有一個使用 Glassfish 5 運行的 Java 動態 Web 專案。我收到以下錯誤:

    cannot Deploy EcommerceAdmin
        deploy is failing=Error occurred during deployment: 
    Exception while loading the app : java.lang.IllegalStateException: 
ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
     java.lang.RuntimeException: 
    javax.faces.FacesException: Unable to find CDI BeanManager. 
Please see server.log for more details.

我的 persistence.xml 是這樣的:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
    <persistence-unit name="EcommerceAdmin" transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>TIWDS</jta-data-source>
        <properties>
            <property name="eclipselink.logging.level" value="FINE"/>
            <property name="javax.persistence.schema-generation.database.action" value="create"/>
            <property name="eclipselink.logging.parameters" value="true"/>
        </properties>
    </persistence-unit>
</persistence>

相關內容