Datasource configuration in wildfly 10 - postgresql

I am trying to configure a PostgreSQL datasource in Wildfly 10 Application Server on Mac OS. I am doing what the instructions prescribe. I have created an order:
/wildfly-10.1.0.Final/modules/system/layers/base/org/postgresql/main.
In this order I have put the JDBC driver:
postgresql-9.3-1104.jdbc4.jar
and I have created a module.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.postgresql“>
<resources>
<resource-root path="postgresql-9.3-1104.jdbc4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
In the standalone.xml file I have created the datasource under datasources:
<datasource jndi-name="java:jboss/datasources/PostgresDS" pool-name="PostgresDS" enabled="true"
use-java-context="true">
<connection-url>jdbc:postgresql://localhost:5432/testdb</connection-url>
<driver>postgresql</driver>
<security>
<user-name>user</user-name>
<password>password</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"></valid-connection-checker>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"></exception-sorter>
</validation>
</datasource>
and drivers as:
<drivers>
<driver name="postgresql" module="org.postgresql">
<datasource-class>org.postgresql.Driver</datasource-class>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
However it is impossible the datasource is not installed and when I start the server I get the message (error):
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "PostgresDS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.postgresql"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.PostgresDS is missing [jboss.jdbc-driver.postgresql]",
"jboss.driver-demander.java:jboss/datasources/PostgresDS is missing [jboss.jdbc-driver.postgresql]"
]
}
[org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "PostgresDS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.postgresql",
"jboss.jdbc-driver.postgresql"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.PostgresDS is missing [jboss.jdbc-driver.postgresql]",
"jboss.driver-demander.java:jboss/datasources/PostgresDS is missing [jboss.jdbc-driver.postgresql]",
"org.wildfly.data-source.PostgresDS is missing [jboss.jdbc-driver.postgresql]"
]
}
It seems, that wildfly maybe does not find the module. Any ideas what causes this problem? Is anything wrong in my configuration?

I'd like to recommend a change to your process. While you certainly can do this by hand, if you script this you can do it again with repeatability.
This is dependent on the jboss-cli.sh. I have a script that looks like:
embed-server --std-out=echo --server-config=standalone.xml
batch
module add --name=org.postgres --resources=/tmp/postgresql-42.0.0.jar --dependencies=javax.api,javax.transaction.api
/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)
/subsystem=datasources/data-source=myDataSource/:add(connection-url=jdbc:postgresql://localhost:5432/thedatabasename,driver-name=postgres,jndi-name=java:/jdbc/myDataSource,initial-pool-size=4,max-pool-size=64,min-pool-size=4,password=theDatabasePassword,user-name=theDatabaseUsername)
run-batch
This is run with:
bin/jboss-cli.sh --file=/path/to/file/wildflyconf.cli
The script starts by using the "embed-server" command so that your Wildfly instance does not need to be running. Then it starts a batch of commands to run as one unit.
The important part is that we create the module via the command line. You will have to put the PostgreSQL jar somewhere but other than that the script takes care of creating all of the needed files under "modules".
Next, we add the JDBC driver and then we create a Datasource based on the driver.
The advantage of a script is that you can check this into your source code control system and anyone can run it. It reduces the possibility of a typo and you don't need to manually create and modify files.
Just a thought. Having a repeatable process that your development team can use is always a useful thing.

You are defining your Driver class as a Datasource class :
<datasource-class>org.postgresql.Driver</datasource-class>
please use the correct element:
<driver-class>org.postgresql.Driver</driver-class>
just like #stdunbar showed you in his CLI command :
/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)

in your file module.xml in the 2nd line change
<module xmlns="urn:jboss:module:1.3" name="org.postgresql“>
to
<module xmlns="urn:jboss:module:1.3" name="org.postgresql">
the ' " ' may be the problem in your module.xml

Set the following system properties in standalone.xml and it should work fine:
-Dorg.kie.server.persistence.dialect=org.hibernate.dialect.PostgreSQLDialect
-Dorg.kie.server.persistence.ds=java:jboss/datasources/yourDataSource
<system-properties>
<property name="org.kie.server.persistence.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="org.kie.server.persistence.ds" value="java:jboss/datasources/ExampleDS"/>
</system-properties>

