0 Replies Latest reply on Oct 8, 2008 3:16 PM by Vince Cooper

    JBOSS / Oracle 10g RAC

    Vince Cooper Newbie

      We have recently installed Oracle 10g RAC. I am having some issues getting connected to the database. We are trying to use the container pool out of JBoss 4.2.2. My DS file contains this connect string:

      <datasources>
       <local-tx-datasource>
       <jndi-name>jdbc/default</jndi-name>
       <use-java-context>false</use-java-context>
       <connection-url> jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS_LIST=(ADDRESS=((PROTOCOL=TCP)(HOST=rac1-vip.mycompany.com)(PORT=1523))ADDRESS=((PROTOCOL=TCP)(HOST=rac2-vip.mycompany.com)(PORT=1523)))(CONNECT_DATA=(SERVICE_NAME=DEV.mycompany.com)(SERVER=DEDICATED)))</connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>myusername</user-name>
       <password>myuserpassword</password>
       <min-pool-size>5</min-pool-size>
       <max-pool-size>20</max-pool-size>
       <idle-timeout-minutes>5</idle-timeout-minutes>
       <new-connection-sql>select * from dual</new-connection-sql>
       <check-valid-connection-sql>select * from dual</check-valid-connection-sql>
       </local-tx-datasource>
      </datasources>


      I receive the following error immediately upon trying to get any connection.
      
      10:55:41,089 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: NL Exception was generated)
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
       at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
       at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       at com.mycompany.lowroad.JDBCPool.getConnection(Unknown Source)
       at com.mycompany.lowroad.JDBCPool.getConnection(Unknown Source)
       at com.mycompany.lowroad.DataObjectBase.getConnection(Unknown Source)
       at com.mycompany.aces.lowroad.nugget.AccountActionNugget.findByAccountNumberInternal(AccountActionNugget.java:72)
       at com.mycompany.aces.lowroad.nugget.AccountActionNugget.findByAccountNumber(AccountActionNugget.java:48)
       at com.mycompany.aces.salmon.AcesJspController.refreshAuthorizedActionSet(AcesJspController.java:278)
       at com.mycompany.aces.salmon.account.ManageAccountController.pageRequested(ManageAccountController.java:222)
       at com.salmonllc.html.HtmlPage.notifyListeners(HtmlPage.java:1145)
       at com.salmonllc.jsp.JspController.notifyListeners(JspController.java:981)
       at com.salmonllc.jsp.JspController.doGet(JspController.java:573)
       at com.salmonllc.jsp.tags.PageTag.doStartTag(PageTag.java:215)
       at org.apache.jsp.jsp.account.manageaccount_jsp._jspx_meth_salmon_005fpage_005f0(manageaccount_jsp.java:130)
       at org.apache.jsp.jsp.account.manageaccount_jsp._jspService(manageaccount_jsp.java:64)
       at com.salmonllc.jsp.JspServlet.service(JspServlet.java:313)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:595)


      The code that should be getting the connection looks like this:

       public Connection getConnection() throws SQLException
       {
       try
       {
       Context initCtx = new InitialContext();
       DataSource ds = (DataSource) initCtx.lookup("jdbc/default");
       Connection conn = ds.getConnection();
       return conn;
       }
       catch (Exception e)
       {
       if (e instanceof SQLException) throw ((SQLException)e);
       else throw new SQLException("Unable to find data source: "+e.getMessage());
       }
       }
      


      Has anyone else experienced this type of problem in getting connected to Oracle 10g RAC? I've googled this and received several hits, none of which seem to offer any sort of solution.

      Thanks!
      -Vince