1 2 Previous Next 15 Replies Latest reply on Dec 19, 2007 10:24 AM by eduacsp2

    org.jboss.resource.JBossResourceException: Could not create

    eduacsp2

      Hi fellas,

      I try to run a java routine on the oracle with jboss+datasource, but i get these errors message:


      12:20:35,125 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Exceção de E/S: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153094144)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))))
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:164)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:519)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:208)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:529)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:410)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:342)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:462)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:894)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:73)
      at com.xxxxxxxxxxx.xxxxxxxxx.carga.bd.GetConnectionTb54.getConnection(GetConnectionTb54.java:40)
      at com.xxxxxxxxxxx.xxxxxxxxx.carga.dao.SelectsDAO.<init>(SelectsDAO.java:50)
      at com.xxxxxxxxxxx.xxxxxxxxx.carga.business.CarregandoAnuncios.upgrade(CarregandoAnuncios.java:43)
      at com.xxxxxxxxxxx.xxxxxxxxx.carga.service.PrCargaIncService.perform(PrCargaIncService.java:103)
      at org.jboss.varia.scheduler.Scheduler$Listener.handleNotification(Scheduler.java:1221)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:138)
      at $Proxy10.handleNotification(Unknown Source)
      at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:221)
      at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:184)
      at javax.management.timer.Timer.sendNotification(Timer.java:1295)
      at javax.management.timer.Timer.notifyAlarmClock(Timer.java:1264)
      at javax.management.timer.TimerAlarmClock.run(Timer.java:1347)
      at java.util.TimerThread.mainLoop(Timer.java:512)
      at java.util.TimerThread.run(Timer.java:462)
      Caused by: java.sql.SQLException: Exceção de E/S: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153094144)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
      at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3678)
      at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:352)
      at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:365)
      at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:547)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:347)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:154)
      ... 25 more



      here is my DS.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <local-tx-datasource>
       <jndi-name>OracleDSGD13</jndi-name>
       <connection-url>jdbc:oracle:thin:@xx.x.x.xx:1521:Gd13</connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>xxxxxxxx</user-name>
       <password>xxxxxxxx</password>
       <min-pool-size>1</min-pool-size>
       <max-pool-size>50</max-pool-size>
       <idle-timeout-minutes>5</idle-timeout-minutes>
       <blocking-timeout-millis>30000</blocking-timeout-millis>
      
       <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
      
       <isSameRM-override-value>false</isSameRM-override-value>
       <track-connection-by-tx/>
       <no-tx-separate-pools/>
      
      
       </local-tx-datasource>
      </datasources>
      
      


        • 1. Re: org.jboss.resource.JBossResourceException: Could not cre
          jaikiran

           

          Could not create connection; - nested throwable: (java.sql.SQLException: Exceção de E/S: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153094144)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))))


          Are you sure the connection-url you have mentioned in the ds.xml file is correct? Especially the database name?

          <connection-url>jdbc:oracle:thin:@xx.x.x.xx:1521:Gd13</connection-url>


          Googling for this error code leads to some posts which mention that this error might be because of an incorrect DB name in the connection url

          • 2. Re: org.jboss.resource.JBossResourceException: Could not cre
            vickyk

             

            "eduacsp2" wrote:

            org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Exceção de E/S: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153094144)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))))

            Looks like something has gone wrong on the Oracle side .
            Can you write a simple java standalone application which would use Oracle thin driver to connect to Oracle when you are experiencing the above problem ?
            Does this error appear every time Or it keeps on coming at random ?


            • 3. Re: org.jboss.resource.JBossResourceException: Could not cre
              vickyk

              Also make sure that SID is correct , this is already been pointed by jaikiran
              http://www.cryer.co.uk/brian/oracle/ORA12505.htm

              • 4. Re: org.jboss.resource.JBossResourceException: Could not cre
                eduacsp2

                 

                "vickyk" wrote:
                Also make sure that SID is correct , this is already been pointed by jaikiran
                http://www.cryer.co.uk/brian/oracle/ORA12505.htm


                yes...SID is correct

                • 5. Re: org.jboss.resource.JBossResourceException: Could not cre
                  eduacsp2

                   

                  "vickyk" wrote:
                  "eduacsp2" wrote:

                  org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Exceção de E/S: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153094144)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))))

                  Looks like something has gone wrong on the Oracle side .
                  Can you write a simple java standalone application which would use Oracle thin driver to connect to Oracle when you are experiencing the above problem ?
                  Does this error appear every time Or it keeps on coming at random ?


                  when i use pure jdbc, everything is fine.

                  • 6. Re: org.jboss.resource.JBossResourceException: Could not cre
                    eduacsp2

                    pools in jboss can solve drop connections?

                    • 7. Re: org.jboss.resource.JBossResourceException: Could not cre

                       

                      when i use pure jdbc, everything is fine.

                      This is strange , the Jboss code which is failing here is
                      private LocalManagedConnection getLocalManagedConnection(Properties props,Properties copy)
                       throws JBossResourceException
                       {
                       try
                       {
                       String url = getConnectionURL();
                       Driver d = getDriver(url);
                       Connection con = d.connect(url, copy);
                       if (con == null)
                       throw new JBossResourceException("Wrong driver class for this connection URL");
                      
                       return new LocalManagedConnection(this, con, props, transactionIsolation, preparedStatementCacheSize);
                       }
                       catch (Exception e)
                       {
                       throw new JBossResourceException("Could not create connection", e);
                       }
                       }
                      

                      This is from
                      http://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java

                      d.connect(url, copy); seems to be failing .

                      Can you use the Driver.connect(...) to get the connection in your stand alone application and see if it works ?
                      Also make sure that you are using the same Oracle driver for running the stand alone application which is present in the Jboss server .




                      • 8. Re: org.jboss.resource.JBossResourceException: Could not cre
                        vickyk

                         

                        "eduacsp2" wrote:
                        pools in jboss can solve drop connections?

                        What do you mean by that ?

                        • 9. Re: org.jboss.resource.JBossResourceException: Could not cre
                          eduacsp2

                           

                          "vickyk" wrote:
                          "eduacsp2" wrote:
                          pools in jboss can solve drop connections?

                          What do you mean by that ?



                          For example ... in the middle of a load data routine the connection data falls, the pool of jboss can restart the routine in the exactly point where stopped?

                          • 10. Re: org.jboss.resource.JBossResourceException: Could not cre
                            eduacsp2

                             

                            "vicky.kak@jboss.com" wrote:
                            when i use pure jdbc, everything is fine.

                            This is strange , the Jboss code which is failing here is
                            private LocalManagedConnection getLocalManagedConnection(Properties props,Properties copy)
                             throws JBossResourceException
                             {
                             try
                             {
                             String url = getConnectionURL();
                             Driver d = getDriver(url);
                             Connection con = d.connect(url, copy);
                             if (con == null)
                             throw new JBossResourceException("Wrong driver class for this connection URL");
                            
                             return new LocalManagedConnection(this, con, props, transactionIsolation, preparedStatementCacheSize);
                             }
                             catch (Exception e)
                             {
                             throw new JBossResourceException("Could not create connection", e);
                             }
                             }
                            

                            This is from
                            http://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java

                            d.connect(url, copy); seems to be failing .

                            Can you use the Driver.connect(...) to get the connection in your stand alone application and see if it works ?
                            Also make sure that you are using the same Oracle driver for running the stand alone application which is present in the Jboss server .




                            Right now i use this code, and everything is fine:

                             Connection con = null;
                             try{
                             Class.forName("oracle.jdbc.driver.OracleDriver");
                             con =DriverManager.getConnection("jdbc:oracle:thin:@xx.x.x.xx:1521:Gd13","xxxx","xxxx");
                             }catch(ClassNotFoundException e){
                             throw new SQLException(e.getMessage());
                             }
                             return con;
                            


                            and...yes...the oracle jdbc driver is in the lib jboss folder.

                            • 11. Re: org.jboss.resource.JBossResourceException: Could not cre
                              vickyk

                               

                              "eduacsp2" wrote:

                              For example ... in the middle of a load data routine the connection data falls, the pool of jboss can restart the routine in the exactly point where stopped?

                              No , if the connection fails during the execution the application will stop executing and throw exception .
                              I am not sure if I understood your explanation properly :(

                              • 12. Re: org.jboss.resource.JBossResourceException: Could not cre
                                vickyk

                                 

                                =DriverManager.getConnection("jdbc:oracle:thin:@xx.x.x.xx:1521:Gd13","xxxx","xxxx");

                                Make sure the username/password used in the above code matches with what you have defined in the -ds.xml file .

                                • 13. Re: org.jboss.resource.JBossResourceException: Could not cre
                                  eduacsp2

                                   

                                  "vickyk" wrote:
                                  "eduacsp2" wrote:

                                  For example ... in the middle of a load data routine the connection data falls, the pool of jboss can restart the routine in the exactly point where stopped?

                                  No , if the connection fails during the execution the application will stop executing and throw exception .
                                  I am not sure if I understood your explanation properly :(


                                  So ...what is the advantage to use pool?

                                  • 14. Re: org.jboss.resource.JBossResourceException: Could not cre
                                    vickyk

                                     

                                    "eduacsp2" wrote:

                                    So ...what is the advantage to use pool?

                                    From the JCA specs
                                    "Connection pooling manages connections that are expensive to create and destroy.
                                    Connection pooling of expensive connections leads to better scalability and
                                    performance in an operational environment. The connection management contract
                                    provides support for connection pooling."




                                    1 2 Previous Next