I just faced this issue with Wildfly-20.0.1.Final. I resolved it by adding the Postgres module to /Wildfly-20.0.1.Final/modules/org/postgresql/main
So, the solution to this issue is to move the module from
/wildfly-10.1.0.Final/modules/system/layers/base/org/postgresql/main
to
/wildfly-10.1.0.Final/modules/org/postgresql/main

Related

Wildfly 22 - WFLYCTL0180: Services with missing/unavailable dependencies

In Wildfly 22.0.0 or later, the following error occurs.
2022-08-24 15:59:43,380 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "shcm")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"org.wildfly.clustering.cache.group.web.default-server",
"org.wildfly.clustering.cache.registry.web.default-server"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" =>
["org.wildfly.clustering.web.route-locator.\"shcmupdate.war\" is missing
[org.wildfly.clustering.cache.registry.web.default-server,
org.wildfly.clustering.cache.group.web.default-server]"]
}
I have clustering configuration in web.xml and jboss-web.xml in my application.
if use standalone-ha.xml, it works normally.
but subsystem error occurs when standalone.xml is used from Wildfly 22.0.0 or later.
What changes were made in Wildfly 22?
Seems like it was never supported to be enable for non-standalone.xml builds, so it was likely removed in this PR (distributable-web.xml includes an Infinispan cache that distributable-web-local.xml does not).
The WildFly HA docs should be able to help you migrate to WF 22.
This was really unfortunate decision. It is killing EAP v. 7.4.5 (7.4.6) deployments.
I had replication-config as a part of jboss-web.xml file, that causes this issue. The application runs in ha mode in production, so the configuration is needed, but for the development there is no reason to maintain the whole cluster so I was happy the setting was ignored.
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_10_0.xsd"
version="10.0">
<context-root>my-application</context-root>
<!--
<replication-config>
<replication-granularity>ATTRIBUTE</replication-granularity>
</replication-config> -->
</jboss-web>
Commented out configuration is the part, that was causing the issue.

War not deploying missing persistanceunit

