Error while accessing to Oracle 10g from app in JBoss EAP 6

Josep A. Perales

I'm developing a simple aplication that must have access to an Oracle 10g DB and that is running under a JBoss EAP 6.1.0 server. I have followed the steps given on the official guide in order to install the Oracle driver.

So currently, I have the following config files. I added folder jboss-eap-6.1\modules\com\oracle\db\main with ojdbc6.jar and module.xml, with content:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.oracle.db">
  <resources>
    <resource-root path="ojdbc6.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
  </dependencies>
</module>

In jboss-eap-6.1\standalone\configuration\standalone.xml I added the following lines in the datasources node:

        <datasource jndi-name="java:/jdbc/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">
            <connection-url>jdbc:oracle:thin:@10.0.6.0:1521:ORC1;DB_CLOSE_DELAY=-1</connection-url>
            <driver>oracle</driver>
            <security>
                <user-name>a</user-name>
                <password>a</password>
            </security>
        </datasource>
        <drivers>
            <driver name="oracle" module="com.oracle.db">
                <datasource-class>oracle.jdbc.driver.OracleDriver</datasource-class>
            </driver>
        </drivers>

And finally, in my Java code I create the connection with:

InitialContext initContext = new InitialContext();
DataSource ds = (DataSource)initContext.lookup("java:/jdbc/OracleDS");
conexion = ds.getConnection();

While executing this, it gives me an error on the line conexion = ds.getConnection():

javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jdbc/OracleDS

I've been looking for a possible solution on the net with no success. Any idea?

Josep A. Perales

Finally, I could make it work! What I've done:

  • In standalone.xml, I've changed those two lines:

-

<datasource jndi-name="java:/jdbc/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:@10.0.6.0:1521:ORC1;DB_CLOSE_DELAY=-1</connection-url>

for

<datasource jndi-name="**java:jboss/OracleDS**" pool-name="OracleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:**@//10.0.0.110:1521/orc11.palluc.com**</connection-url>

so my jndi-name and url connection were invalid.

  • In Java code, I've changed (taking into account previous changes):

    DataSource ds = (DataSource)initContext.lookup("java:/jdbc/OracleDS");

for

DataSource ds = (DataSource)initContext.lookup("java:jboss/OracleDS");

After that, it seemed to work but I still got the Oracle error explained in ORA-01882: timezone region not found . I followed comment #6 to solve it (it seems there are 'prettier' solutions than directly modifying ojdbc6.jar library, as explained in this post), and now it works as expected.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Configure Data source error in JBOSS eAP 6 with oracle

From Dev

JBoss EAP 6 - Error in creating InitialContext

From Dev

Getting a warning/error when connecting to queue deployed on JBoss EAP 7.1 from Spring-Boot app

From Dev

JBoss EAP 6 cannot find JARs in APP-INF/lib

From Dev

Jboss EAP 6.3 deployment error: oracle datasource not found

From Dev

Error while Executing OPENQUERY with Oracle 10g in SQL Server 2008 R2

From Dev

Tibco Connection error while connection Oracle 10g Express Edition

From Dev

getting IOException "got minus one from a read call" while connecting to oracle 10g database

From Dev

Oracle 10g A cursor with parameter Error

From Dev

JBoss eap 6 JNDI Issue

From Dev

Oracle 10g update table i from table 2 column join error

From Dev

jboss-eap-6.x adding infinispan indexing element from jboss-cli

From Dev

Oracle JDBC Diagnostics with JBoss EAP 6.1

From Dev

Problems accessing EJB in JBoss AS 7.x from Tomcat 6

From Dev

Error while starting JBoss EAP 6.2 when using Http11NioProtocol

From Dev

Reach JBoss EAP 6 server in local network

From Dev

Reach JBoss EAP 6 server in local network

From Dev

Oracle Forms 10g Run time Error in mozilla

From Dev

Delete tables from database Oracle 10g

From Dev

Get data from column in oracle 10g

From Dev

Get lower case letters from oracle 10g columns

From Dev

JBoss: Binding values into JNDI in JBoss EAP 6 similar to JNDIBindingServiceMgr

From Dev

JBoss: Binding values into JNDI in JBoss EAP 6 similar to JNDIBindingServiceMgr

From Dev

Error deploying WAR file on JBOSS EAP 6.4

From Dev

Console error while accessing property from object

From Dev

Xmlparserv2 error while application deployed in jboss, Installing Oracle ojdbc module in JBoss for Java web application

From Dev

jboss-eap-6.1 oracle driver definition when installed as deployment

From Dev

Oracle JDeveloper studio 12c with JBOSS EAP?

From Dev

Where does jboss eap 6.x deploy the war file?

Related Related

  1. 1

    Configure Data source error in JBOSS eAP 6 with oracle

  2. 2

    JBoss EAP 6 - Error in creating InitialContext

  3. 3

    Getting a warning/error when connecting to queue deployed on JBoss EAP 7.1 from Spring-Boot app

  4. 4

    JBoss EAP 6 cannot find JARs in APP-INF/lib

  5. 5

    Jboss EAP 6.3 deployment error: oracle datasource not found

  6. 6

    Error while Executing OPENQUERY with Oracle 10g in SQL Server 2008 R2

  7. 7

    Tibco Connection error while connection Oracle 10g Express Edition

  8. 8

    getting IOException "got minus one from a read call" while connecting to oracle 10g database

  9. 9

    Oracle 10g A cursor with parameter Error

  10. 10

    JBoss eap 6 JNDI Issue

  11. 11

    Oracle 10g update table i from table 2 column join error

  12. 12

    jboss-eap-6.x adding infinispan indexing element from jboss-cli

  13. 13

    Oracle JDBC Diagnostics with JBoss EAP 6.1

  14. 14

    Problems accessing EJB in JBoss AS 7.x from Tomcat 6

  15. 15

    Error while starting JBoss EAP 6.2 when using Http11NioProtocol

  16. 16

    Reach JBoss EAP 6 server in local network

  17. 17

    Reach JBoss EAP 6 server in local network

  18. 18

    Oracle Forms 10g Run time Error in mozilla

  19. 19

    Delete tables from database Oracle 10g

  20. 20

    Get data from column in oracle 10g

  21. 21

    Get lower case letters from oracle 10g columns

  22. 22

    JBoss: Binding values into JNDI in JBoss EAP 6 similar to JNDIBindingServiceMgr

  23. 23

    JBoss: Binding values into JNDI in JBoss EAP 6 similar to JNDIBindingServiceMgr

  24. 24

    Error deploying WAR file on JBOSS EAP 6.4

  25. 25

    Console error while accessing property from object

  26. 26

    Xmlparserv2 error while application deployed in jboss, Installing Oracle ojdbc module in JBoss for Java web application

  27. 27

    jboss-eap-6.1 oracle driver definition when installed as deployment

  28. 28

    Oracle JDeveloper studio 12c with JBOSS EAP?

  29. 29

    Where does jboss eap 6.x deploy the war file?

HotTag

Archive