1

我正在尝试使用这些特定技术部署和运行项目:

EJB3.1 Eclipse 链接 2.4、JDBC 14。Oracle 10g。SJBOSS 7.Java EE 6

自 4 天以来,我一直在尝试制作一个 Hello World 示例,但我还没有运行它,现在我遇到了一些奇怪的错误。

这是我到目前为止所做的:

我们在 Jboss 中创建了 Eclipse Link 模块

所以我在 Jboss 中创建了模块,这样我就可以访问 oracle 数据库:

<module xmlns="urn:jboss:module:1.0" name="org.eclipse.persistence">
   <resources>
       <resource-root path="eclipselink.jar"/>
       <!-- Insert resources here -->
   </resources>
   <dependencies>
      <module name="javax.api"/>
      <module name="javax.persistence.api"/>
      <module name="javax.transaction.api"/>
      <module name="javax.validation.api"/>
      <module name="javax.xml.bind.api"/>
      <module name="org.antlr"/>
      <module name="org.apache.commons.collections"/>
      <module name="org.dom4j"/>
      <module name="org.javassist"/>
      <module name="org.jboss.logging"/>
      <module name="com.oracle.ojdbc14"/>
   </dependencies>
</module>

之后,我在 xml 文件中为 oracle 数据库创建了模块

 <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.0" name="com.oracle.ojdbc14">
        <resources>
            <resource-root path="ojdbc14.jar"/>
            <!-- Insert resources here -->
        </resources>
        <dependencies>
            <module name="javax.api"/>
            <module name="javax.transaction.api"/>
        </dependencies>
    </module>

finally i changed the Standalone.xml, this is the part of the standalone that i changed:

    <subsystem xmlns="urn:jboss:domain:datasources:1.0">
            <datasources>
                <datasource jndi-name="java:/EclipseLinkDS" pool-name="EclipseLinkDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                    <connection-url>
                        jdbc:oracle:thin:localhost:1521:TOPLINK
                    </connection-url>
                    <driver>
                        oracle
                    </driver>
                    <transaction-isolation>
                        TRANSACTION_READ_COMMITTED
                    </transaction-isolation>
                    <pool>
                        <prefill>
                            true
                        </prefill>
                        <use-strict-min>
                            false
                        </use-strict-min>
                        <flush-strategy>
                            FailingConnectionOnly
                        </flush-strategy>
                    </pool>
                    <security>
                        <user-name>
                            codesa
                        </user-name>
                        <password>
                            codesa
                        </password>
                    </security>
                </datasource>
                <drivers>
                    <driver name="oracle" module="com.oracle.ojdbc14">
                        <driver-class>
                            oracle.jdbc.driver.OracleDriver
                        </driver-class>
                        <xa-datasource-class>
                            oracle.jdbc.xa.client.OracleXADataSource
                        </xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>
        </subsystem>

当我在 Eclipse 上运行 EJB PROJECT 时,出现以下错误:

16:19:29,204 INFO  [org.jboss.jpa] (MSC service thread 1-2) read persistence.xml for em
16:19:29,333 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named CategoriaBase in deployment unit subdeployment "p.jar" of deployment "p_ear.ear" are as follows:

    java:global/p_ear/p/CategoriaBase!base.CategoriaBaseRemote
    java:app/p/CategoriaBase!base.CategoriaBaseRemote
    java:module/CategoriaBase!base.CategoriaBaseRemote
    java:global/p_ear/p/CategoriaBase!base.CategoriaBaseLocal
    java:app/p/CategoriaBase!base.CategoriaBaseLocal
    java:module/CategoriaBase!base.CategoriaBaseLocal

16:19:29,333 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named CategoriaBackingBean in deployment unit subdeployment "p_web.war" of deployment "p_ear.ear" are as follows:

    java:global/p_ear/p_web/CategoriaBackingBean!backingbeans.CategoriaBackingBean
    java:app/p_web/CategoriaBackingBean!backingbeans.CategoriaBackingBean
    java:module/CategoriaBackingBean!backingbeans.CategoriaBackingBean
    java:global/p_ear/p_web/CategoriaBackingBean
    java:app/p_web/CategoriaBackingBean
    java:module/CategoriaBackingBean

16:19:29,398 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."p_ear.ear"."p.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."p_ear.ear"."p.jar".INSTALL: Failed to process phase INSTALL of subdeployment "p.jar" of deployment "p_ear.ear"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
    at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_43]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_43]
    at java.lang.Thread.run(Unknown Source) [:1.6.0_43]
