Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Postgres database driver "not installed"

Help
harmscon
2014-02-15
2014-02-25
  • harmscon
    harmscon
    2014-02-15

    When trying to use a postgres database with EJBCA CE 6.0.3, I get the message from ant deploy that Driver named "org.postgresql.Driver" is not installed. Over in my JBoss AS 7.1.1.Final terminal, I can see when jboss starts that it has deployed the postgres driver. I had all this working 6 months ago but am trying to start fresh with the latest versions of ejbca, jboss and postgress driver. I hope one of you can see my problem please.

    Test system: Virtualbox VM guest, 3 vcpus, 2gb ram, 10gb disk
    OS: Ubuntu 12.04 x64 server, minimum install
    JBoss: JBoss AS 7.1.1.Final
    EJBCA: EJBCA CE 6.0.3
    postgresql-9.3-1100.jdbc41.jar installed to $HOME/jboss-as-7.1.1.Final/standalone/deployments/

    I've followed the Ubuntu quick start guide: http://www.ejbca.org/installation.html#Ubuntu%20quick%20start
    After step 5 I followed the HOWTO-database.txt for a postgres database. Created a database, user and password. Installed the postgres jdbc driver into jboss as above.

    /ejbca_ce_6_0_3/conf/ejbca.properties:
    appserver.home=/home/hcadmin/jboss-as-7.1.1.Final
    ejbca.cli.defaultusername=ejbca
    ejbca.cli.defaultpassword=ejbca

    /ejbca_ce_6_0_3/conf/database.properties:
    datasource.jndi-name=EjbcaDS
    database.name=postgres
    database.url=jdbc:postgresql://127.0.0.1/ejbca
    database.driver=org.postgresql.Driver
    database.username=ejbca
    database.password=ejbca

    And then continue onto step 6 of the quick start guide:
    cd jboss-as-7.1.1.Final
    bin/standalone.sh

    Jboss output:
    15:48:39,419 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory /home/euser/jboss-as-7.1.1.Final/standalone/deployments
    15:48:39,514 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
    15:48:39,542 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "postgresql-9.3-1100.jdbc41.jar"
    15:48:39,732 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.3)

    In another shell I continue with ejbca deployment:
    cd ejbca_ce_6_0_3
    ant deploy

    EJBCA output:
    jee:assert-runJBoss7:
    [echo] Checking if JBoss 7 is up and running...

    jee:deployServicesJBoss7:
    [echo] /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=ejbca-mail-smtp:add(port="25", host="localhost")
    [exec] {"outcome" => "success"}
    [echo] /subsystem=mail/mail-session="java:/EjbcaMail":add(jndi-name="java:/EjbcaMail"
    [exec] {"outcome" => "success"}
    [echo] /subsystem=mail/mail-session="java:/EjbcaMail"/server=smtp:add(outbound-socket-binding-ref=ejbca-mail-smtp, ssl="false")
    [exec] {"outcome" => "success"}

    jee:deployServices:

    jee:deployDSJBoss5:

    jee:deployDSJBoss7:
    [exec] Result: 1
    [exec] Result: 1
    [echo] data-source add --name=ejbcads --driver-name="org.postgresql.Driver" --connection-url="jdbc:postgresql://127.0.0.1/ejbca" --jndi-name="java:/EjbcaDS" --use-ccm=true --user-name="ejbca" --password="ejbca" --validate-on-match=true --background-validation=false --prepared-statements-cache-size=50 --share-prepared-statements=true --min-pool-size=5 --max-pool-size=150 --pool-prefill=true --transaction-isolation=TRANSACTION_READ_COMMITTED --check-valid-connection-sql="select 1"
    [exec] JBAS010468: Driver named "org.postgresql.Driver" is not installed.

    BUILD FAILED
    /home/euser/ejbca_ce_6_0_3/build.xml:635: The following error occurred while executing this line:
    /home/euser/ejbca_ce_6_0_3/bin/jboss.xml:265: The following error occurred while executing this line:
    /home/euser/ejbca_ce_6_0_3/bin/jboss.xml:501: exec returned: 1

    Total time: 1 minute 22 seconds

    As jboss seems to be deploying the postgres driver, does anyone know why ejbca can't find it?

    Cheers
    Josh

     
  • Check the installation guide, jboss section, for information how to install database driver in jboss 7.

    Cheers,
    Tomas

     
  • where did you place your postgres driver in jboss.

    you should place the drivers like this in your jboss

    jboss/modules/org/postgresql/main/postgresql-9.1-903.jdbc4.jar

    and also create a module.xml

    cat jboss/modules/org/postgresql/main/module.xml

    <module xmlns="urn:jboss:module:1.0" name="org.postgresql"> <resources> <resource-root path="postgresql-9.1-903.jdbc4.jar"/> </resources> <dependencies> <module name="javax.api"/> <module name="javax.transaction.api"/> </dependencies> </module>

    after this you should start jboss and add the the driver using following command

    /subsystem=datasources/jdbc-driver=org.postgresql.Driver:add(driver-name=org.postgresql.Driver,driver-module-name=org.postgresql,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)

    follow this installation guide
    http://www.ejbca.org/docs/installation.html

     
  • harmscon
    harmscon
    2014-02-23

    Thanks for the replies. The link I was using is stale: (http://www.ejbca.org/installation.html)

    I got it all going like this:
    apt-get install libpostgresql-jdbc-java
    cd jboss-as-7.1.1.Final/
    jboss-as-7.1.1.Final$ mkdir -p modules/org/postgresql/main
    jboss-as-7.1.1.Final$ cd modules/org/postgresql/main
    jboss-as-7.1.1.Final/modules/org/postgresql/main$ ln -s /usr/share/java/postgresql-jdbc4.jar postgresql-jdbc4.jar

    jboss-as-7.1.1.Final/modules/org/postgresql/main$ cat module.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.0" name="org.postgresql">
    <resources>
    <resource-root path="postgresql-jdbc4.jar"/>
    </resources>
    <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
    </dependencies>
    </module>

     
    Last edit: harmscon 2014-02-25
  • is it working ? or still having issues?

     
  • harmscon
    harmscon
    2014-02-25

    It is working. Thank you for your help.