Dear all,

Well, recently I tried to make my application work on AS7.

Just to check if I should have to do some code modifications in my application when EAP 6 will be released.

FYI, you can download freely AS7 at the following URL – – however as it is a community project you will not have any support with SLA.

In case of you would need one(s) then I would suggest you to subscribe to  JBoss EAP Solutions –

So,  one of my main targets was to make AS7 work with Postgresql as its underlying database.

1] I wanted to use an updated Postgresql JDBC then I had to download it from the JDBC Postgresql website –

I used postgresql-9.1-901.jdbc4.jar

2]  I had to create dedicated directories and files inside the AS7 directory.


Then, to upload the postgresql-9.1-901.jdbc4.jar in the following path :   jboss-as-7.0.2.Final/modules/org/postgres/main

And then to create specific xml file named : module.xml  with the following content :

<module xmlns="urn:jboss:module:1.0" name="org.postgres">
    <resource-root path="postgresql-9.1-901.jdbc4.jar"/>
     <module name="javax.api"/>
     <module name="javax.transaction.api"/>
So in the  jboss-as-7.0.2.Final/modules/org/postgres/main path you should retrieved the following files :

> postgresql-9.1-901.jdbc4.jar – Postgresql JDBC4 driver.

> postgresql-9.1-901.jdbc4.jar.index – Index file generated by JBoss. That file should automatically created by the JBoss instance as soon as the Postgresql JDBC Driver will be discover by the instance.

> module.xml – Module Description

4] Then, I  had to add a Posgresql node in the following section of the jboss-as-7.0.2.Final/standalone/configuration/standalone.xml file.

<subsystem xmlns="urn:jboss:domain:datasources:1.0">


                  <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true">

                  <datasource jndi-name="java:jboss/datasources/PostgresqlDS" pool-name="java:jboss/datasources/PostgresqlDS_Pool" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                    <driver name="postgresql" module="org.postgres">
                    <driver name="h2" module="com.h2database.h2">
Rem: Do not forget to change the Postgresql Database user and password to yours.

5] You can check in the JBoss Administration Console your JDBC connection is rcognized – http://localhost:9990/console/App.html#server/datasources

You should see a green light if everything is OK.

6] Finally, do not forget to change the persistence -persistence.xml – file of your application to check your application works with the new Posgresql datasource.

<?xml version="1.0" encoding="UTF-8"?>

<persistence xmlns=""
<persistence-unit name="astroDatabase">
                  <property name="" value="create-drop" />
                  <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
                  <property name="hibernate.show_sql" value="false"/>
                  <property name="hibernate.format_sql" value="false"/>
                  <property name="hibernate.use_sql_comments" value="false"/>

Ref #1 :

Ref #2 :

Best Regards