I just created a simple WAR containing a simple JAX-RS Service, an Stateless EJB and some JPA entities. I'm using WildFly 12.
My WAR structure is the following:
WEB-INF
classes
META-INF
jboss-ds.xml
persistence.xml
compiled classes
My jboss-ds.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<datasource jndi-name="java:/jdbc/shortbox" pool-name="mysql_pool" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/shortbox</connection-url>
<driver>mysql</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
</datasource>
</datasources>
My persistence.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
<persistence-unit name="shortbox-unit" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>java:/jdbc/shortbox</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
</persistence>
I also injected the EntityManager in my EJB like this
#PersistenceContext(unitName = "shortbox-unit")
private EntityManager em;
My problem is, that the WAR is not deploying like this and I just can't figure out why.
The Exception during deployment is the following
16:56:07,052 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "api.war" was rolled back with the following failure message:
{
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.deployment.unit.\"api.war\".component.IssueBean.WeldInterceptorBindingsService",
"jboss.deployment.unit.\"api.war\".component.IssueBean.START",
"jboss.deployment.unit.\"api.war\".weld.weldClassIntrospector",
"jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldInitialListener\".WeldInstantiator",
"jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".WeldInstantiator",
"jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldInitialListener\".START",
"jboss.deployment.unit.\"api.war\".WeldStartService",
"jboss.persistenceunit.\"api.war#shortbox-unit\"",
"jboss.persistenceunit.\"api.war#shortbox-unit\".FIRST_PHASE",
"jboss.naming.context.java.jdbc.shortbox",
"jboss.deployment.unit.\"api.war\".component.IssueBean.WeldInstantiator",
"jboss.deployment.unit.\"api.war\".ee.ComponentRegistry",
"jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".WeldInstantiator",
"jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".START",
"jboss.naming.context.java.module.api.api.env.\"xyz.shortbox.backend.ejb.IssueBean\".em",
"jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".START",
"jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldTerminalListener\".WeldInstantiator",
"jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldTerminalListener\".START",
"jboss.deployment.unit.\"api.war\".component.\"javax.faces.webapp.FacetTag\".WeldInstantiator",
"jboss.deployment.unit.\"api.war\".component.\"javax.faces.webapp.FacetTag\".START",
"jboss.undertow.deployment.default-server.default-host./api",
"jboss.undertow.deployment.default-server.default-host./api.UndertowDeploymentInfoService",
"jboss.deployment.unit.\"api.war\".component.\"com.sun.faces.config.ConfigureListener\".WeldInstantiator",
"jboss.deployment.unit.\"api.war\".jndiDependencyService",
"jboss.deployment.unit.\"api.war\".component.\"com.sun.faces.config.ConfigureListener\".START"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.deployment.unit.\"api.war\".ee.ComponentRegistry is missing [jboss.deployment.unit.\"api.war\".weld.weldClassIntrospector]",
"jboss.deployment.unit.\"api.war\".component.IssueBean.START is missing [jboss.naming.context.java.module.api.api.env.\"xyz.shortbox.backend.ejb.IssueBean\".em, jboss.persistenceunit.\"api.war#shortbox-unit\", jboss.deployment.unit.\"api.war\".jndiDependencyService, jboss.deployment.unit.\"api.war\".component.IssueBean.WeldInstantiator]",
"jboss.deployment.unit.\"api.war\".component.IssueBean.WeldInterceptorBindingsService is missing [jboss.deployment.unit.\"api.war\".WeldStartService]",
"jboss.deployment.unit.\"api.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"api.war\".WeldStartService]",
"jboss.undertow.deployment.default-server.default-host./api.UndertowDeploymentInfoService is missing [jboss.deployment.unit.\"api.war\".WeldStartService, jboss.deployment.unit.\"api.war\".ee.ComponentRegistry]",
"jboss.deployment.unit.\"api.war\".CdiValidatorFactoryService is missing [jboss.deployment.unit.\"api.war\".WeldStartService]",
"jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldTerminalListener\".START is missing [jboss.deployment.unit.\"api.war\".jndiDependencyService, jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldTerminalListener\".WeldInstantiator]",
"jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".WeldInstantiator is missing [jboss.deployment.unit.\"api.war\".WeldStartService]",
"jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldInitialListener\".START is missing [jboss.deployment.unit.\"api.war\".jndiDependencyService, jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldInitialListener\".WeldInstantiator]",
"jboss.deployment.unit.\"api.war\".component.\"javax.faces.webapp.FacetTag\".START is missing [jboss.persistenceunit.\"api.war#shortbox-unit\", jboss.deployment.unit.\"api.war\".component.\"javax.faces.webapp.FacetTag\".WeldInstantiator, jboss.deployment.unit.\"api.war\".jndiDependencyService]",
"jboss.deployment.unit.\"api.war\".component.\"com.sun.faces.config.ConfigureListener\".WeldInstantiator is missing [jboss.deployment.unit.\"api.war\".WeldStartService]",
"jboss.deployment.unit.\"api.war\".WeldStartService is missing [jboss.persistenceunit.\"api.war#shortbox-unit\", jboss.deployment.unit.\"api.war\".jndiDependencyService]",
"jboss.deployment.unit.\"api.war\".component.IssueBean.WeldInstantiator is missing [jboss.deployment.unit.\"api.war\".WeldStartService, jboss.deployment.unit.\"api.war\".component.IssueBean.WeldInterceptorBindingsService]",
"jboss.deployment.unit.\"api.war\".component.\"javax.faces.webapp.FacetTag\".WeldInstantiator is missing [jboss.deployment.unit.\"api.war\".WeldStartService]",
"jboss.deployment.unit.\"api.war\".moduleDeploymentRuntimeInformationStart is missing [jboss.deployment.unit.\"api.war\".component.IssueBean.START]",
"jboss.persistenceunit.\"api.war#shortbox-unit\".FIRST_PHASE is missing [jboss.naming.context.java.jdbc.shortbox]",
"jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".START is missing [jboss.persistenceunit.\"api.war#shortbox-unit\", jboss.deployment.unit.\"api.war\".jndiDependencyService, jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".WeldInstantiator]",
"jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldTerminalListener\".WeldInstantiator is missing [jboss.deployment.unit.\"api.war\".WeldStartService]",
"jboss.naming.context.java.module.api.api.env.\"xyz.shortbox.backend.ejb.IssueBean\".em is missing [jboss.persistenceunit.\"api.war#shortbox-unit\"]",
"jboss.undertow.deployment.default-server.default-host./api is missing [jboss.deployment.unit.\"api.war\".component.\"javax.faces.webapp.FacetTag\".START, jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldInitialListener\".START, jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldTerminalListener\".START, jboss.deployment.unit.\"api.war\".component.\"com.sun.faces.config.ConfigureListener\".START, jboss.deployment.unit.\"api.war\".WeldStartService, jboss.undertow.deployment.default-server.default-host./api.UndertowDeploymentInfoService, jboss.persistenceunit.\"api.war#shortbox-unit\", jboss.persistenceunit.\"api.war#shortbox-unit\".FIRST_PHASE, jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".START, jboss.deployment.unit.\"api.war\".component.IssueBean.START, jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".START]",
"jboss.deployment.unit.\"api.war\".WeldEndInitService is missing [jboss.deployment.unit.\"api.war\".component.\"javax.faces.webapp.FacetTag\".START, jboss.deployment.unit.\"api.war\".WeldStartService, jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldInitialListener\".START, jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".START, jboss.deployment.unit.\"api.war\".component.IssueBean.START, jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldTerminalListener\".START, jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".START, jboss.deployment.unit.\"api.war\".component.\"com.sun.faces.config.ConfigureListener\".START]",
"jboss.deployment.unit.\"api.war\".jndiDependencyService is missing [jboss.naming.context.java.module.api.api.env.\"xyz.shortbox.backend.ejb.IssueBean\".em]",
"jboss.deployment.unit.\"api.war\".deploymentCompleteService is missing [jboss.deployment.unit.\"api.war\".component.\"javax.faces.webapp.FacetTag\".START, jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldInitialListener\".START, jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldTerminalListener\".START, jboss.undertow.deployment.default-server.default-host./api, jboss.deployment.unit.\"api.war\".component.\"com.sun.faces.config.ConfigureListener\".START, jboss.persistenceunit.\"api.war#shortbox-unit\", jboss.persistenceunit.\"api.war#shortbox-unit\".FIRST_PHASE, jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".START, jboss.deployment.unit.\"api.war\".component.IssueBean.START, jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".START]",
"jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".WeldInstantiator is missing [jboss.deployment.unit.\"api.war\".WeldStartService]",
"jboss.deployment.unit.\"api.war\".component.\"com.sun.faces.config.ConfigureListener\".START is missing [jboss.persistenceunit.\"api.war#shortbox-unit\", jboss.deployment.unit.\"api.war\".component.\"com.sun.faces.config.ConfigureListener\".WeldInstantiator, jboss.deployment.unit.\"api.war\".jndiDependencyService]",
"jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".START is missing [jboss.persistenceunit.\"api.war#shortbox-unit\", jboss.deployment.unit.\"api.war\".jndiDependencyService, jboss.deployment.unit.\"api.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".WeldInstantiator]",
"jboss.persistenceunit.\"api.war#shortbox-unit\" is missing [jboss.naming.context.java.jdbc.shortbox, jboss.persistenceunit.\"api.war#shortbox-unit\".FIRST_PHASE]",
"jboss.deployment.unit.\"api.war\".component.\"org.jboss.weld.module.web.servlet.WeldInitialListener\".WeldInstantiator is missing [jboss.deployment.unit.\"api.war\".WeldStartService]"
]
}
When I remove the jboss-ds.xml and configure the persistence.xml to use my db everything is deploying fine - but the application is using the exampleDS, because I have not configured any other DS.
What am I doing wrong?
One more important note - I definitly want to manage the DS in my Appliaction, not in the JBoss config.
Thanks in advance!
The solution was simple as ABC... The jboss.xml must be placed in the WEB-INF root and not in the META-INF.

