jBoss / WildFly - 持久性单元JNDI数据源配置 - transactionPersistenceUnit" .__ FIRST_PHASE__]错误

时间:2015-06-26 08:12:36

标签: java mysql spring jpa jboss

首先,我想告诉我,我将应用程序从Tomcat迁移到JBOSS。好吧,让我们从配置开始:

standalone.xml

    <subsystem xmlns="urn:jboss:domain:datasources:3.0">
        <datasources>
            <datasource jta="true" jndi-name="java:/jboss/jdbc/web" pool-name="Web" enabled="true" use-java-context="true" use-ccm="true">
                <connection-url>jdbc:mysql://localhost:3306/testDB?useUnicode=true&amp;connectionCollation=utf8_general_ci&amp;characterSetResults=utf8&amp;characterEncoding=utf8</connection-url>
                <driver>MySQL</driver>
                <security>
                    <user-name>root</user-name>
                </security>
            </datasource>
            <drivers>
                <driver name="MySQL" module="com.mysql">
                    <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                </driver>
                <driver name="OracleJDBCDriver" module="oracle.jdbc"/>
            </drivers>
        </datasources>
    </subsystem>

我添加了MySQL数据源和驱动程序,所以在WildFly方面,一切看起来都很酷。现在是时候展示了

的persistence.xml

<persistence-unit name="transactionPersistenceUnit" transaction-type="RESOURCE_LOCAL">

    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <!--  
    <non-jta-data-source>java:jboss/jdbc/web</non-jta-data-source>-->
    <non-jta-data-source>java:jboss/jdbc/web</non-jta-data-source>

    <!-- class definitions here, nothing else -->
    <!-- Allegro classes -->
    <class>pl.allegroapp.classes.allegro.AllegroCategoryImpl</class>
    <class>pl.allegroapp.classes.allegro.AllegroFieldImpl</class>
    <class>pl.allegroapp.classes.allegro.AllegroFieldItemImpl</class>
    <class>pl.allegroapp.classes.allegro.AllegroProductImpl</class>
    <class>pl.allegroapp.classes.allegro.AllegroProductFieldImpl</class>
    <class>pl.allegroapp.classes.allegro.YourNewStyleClothAllegroImpl</class>
    <class>pl.allegroapp.classes.allegro.AllegroTransactionImpl</class>

    <properties>
        <property name="hibernate.hbm2ddl.auto" value="crete-drop"/>
        <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
    </properties>

</persistence-unit>

同样在这里看起来非常基本,jta-data-source看起来很好。最后一个文件是我的spring实体管理器/事务单元配置:

context.xml中

<context:component-scan base-package="pl.allegroapp" />

<mvc:annotation-driven />

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/pages/" />
    <property name="suffix" value=".jsp" />
</bean>

<jpa:repositories base-package="pl.allegroapp" />

<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
    <property name="persistenceUnitName" value="transactionPersistenceUnit" />
</bean>

<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>

<tx:annotation-driven transaction-manager="transactionManager" />

再一次没有什么大事。但是在运行Wildfly时我仍然有一个大错误。这是日志:

