Проблема с источником данных в EJB - PullRequest
1 голос
/ 11 марта 2012

У меня была пара проблем с тем, чтобы мой EJB работал правильно - наконец-то удалось заставить мой сервер JBoss работать нормально с Netbeans, и теперь я получаю следующую ошибку, которая, похоже, связана с моим источником данных:

Журнал сервера ниже:

2012-03-11 19:05:11,181 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) undeploy, ctxPath=/group4_Implementation-war
2012-03-11 19:05:12,373 INFO  [org.jboss.profileservice.management.upload.remoting.DeployHandler] (WorkerThread#0[127.0.0.1:30606]) invoke, payload: {DeploymentTargetID=names=[group4_Implementation.ear], clientAddress=/127.0.0.1}, parameter: start
2012-03-11 19:05:12,374 WARN  [org.jboss.profileservice.management.upload.remoting.DeployHandler] (WorkerThread#0[127.0.0.1:30606]) Failed to complete command: [start] for deployment: names=[group4_Implementation.ear]: org.jboss.profileservice.spi.NoSuchDeploymentException: group4_Implementation.ear
    at org.jboss.profileservice.plugins.deploy.AbstractDeployHandler.resolveProfileForDeployment(AbstractDeployHandler.java:291) [:0.2.2]
    at org.jboss.profileservice.plugins.deploy.AbstractDeployHandler.resolveProfiles(AbstractDeployHandler.java:248) [:0.2.2]
    at org.jboss.profileservice.plugins.deploy.AbstractDeployHandler.startDeployments(AbstractDeployHandler.java:157) [:0.2.2]
    at org.jboss.profileservice.management.upload.remoting.DeployHandlerDelegate.startDeployments(DeployHandlerDelegate.java:74) [:6.1.0.Final]
    at org.jboss.profileservice.management.upload.remoting.DeployHandler.invoke(DeployHandler.java:156) [:6.1.0.Final]
    at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967) [:6.1.0.Final]
    at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791) [:6.1.0.Final]
    at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744) [:6.1.0.Final]
    at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548) [:6.1.0.Final]
    at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234) [:6.1.0.Final]

2012-03-11 19:05:16,436 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) deploy, ctxPath=/group4_Implementation-war
2012-03-11 19:05:16,469 WARN  [org.jboss.profileservice.deployment.hotdeploy.HDScanner] (HDScanner) Scan failed: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS MISSING DEPENDENCIES:
  Deployment "persistence.unit:unitName=group4_Implementation.ear/group4_Implementation-ejb.jar#wvp08heuPU" is missing the following dependencies:
    Dependency "jboss.jca:name=POSTGRES-EJB,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=POSTGRES-EJB,service=DataSourceBinding' **")

DEPLOYMENTS IN ERROR:
  Deployment "jboss.jca:name=POSTGRES-EJB,service=DataSourceBinding" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:name=POSTGRES-EJB,service=DataSourceBinding' **

    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.2.GA]
    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.2.GA]
    at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.2.GA]
    at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) [:6.1.0.Final]
    at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.checkComplete(ProfileControllerContext.java:138) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:246) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
    at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
    at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
    at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
    at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_20]
    at java.lang.Thread.run(Unknown Source) [:1.6.0_20]

2012-03-11 19:05:21,516 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) undeploy, ctxPath=/group4_Implementation-war
2012-03-11 19:05:21,703 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) deploy, ctxPath=/group4_Implementation-war
2012-03-11 19:05:21,734 WARN  [org.jboss.profileservice.deployment.hotdeploy.HDScanner] (HDScanner) Scan failed: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS MISSING DEPENDENCIES:
  Deployment "persistence.unit:unitName=group4_Implementation.ear/group4_Implementation-ejb.jar#wvp08heuPU" is missing the following dependencies:
    Dependency "jboss.jca:name=POSTGRES-EJB,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=POSTGRES-EJB,service=DataSourceBinding' **")

DEPLOYMENTS IN ERROR:
  Deployment "jboss.jca:name=POSTGRES-EJB,service=DataSourceBinding" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:name=POSTGRES-EJB,service=DataSourceBinding' **

    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.2.GA]
    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.2.GA]
    at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.2.GA]
    at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) [:6.1.0.Final]
    at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.checkComplete(ProfileControllerContext.java:138) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:246) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
    at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
    at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
    at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
    at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_20]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_20]
    at java.lang.Thread.run(Unknown Source) [:1.6.0_20]

Моя единица постоянства:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://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_1_0.xsd">
  <!-- The name attribute gives the name that the persistence unit will have
  when it's loaded inside JBoss.
  This is what you use in the PersistenceContext annotation in your class.
  -->
  <persistence-unit name="wvp08heuPU" transaction-type="JTA">
    <!-- This is a reference to the datasource that is used.
    By keeping this seperate it allow the container to pool database connections
    for you, improving performance. It also provide as extra layer of indirection
    allowing the details of the database to be kept seperate from this code.
    -->
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>java:/POSTGRES-EJB</jta-data-source>
    <properties>
      <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
      <property name="hibernate.show_sql" value="true"/>
      <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
    </properties>
  </persistence-unit>
</persistence>

Я установил источник данных, и он подтвердил соединение с базой данных.

Следующие технологии не уверены, помогает ли это или нет:

JBoss 6.1.0

Netbeans 7.1.1

Postgres: 8,4

Любая помощь будет оценена ....

Льюис

1 Ответ

1 голос
/ 11 марта 2012

Вы должны создать xml с конфигурацией DataSource POSTGRES-EJB в папке JBoss server / default / deploy или установить конфигурации с помощью консоли администратора JBoss.

Подробнее здесь

...