【问题标题】:JBoss 7.1 JBAS014750: Operation handler failed to completeJBoss 7.1 JBAS014750:操作处理程序未能完成
【发布时间】:2014-10-10 01:24:33
【问题描述】:

我刚开始使用 JBoss 探索 EJB 的世界, 但是我遇到了一个问题。

当我尝试为 EJB + JPA 编写项目时, 我遇到错误,无法将项目部署到 JBoss。 我现在正在使用 EJB 3.1 + JBoss 7.1.1。 请找到以下服务器日志:

    22:18:50,132 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found EJBEntity.jar in deployment directory. To trigger deployment create a file called EJBEntity.jar.dodeploy
22:18:50,142 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-13) JBAS015876: Starting deployment of "EJBEntity.jar"
22:18:50,166 INFO  [org.jboss.as.jpa] (MSC service thread 1-6) JBAS011401: Read persistence.xml for JPADB
22:18:50,183 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-6) JNDI bindings for session bean named LibraryPersistentBean in deployment unit deployment "EJBEntity.jar" are as follows:

    java:global/EJBEntity/LibraryPersistentBean!com.heic.tutorial.entity.stateless.LibraryPersistentBeanRemote
    java:app/EJBEntity/LibraryPersistentBean!com.heic.tutorial.entity.stateless.LibraryPersistentBeanRemote
    java:module/LibraryPersistentBean!com.heic.tutorial.entity.stateless.LibraryPersistentBeanRemote
    java:jboss/exported/EJBEntity/LibraryPersistentBean!com.heic.tutorial.entity.stateless.LibraryPersistentBeanRemote
    java:global/EJBEntity/LibraryPersistentBean
    java:app/EJBEntity/LibraryPersistentBean
    java:module/LibraryPersistentBean

22:18:50,400 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "EJBEntity.jar" was rolled back with failure message JBAS014750: Operation handler failed to complete
22:18:50,412 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment EJBEntity.jar in 11ms
22:18:50,413 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => "JBAS014750: Operation handler failed to complete"}}
22:22:45,525 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-13) JBAS015876: Starting deployment of "EJBEntity.jar"
22:22:45,544 INFO  [org.jboss.as.jpa] (MSC service thread 1-13) JBAS011401: Read persistence.xml for JPADB
22:22:45,561 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-16) JNDI bindings for session bean named LibraryPersistentBean in deployment unit deployment "EJBEntity.jar" are as follows:

    java:global/EJBEntity/LibraryPersistentBean!com.heic.tutorial.entity.stateless.LibraryPersistentBeanRemote
    java:app/EJBEntity/LibraryPersistentBean!com.heic.tutorial.entity.stateless.LibraryPersistentBeanRemote
    java:module/LibraryPersistentBean!com.heic.tutorial.entity.stateless.LibraryPersistentBeanRemote
    java:jboss/exported/EJBEntity/LibraryPersistentBean!com.heic.tutorial.entity.stateless.LibraryPersistentBeanRemote
    java:global/EJBEntity/LibraryPersistentBean
    java:app/EJBEntity/LibraryPersistentBean
    java:module/LibraryPersistentBean

22:22:45,782 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "EJBEntity.jar" was rolled back with failure message JBAS014750: Operation handler failed to complete
22:22:45,787 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment EJBEntity.jar in 5ms
22:22:45,789 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => "JBAS014750: Operation handler failed to complete"}}

我不知道“操作处理程序未能完成”是什么意思, 我只知道 JBoss 不允许我部署我的项目。

我为有类似情况的人阅读了很多资料, 其中大部分与persistence.xml / datasource / module配置有关。

请找到以下文件:

persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="https://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="JPADB">
        <jta-data-source>java:jboss/datasources/MySQLDS</jta-data-source>
            <properties>
                <property name="showSql" value="true" />
                <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
            </properties>
    </persistence-unit>
</persistence>

standalone.xml的代码段

<subsystem xmlns="urn:jboss:domain:datasources:1.0">
            <datasources>
                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
                    <driver>h2</driver>
                    <security>
                        <user-name>sa</user-name>
                        <password>sa</password>
                    </security>
                </datasource>
                <datasource jndi-name="java:jboss/datasources/MySQLDS" pool-name="MySQL" enabled="true" use-java-context="true">
                    <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
                    <driver>mysqlDriver</driver>
                    <security>
                        <user-name>root</user-name>
                        <password>root</password>
                    </security>
                </datasource>
                <drivers>
                    <driver name="mysqlDriver" module="com.mysql">
                        <xa-datasource-class>com.mysql.jdbc.Driver</xa-datasource-class>
                    </driver>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>
        </subsystem>

java:jboss/datasources/MySQLDS 是我打算使用的那个。

%JBoss_Home%\modules\com\mysql\main\module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
    <resources>
        <resource-root path="mysql-connector-java-5.1.31-bin.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api/>
    </dependencies>
</module>

我也将 mysql-connector-java-5.1.31-bin.jar 复制到 %JBoss_Home%\modules\com\mysql\main\ 目录中.....

请问有人可以帮我吗? 我挣扎了一整天,但仍然无法找到正在发生的事情的线索......

非常感谢。

【问题讨论】:

    标签: jakarta-ee jpa jboss ejb


    【解决方案1】:

    突然间,我解决了这个问题。

    我会在这里发布答案, 希望对遇到类似情况的人有所帮助。

    基本上,我做了三件事:

    1. 我使用的是 JBoss EAP 6.2 而不是 JBoss AP 7.1

    2. 我已在 persistence.xml

      中将 jta-data-source 从 java:jboss/datasources/MySQLDS 更改为 java:/MySQLDS
    3. 我已在 standalone.xml

    4. 中将 jndi-name 从 java:jboss/datasources/MySQLDS 更改为 java:/MySQLDS >

    谢谢。

    【讨论】:

      【解决方案2】:

      我在使用mysql5时遇到了同样的问题 但是当我在模块中为 jboss 定义不正确的 mysq jdbc 驱动程序时,这是我的错。 确保 jboss 正确连接到您的 mysql 数据源。 例如检查 jboss/modules/com/mysql/modules.xml

      <resource-root path="mysql-connector-java-5.1.21.jar"/>
      

      路径必须引用正确的 jar 文件名称。并且同名的 jar 必须通过 modules.xml 文件定位

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-03-18
        • 2019-01-13
        • 2014-08-16
        • 1970-01-01
        相关资源
        最近更新 更多