Error starting JBOSS 7.0.0.0 Final - Services with missing/unavailable dependencies

I am having problems while starting a sample app on JBoss server 7.0.
Below follow piece of start log:
12:19:10,156 ERROR [org.jboss.as] (MSC service thread 1-7) JBoss AS 7.0.0.Final "Lightning" started (with errors) in 16391ms - Started 207 of 331 services (67 services failed or missing dependencies, 57 services are passive or on-demand)
12:19:10,361 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "crm.war" was rolled back with failure message {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"crm.war\".jndiDependencyService missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\", jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ContatoDAORemote.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.persistenceunit.\"crm.war#crmUnity\" missing [ jboss.naming.context.java.jdbc/CRMDS ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ClienteRemoteDAO.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\" ]"]}
12:19:10,443 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment crm.war in 82ms
12:19:10,445 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"crm.war\".jndiDependencyService missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\", jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ContatoDAORemote.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.persistenceunit.\"crm.war#crmUnity\" missing [ jboss.naming.context.java.jdbc/CRMDS ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ClienteRemoteDAO.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\" ]"]}}}
crm-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>CRMDS</jndi-name>
<connection-url>jdbc:hsqldb:file:database/crm</connection-url>
<driver>hsqldb.jar</driver>
<user-name>SA</user-name>
<password></password>
</local-tx-datasource>
</datasources>
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="crmUnity" transaction-type="JTA">
<jta-data-source>java:/CRMDS</jta-data-source>
<class>br.com.crm.model.entities.Cliente</class>
<class>br.com.crm.model.entities.Contato</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.showSql" value="true"/>
</properties>
</persistence-unit>
</persistence>
The main error is:
ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ClienteRemoteDAO.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\" ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ContatoDAORemote.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.deployment.unit.\"crm.war\".jndiDependencyService missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\", jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\" ]","jboss.persistenceunit.\"crm.war#crmUnity\" missing [ jboss.naming.context.java.java:CRMDS ]"]}}}
Thank you in advance for help me.
This error appears to be the entity manager missing the datasource. Make sure the JNDI name in both the persistence.xml and -ds.xml is the same (e.g. they should both be java:/CRMDS).
Also JBoss AS 7.0.0 is extremely outdated, if you are starting a new project you should use something newer (either Wildfly or JBoss EAP).

