Versão atual:

Servico para dados externos do Postgresql

Criei um serviço para o banco de dados Postgresql.

Usei a inestimável técnica do amigo Luiz Postal, com uma pequena modificação.

O servidor do Fluig sobe sem problemas, os logs não mostram erros, mas, quando vou em Serviços, no Painel de Controle, só aparece o FluigDSRO.

Meu arquivo domain.xml tem isto:

<datasources>
(...)

 <datasource enabled="true" jndi-name="java:/jdbc/ucrgPostgresDS" jta="false" pool-name="ucrgPostgresDS" use-java-context="false">
      <connection-url>jdbc:postgresql://172.16.0.30:5432/ucrg?useSSL=false</connection-url>
      <driver>postgresql</driver>
      <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
      <pool>
        <min-pool-size>10</min-pool-size>
        <max-pool-size>50</max-pool-size>
        <prefill>true</prefill>
      </pool>
      <security>
        <user-name>NOME DO MEU USUÁRIO DO BANCO DE DADOS</user-name>
        <password>SENHA DESTE USUÁRIO</password>
      </security>
      <statement>
        <prepared-statement-cache-size>32</prepared-statement-cache-size>
        <share-prepared-statements>true</share-prepared-statements>
      </statement>
    </datasource>
    <drivers>
      <driver module="com.mysql" name="mysqlDriver">
        <driver-class>com.mysql.jdbc.Driver</driver-class>
      </driver>
      <driver name="postgresql" module="org.postgresql">
        <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
      </driver>
    </drivers>
  </datasources>

Também, criei uma pasta nova para abrigar o arquivo module.xml no caminho

C:\fluighom\appserver\modules\system\layers\base\org\postgresql\main

com o conector jdbc.

O module.xml tem:

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

e o arquivo postgresql-42.2.5.jre7.jar está na mesma pasta.

No log do servidor, na pasta C:\fluighom\appserver\domain\servers\fluig1\log, não há erro.

server.log:

(...)
2019-02-23 13:47:34,854 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 63) WFLYJCA0005: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 42.2)
2019-02-23 13:47:34,854 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = postgresql
2019-02-23 13:47:34,901 INFO  [org.jboss.as.naming] (MSC service thread 1-3) WFLYNAM0003: Starting Naming Service
2019-02-23 13:47:34,901 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
2019-02-23 13:47:34,964 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 39) WFLYUT0014: Creating file handler for path 'C:\fluighom/repository/wcmdir/static' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
2019-02-23 13:47:35,557 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0012: Started server default-server.
2019-02-23 13:47:35,573 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0018: Host default-host starting
(...)
2019-02-23 13:47:35,620 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0098: Bound non-transactional data source: java:/jdbc/FluigDSRO
2019-02-23 13:47:35,620 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) WFLYJCA0098: Bound non-transactional data source: java:/jdbc/ucrgPostgresDS
2019-02-23 13:47:35,682 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow HTTP listener default listening on 172.16.0.28:8080
2019-02-23 13:47:35,839 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) WFLYJCA0001: Bound data source [java:/jdbc/FluigDS]
2019-02-23 13:47:35,901 INFO  [org.wildfly.iiop.openjdk] (MSC service thread 1-2) WFLYIIOP0009: CORBA ORB Service started

Estaria, eu, procurando a conexão em lugar errado no Painel de Controle do Fluig?

Versões (6):

Ver a versão formatada

Servico para dados externos do Postgresql

  • criado 23 de Feb de 2019

Comentário

new question