Caused by: java.lang.NullPointerException
    at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addProviderProperties(PersistenceUnitDeploymentProcessor.java:346)
    at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:253)
    at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleJarDeployment(PersistenceUnitDeploymentProcessor.java:115)
    at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:96)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
    ... 5 more

16:19:29,630 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "p_ear.ear" was rolled back with failure message {"Failed services" => {"jboss.deployment.subunit.\"p_ear.ear\".\"p.jar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"p_ear.ear\".\"p.jar\".INSTALL: Failed to process phase INSTALL of subdeployment \"p.jar\" of deployment \"p_ear.ear\""},"Services with missing/unavailable dependencies" => ["jboss.deployment.subunit.\"p_ear.ear\".\"p_web.war\".component.CategoriaBackingBean.START missing [ jboss.naming.context.java.module.p_ear.p_web.\"env/backingbeans.CategoriaBackingBean/categoriaBean\" ]","jboss.deployment.subunit.\"p_ear.ear\".\"p_web.war\".jndiDependencyService missing [ jboss.naming.context.java.module.p_ear.p_web.\"env/backingbeans.CategoriaBackingBean/categoriaBean\" ]","jboss.naming.context.java.module.p_ear.p_web.\"env/backingbeans.CategoriaBackingBean/categoriaBean\".jboss.deployment.subunit.\"p_ear.ear\".\"p_web.war\".module.p_ear.p_web.2 missing [ jboss.deployment.subunit.\"p_ear.ear\".\"p.jar\".component.CategoriaBase.VIEW.\"base.CategoriaBaseRemote\".REMOTE ]","jboss.naming.context.java.comp.p_ear.p.CategoriaBase.ValidatorFactory missing [ jboss.naming.context.java.comp.p_ear.p.CategoriaBase ]","jboss.naming.context.java.comp.p_ear.p.CategoriaBase.Validator missing [ jboss.naming.context.java.comp.p_ear.p.CategoriaBase ]","jboss.deployment.subunit.\"p_ear.ear\".\"p_web.war\".component.\"backingbeans.CategoriaBackingBean\".START missing [ jboss.naming.context.java.module.p_ear.p_web.\"env/backingbeans.CategoriaBackingBean/categoriaBean\" ]"]}
16:19:29,642 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment p.jar in 12ms
16:19:29,651 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Stopped deployment p_web.war in 21ms
16:19:29,653 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Stopped deployment p_ear.ear in 24ms
16:19:29,655 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.deployment.subunit.\"p_ear.ear\".\"p.jar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"p_ear.ear\".\"p.jar\".INSTALL: Failed to process phase INSTALL of subdeployment \"p.jar\" of deployment \"p_ear.ear\""},"Services with missing/unavailable dependencies" => ["jboss.deployment.subunit.\"p_ear.ear\".\"p_web.war\".component.CategoriaBackingBean.START missing [ jboss.naming.context.java.module.p_ear.p_web.\"env/backingbeans.CategoriaBackingBean/categoriaBean\" ]","jboss.deployment.subunit.\"p_ear.ear\".\"p_web.war\".jndiDependencyService missing [ jboss.naming.context.java.module.p_ear.p_web.\"env/backingbeans.CategoriaBackingBean/categoriaBean\" ]","jboss.naming.context.java.module.p_ear.p_web.\"env/backingbeans.CategoriaBackingBean/categoriaBean\".jboss.deployment.subunit.\"p_ear.ear\".\"p_web.war\".module.p_ear.p_web.2 missing [ jboss.deployment.subunit.\"p_ear.ear\".\"p.jar\".component.CategoriaBase.VIEW.\"base.CategoriaBaseRemote\".REMOTE ]","jboss.naming.context.java.comp.p_ear.p.CategoriaBase.ValidatorFactory missing [ jboss.naming.context.java.comp.p_ear.p.CategoriaBase ]","jboss.naming.context.java.comp.p_ear.p.CategoriaBase.Validator missing [ jboss.naming.context.java.comp.p_ear.p.CategoriaBase ]","jboss.deployment.subunit.\"p_ear.ear\".\"p_web.war\".component.\"backingbeans.CategoriaBackingBean\".START missing [ jboss.naming.context.java.module.p_ear.p_web.\"env/backingbeans.CategoriaBackingBean/categoriaBean\" ]"]}}}

任何人都知道我该如何解决?我只需要建立一个良好的连接,以便能够开发完整的应用程序运行。

如果您有小费或其他东西,将不胜感激。

4

0 回答 0