10:06:11,950 INFO  [org.jboss.modules] (main) JBoss Modules version 1.4.2.Final
10:06:12,091 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.4.Final
10:06:12,136 INFO  [org.jboss.as] (MSC service thread 1-6) WFLYSRV0049: WildFly Full 9.0.0.Beta2 (WildFly Core 1.0.0.Beta2) starting
10:06:12,809 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0015: Re-attempting failed deployment AllegroShopSite.war
10:06:12,813 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found AllegroShopSite.war in deployment directory. To trigger deployment create a file called AllegroShopSite.war.dodeploy
10:06:12,827 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
10:06:12,839 INFO  [org.xnio] (MSC service thread 1-9) XNIO version 3.3.0.Final
10:06:12,845 INFO  [org.xnio.nio] (MSC service thread 1-9) XNIO NIO Implementation Version 3.3.0.Final
10:06:12,866 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 38) WFLYCLINF0001: Activating Infinispan subsystem.
10:06:12,879 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 46) WFLYNAM0001: Activating Naming Subsystem
10:06:12,881 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 44) WFLYJSF0007: Activated the following JSF Implementations: [main]
10:06:12,881 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.
10:06:12,882 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 53) WFLYSEC0002: Activating Security Subsystem
10:06:12,884 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 56) WFLYWS0002: Activating WebServices Extension
10:06:12,893 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 37) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
10:06:12,901 INFO  [org.jboss.as.security] (MSC service thread 1-15) WFLYSEC0001: Current PicketBox version=4.9.0.Beta2
10:06:12,902 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0003: Undertow 1.2.0.Beta10 starting
10:06:12,903 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
10:06:12,908 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0003: Undertow 1.2.0.Beta10 starting
10:06:12,930 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
10:06:12,937 INFO  [org.jboss.as.connector] (MSC service thread 1-12) WFLYJCA0009: Starting JCA Subsystem (IronJacamar 1.2.3.Final)
10:06:12,947 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-14) WFLYJCA0018: Started Driver service with driver-name = h2
10:06:12,947 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-14) WFLYJCA0018: Started Driver service with driver-name = MySQL
10:06:12,955 INFO  [org.jboss.as.naming] (MSC service thread 1-5) WFLYNAM0003: Starting Naming Service
10:06:12,956 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0014: Creating file handler for path D:\wildfly-9.0.0.Beta2/welcome-content
10:06:12,956 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-10) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
10:06:13,161 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-13) WFLYUT0012: Started server default-server.
10:06:13,165 INFO  [org.jboss.remoting] (MSC service thread 1-9) JBoss Remoting version 4.0.8.Final
10:06:13,179 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-13) WFLYUT0018: Host default-host starting
10:06:13,213 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-11) WFLYUT0006: Undertow HTTP listener default listening on localhost/127.0.0.1:8080
10:06:13,289 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) WFLYDS0013: Started FileSystemDeploymentService for directory D:\wildfly-9.0.0.Beta2\standalone\deployments
10:06:13,291 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-9) WFLYSRV0027: Starting deployment of "AllegroShopSite.war" (runtime-name: "AllegroShopSite.war")
10:06:13,396 INFO  [org.jboss.ws.common.management] (MSC service thread 1-15) JBWS022052: Starting JBoss Web Services - Stack CXF Server 5.0.0.Beta3
10:06:13,500 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) WFLYJPA0002: Read persistence.xml for transactionPersistenceUnit
10:06:13,553 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("core-service" => "management"),
    ("management-interface" => "http-interface")
]) - failure description: {
    "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.serverManagement.controller.management.http is missing [jboss.binding.management-http]"],
    "WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
        "Services that were unable to start:" => ["jboss.serverManagement.controller.management.http.shutdown"],
        "Services that may be the cause:" => [
            "jboss.binding.management-http",
            "jboss.binding.txn-recovery-environment",
            "jboss.binding.txn-status-manager",
            "jboss.naming.context.java.jboss.jdbc.web",
            "jboss.outbound-socket-binding.mail-smtp"
        ]
    }
}
10:06:13,555 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "AllegroShopSite.war")]) - failure description: {
    "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"AllegroShopSite.war#transactionPersistenceUnit\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.jdbc.web]"],
    "WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
        "Services that were unable to start:" => [
            "jboss.deployment.unit.\"AllegroShopSite.war\".POST_MODULE",
            "jboss.deployment.unit.\"AllegroShopSite.war\".jboss.transaction.ee-transaction-rollback-service"
        ],
        "Services that may be the cause:" => [
            "jboss.binding.management-http",
            "jboss.binding.txn-recovery-environment",
            "jboss.binding.txn-status-manager",
            "jboss.naming.context.java.jboss.jdbc.web",
            "jboss.outbound-socket-binding.mail-smtp"
        ]
    }
}
10:06:13,556 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "ee"),
    ("context-service" => "default")
]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => ["jboss.concurrent.ee.context.service.default"],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,558 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "ee"),
    ("managed-thread-factory" => "default")
]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => ["jboss.concurrent.ee.threadfactory.default"],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,559 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "ee"),
    ("managed-executor-service" => "default")
]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => ["jboss.concurrent.ee.executor.default"],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,561 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "ee"),
    ("managed-scheduled-executor-service" => "default")
]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => ["jboss.concurrent.ee.scheduledexecutor.default"],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,561 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "mail"),
    ("mail-session" => "default")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.mail-session.default is missing [jboss.outbound-socket-binding.mail-smtp]"]}
