Reputation: 4245
I have a and application having an ejb module packaged into an ear file. When I want to deploy to Wildfly I get the error below. According to this post something is not ok with standalone.xml file. I have checked mine and it is fine.
Can someone tell me what can be the problem here?
Persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
<persistence-unit name="PU" transaction-type="JTA">
<jta-data-source>jdbc:postgresql://localhost:5432/Database</jta-data-source>
<properties>
<property name="hibernate.connection.username" value="postgres"/>
<property name="hibernate.connection.password" value="postgres" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL95Dialect"/>
</properties>
</persistence-unit>
</persistence>
Wildfly console log.
16:41:50,200 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."DigitalLibrary.MasterData.Dataservice.ear"."MasterData.Ejb.jar".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."DigitalLibrary.MasterData.Dataservice.ear"."MasterData.Ejb.jar".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of subdeployment "MasterData.Ejb.jar" of deployment "DigitalLibrary.MasterData.Dataservice.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Empty name segment is not allowed for jdbc:postgresql:
at org.jboss.msc.service.ServiceName.of(ServiceName.java:90)
at org.jboss.msc.service.ServiceName.append(ServiceName.java:117)
at org.jboss.as.naming.deployment.ContextNames.buildServiceName(ContextNames.java:203)
at org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:215)
at org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:206)
at org.jboss.as.naming.deployment.ContextNames.bindInfoFor(ContextNames.java:136)
at org.jboss.as.naming.deployment.ContextNames.bindInfoForEnvEntry(ContextNames.java:190)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deployPersistenceUnitPhaseOne(PersistenceUnitServiceHandler.java:502)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:276)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleJarDeployment(PersistenceUnitServiceHandler.java:163)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:133)
at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
Upvotes: 0
Views: 820
Reputation: 473
"The jta-data-source points to the JNDI name of the database this persistence unit maps to." From the link https://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/ch01s02s01.html
But you have configured the connection-url instead. A datasource could be configured from the jboss admin page or by modifying the standalone file. An example - https://developer.jboss.org/wiki/JBossAS7-DatasourceConfigurationForPostgresql?_sscc=t
Upvotes: 2