AEM 6.2 - JBOSS - Add PostgreSQL datasource?

247 views
Skip to first unread message

DCS_JEFF

unread,
Aug 16, 2017, 9:23:28 AM8/16/17
to Adobe LiveCycle Developers
I hate to admit, but I am lost trying to add a new datasource in AEM 6.2   (JBOSS 6.4.5, Java 1.8 upd 144) for a postgres Database.

In LiveCycle it was really easy, copy the driver, add to the adobe-ds.xml file and restart.

I can't find where to copy the driver...  things say to deploy the driver (jar file).    ?  The AEP console configuration section has a to deploy datasources, but it's not 100% apparent how to do this ...  does the driver need to be "deployed" somehow?

Any assistance would be greatly appreciated!

DCS_JEFF

unread,
Aug 23, 2017, 8:29:34 AM8/23/17
to Adobe LiveCycle Developers
Has anyone added a datasource that was NOT the same database as their internal AEM database?   We installed AEM with SQL Server, but our application, for which we are producing forms, runs on PostgreSQL.

Adobe simple sent me a googled Redhat document, which hasn't worked.

I did find that I could add the driver reference in the domain_mssql.xml...

<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>

... which gets it to show up as a driver when adding a datasource through the AEP consilde, but it still cannot connect...I get "JBAS014771: Services with missing/unavailable dependencies".  I am guessing JBoss still doesn't really "know" that the reference is for the driver/knows where the driver is located.

Has anyone done this in AEM 6.2 on JBoss AEP 6.4?   Can you add it manually (copy driver to a folder?) and add the datasource to  to the domain_mssql.xml (like it was done with LiveCycle in the adobe-ds.xml)?

Aditya Shah

unread,
Aug 23, 2017, 9:08:07 AM8/23/17
to live...@googlegroups.com
Do you have the actual driver file?

Thanks
Aditya
--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.
To post to this group, send email to live...@googlegroups.com.
Visit this group at https://groups.google.com/group/livecycle.
For more options, visit https://groups.google.com/d/optout.

DCS_JEFF

unread,
Aug 23, 2017, 9:20:39 AM8/23/17
to Adobe LiveCycle Developers
Aditya, thanks for your response...


Yes...  I have the postgresql-9.3-1104.jdbc4.jar

Some documentation says to create the org folder under modules, then postgresql, and main... then copy the driver there and add the module.xml, which I did:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" 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>


But the mssqlserver drivers are in ...\JBoss\modules\system\layers\base\com\

I tried to copy the driver and module.xml to \JBoss\modules\system\layers\base\org\  as well, but that doesn't work either.

Other documentation says that not all JDBC4 drivers are compliant and you need to modify the .jar   (see  https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-JDBC_Drivers.html  ).  I tried it that way and to deploy the driver through the console, but the driver never showed up to be selected when I was adding a datasource through the console.

DCS_JEFF

unread,
Aug 23, 2017, 12:07:13 PM8/23/17
to Adobe LiveCycle Developers
Update...


I added the datasource manually to domain_mssql.xml (originally copied one online, but would not parse, so chopped it down to the basics


<datasource jndi-name = "java:/PostgresDS" pool-name = "PostgresDS" enabled = "true" jta = "false" use-java-context = "true" use-ccm = "false">
            <connection-url>jdbc:postgresql://xxxxx:#####/xxxDB</connection-url>
            <driver-class>org.postgresql.Driver</driver-class>
            <driver>postgresql</driver>
            <security>
                <user-name>XXXX</user-name>
                <password>XXXX</password>
            </security>
  </datasource>



but keep getting the following when I start Jboss:  

"JBAS014771: Services with missing/unavailable dependencies" => [
    "jboss.data-source.java:/PostgresDS is missing [jboss.jdbc-driver.postgresql]",
    "jboss.driver-demander.java:/PostgresDS is missing [jboss.jdbc-driver.postgresql]"
]

Aditya Shah

unread,
Aug 23, 2017, 12:12:36 PM8/23/17
to live...@googlegroups.com
Are you referencing the domain_mssql.xml in your  start up parameters?

Aditya

DCS_JEFF

unread,
Aug 23, 2017, 12:16:14 PM8/23/17
to Adobe LiveCycle Developers
Yes.   we are manually starting-up/shutting down.  it reads the domain_mssql.xml just fine.   Like I mentioned earlier....  I added the driver there which added it / made it available in the console.    it is reading the new datasource entry, but when I start Jboss I see that error message (Services with missing/unavailable dependencies) in the server.log

Aditya Shah

unread,
Aug 23, 2017, 12:26:27 PM8/23/17
to live...@googlegroups.com
Could you upload the XML after redacting passwords and sensitive information?

Aditya

DCS_JEFF

unread,
Aug 23, 2017, 12:53:24 PM8/23/17
to Adobe LiveCycle Developers
I added the two things I changed, but here's the complete domain_mssql.xml

I really think it has to do with JBoss knowing where the postgres driver actually is located... 
domain_mssql.xml
Reply all
Reply to author
Forward
0 new messages