10:06:13,563 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "jpa")]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => ["jboss.jpa"],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,564 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "jca")]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => [
        "jboss.connector.transactionintegration",
        "jboss.rarepository"
    ],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,566 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "jca"),
    ("bootstrap-context" => "default")
]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => ["jboss.connector.bootstrapcontext.default"],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,567 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "jca"),
    ("cached-connection-manager" => "cached-connection-manager")
]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => ["jboss.cached-connection-manager"],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,568 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "ejb3")]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => [
        "jboss.ejb.default-local-ejb-receiver-service",
        "jboss.ejb.tx-recovery-service",
        "jboss.ejb.utilities",
        "jboss.ejb3.ejbClientContext.default",
        "jboss.ejb3.localEjbReceiver.value"
    ],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,569 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "ejb3"),
    ("service" => "timer-service"),
    ("file-data-store" => "default-file-store")
]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => ["jboss.ejb3.timerService.timerPersistence.default-file-store"],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,571 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "ejb3"),
    ("service" => "remote")
]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => [
        "jboss.ejb.remote-transactions-repository",
        "jboss.ejb3.connector"
    ],
    "Services that may be the cause:" => [
        "jboss.binding.management-http",
        "jboss.binding.txn-recovery-environment",
        "jboss.binding.txn-status-manager",
        "jboss.naming.context.java.jboss.jdbc.web",
        "jboss.outbound-socket-binding.mail-smtp"
    ]
}}
10:06:13,572 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "transactions")]) - failure description: {
    "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.txn.ArjunaRecoveryManager is missing [jboss.binding.txn-status-manager, jboss.binding.txn-recovery-environment]"],
    "WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
        "Services that were unable to start:" => [
            "jboss.concurrent.ee.tsp",
            "jboss.naming.context.java.TransactionManager",
            "jboss.naming.context.java.jboss.TransactionManager",
            "jboss.naming.context.java.jboss.TransactionSynchronizationRegistry",
            "jboss.naming.context.java.jboss.UserTransaction",
            "jboss.txn.ArjunaTransactionManager",
            "jboss.txn.TransactionManager",
            "jboss.txn.TransactionSynchronizationRegistry",
            "jboss.txn.UserTransaction"
        ],
        "Services that may be the cause:" => [
            "jboss.binding.management-http",
            "jboss.binding.txn-recovery-environment",
            "jboss.binding.txn-status-manager",
            "jboss.naming.context.java.jboss.jdbc.web",
            "jboss.outbound-socket-binding.mail-smtp"
        ]
    }
}
10:06:13,604 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "AllegroShopSite.war" (runtime-name : "AllegroShopSite.war")
10:06:13,609 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.binding.management-http (missing) dependents: [service jboss.serverManagement.controller.management.http] 
      service jboss.binding.txn-recovery-environment (missing) dependents: [service jboss.txn.ArjunaRecoveryManager] 
      service jboss.binding.txn-status-manager (missing) dependents: [service jboss.txn.ArjunaRecoveryManager] 
      service jboss.naming.context.java.jboss.jdbc.web (missing) dependents: [service jboss.persistenceunit."AllegroShopSite.war#transactionPersistenceUnit".__FIRST_PHASE__] 
      service jboss.outbound-socket-binding.mail-smtp (missing) dependents: [service jboss.mail-session.default] 

10:06:13,818 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0063: Http management interface is not enabled
10:06:13,818 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0054: Admin console is not enabled
10:06:13,818 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 9.0.0.Beta2 (WildFly Core 1.0.0.Beta2) started (with errors) in 2104ms - Started 167 of 377 services (33 services failed or missing dependencies, 205 services are lazy, passive or on-demand)
10:06:13,841 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-13) WFLYSRV0028: Stopped deployment AllegroShopSite.war (runtime-name: AllegroShopSite.war) in 6ms
10:06:13,893 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "AllegroShopSite.war" (runtime-name: "AllegroShopSite.war")
10:06:13,894 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.persistenceunit."AllegroShopSite.war#transactionPersistenceUnit".__FIRST_PHASE__ (missing) dependents: [service jboss.deployment.unit."AllegroShopSite.war".POST_MODULE] 

10:06:18,641 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found AllegroShopSite.war in deployment directory. To trigger deployment create a file called AllegroShopSite.war.dodeploy

查看日志的结尾是否有错误:

  service jboss.naming.context.java.jboss.jdbc.web (missing) dependents: [service jboss.persistenceunit."AllegroShopSite.war#transactionPersistenceUnit".__FIRST_PHASE__] 

任何想法如何解决这个问题?

0 个答案:

没有答案