JBoss logs Postgres driver is "non-JDBC-compliant"

I wired my JBoss server into a new Postgres database.
In standalone.xml:
<driver name="postgresql" module="com.postgresql.pgjdbc">
<driver-class>org.postgresql.Driver</driver-class>
</driver>
In module.xml:
<module xmlns="urn:jboss:module:1.1" name="com.postgresql.pgjdbc">
<resources>
<resource-root path="postgresql-9.3-1102.jdbc41.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
When starting JBoss, I get the following log entry:
10:49:57,206 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.3)
The driver does seem to connect and work. What are the effects of this non-compliance?
According this JBoss forum entry none: Why is my JDBC4-compliant driver loaded as "non-JDBC-compliant"?
Because org.postgresql.Driver#jdbcCompliant() returns false. So you
can ignore that for now, and I'm sure that the PostgreSQL JDBC people
would like code contributions
And source code:
/**
* Report whether the driver is a genuine JDBC compliant driver. A
* driver may only report "true" here if it passes the JDBC compliance
* tests, otherwise it is required to return false. JDBC compliance
* requires full support for the JDBC API and full support for SQL 92
* Entry Level.
*
* <p>For PostgreSQL, this is not yet possible, as we are not SQL92
* compliant (yet).
*/
public boolean jdbcCompliant()
{
return false;
}
https://github.com/pgjdbc/pgjdbc/blob/REL9_3_1102/org/postgresql/Driver.java.in
This is part of the TODO List http://jdbc.postgresql.org/development/todo.html#Compliance

How to change JBoss eap 6.1 deployment folder

I'm trying to change deployment folder for JBoss without success.
Regarding some information which I've found on google I was trying to change standalone.xml configuration file. I've added following lines after <extensions> node :
<system-properties>
<property name="deploydir" value="/home/Artur"/>
</system-properties>
And I've changed <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1"> as following:
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
<deployment-scanner path="deployments" relative-to="deploydir" scan-interval="10000"/>
</subsystem>
I have the following path /home/Artur/deployments on my system.
But when i try to run JBoss server I always get an error :
09:05:21,283 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 2) JBAS014612: Operation ("add") failed - address: ([
("subsystem" => "deployment-scanner"),
("scanner" => "default")
]): java.lang.IllegalArgumentException: JBAS014847: Could not find a path called 'deployments'
I was trying to configure it with different paths on my system, I was checking also for spelling in every case. But nothing helps. Does anyone have and idea how to properly configure path for deployment folder in JBoss ? (version as in title)
OK I solved this issue. To change deployment directory it's needed to specyify path to this directory in block :
<paths>
<path name="deploydir" path="/home/Artur"/>
</paths>
instead of
<system-properties>
<property name="deploydir" value="/home/Artur"/>
</system-properties>
which I mentioned about earlier. So i conclusion we need to specify <path> node in standalone.xml configuration file and change <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1"> to point on newly created path (in this case to "deploydir")