11 Replies Latest reply on Nov 9, 2011 2:30 AM by pilhuhn

    Problem connecting with oracle (jopr) : ojdbc14.jar

    caio.cesar

      Hi!

      When I try to connect my JOPR with ORACLE DATABASE, it gives me the exception:

      java.sql.SQLException: No suitable found for jdbc:oracle:thin:@databaserever:1521:database/

      2008-11-14 15:31:01,864 WARN [org.rhq.enterprise.installer.ConfigurationBean] Installer failed to test connection
      java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@SERVER:1521:DATABASE/
       at java.sql.DriverManager.getConnection(DriverManager.java:602)
       at java.sql.DriverManager.getConnection(DriverManager.java:185)
       at org.rhq.core.db.DbUtil.getConnection(DbUtil.java:60)
       at org.rhq.enterprise.installer.ServerInformation.getDatabaseConnection(ServerInformation.java:583)
       at org.rhq.enterprise.installer.ConfigurationBean.testConnection(ConfigurationBean.java:290)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
       at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
       at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
       at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
       at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
       at javax.faces.component.UICommand.broadcast(UICommand.java:387)
       at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:458)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:763)
       at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.rhq.helpers.rtfilter.filter.RtFilter.doFilter(RtFilter.java:113)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       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:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       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:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      
      I've already have ojdbc14.jar, it's in:
      
      /srv/jopr-server-2.1.0.GA/jbossas/lib
      
      Do anyone knows why this is happening??
      Thank you!!
      


        • 1. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
          caio.cesar

          ps.: my database is Oracle10g.

          • 2. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
            mazz

            double check the value you gave the installer for the database driver. Should be:

            oracle.jdbc.driver.OracleDriver

            In addition, that JDBC URL looks odd with the "/" at the end. I think the JDBC URL should be:

            jdbc:oracle:thin:@databaserever:1521:database

            where your SID is "database", not "database/"

            • 3. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
              caio.cesar

              yes, it was already as :

              oracle.jdbc.driver.OracleDriver

              I tried without the " / " at the end...

              No success...

              • 4. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
                caio.cesar

                log:

                2008-11-14 16:16:44,486 INFO [org.rhq.enterprise.installer.ConfigurationBean] Could not determine database existence: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@192.168.37.46:1521:desenv
                2008-11-14 16:16:44,488 WARN [org.rhq.core.db.DatabaseTypeFactory] {DatabaseTypeFactory.cannot-load-jdbc-driver}Cannot load the JDBC driver [oracle.jdbc.driver.OracleDriver] for JDBC URL [jdbc:oracle:thin:@192.168.37.46:1521:desenv] - connecting to your database will probably fail.
                2008-11-14 16:16:44,488 WARN [org.rhq.enterprise.installer.ConfigurationBean] Installer failed to test connection
                java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@192.168.37.46:1521:desenv
                 at java.sql.DriverManager.getConnection(DriverManager.java:602)
                 at java.sql.DriverManager.getConnection(DriverManager.java:185)
                 at org.rhq.core.db.DbUtil.getConnection(DbUtil.java:60)
                 at org.rhq.enterprise.installer.ServerInformation.getDatabaseConnection(ServerInformation.java:583)
                 at org.rhq.enterprise.installer.ConfigurationBean.testConnection(ConfigurationBean.java:290)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
                 at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                 at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
                 at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
                 at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
                 at javax.faces.component.UICommand.broadcast(UICommand.java:387)
                 at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:458)
                 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:763)
                 at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
                 at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                 at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.rhq.helpers.rtfilter.filter.RtFilter.doFilter(RtFilter.java:113)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 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:128)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                 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:241)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                 at java.lang.Thread.run(Thread.java:619)
                


                • 5. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
                  ips

                  Try moving the ojdbc.jar to /srv/jopr-server-2.1.0.GA/jbossas/server/default/lib/, rather than /srv/jopr-server-2.1.0.GA/jbossas/lib/. server/default/lib/ is where we place JDBC driver jars.

                  • 6. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
                    mazz

                    There's really on two reasons why this would happen:

                    1) The driver class is not in the classpath.

                    But we know that is not the case - the oracle .jar is in the JBossAS lib/ directory.

                    2) The connection url is incorrect

                    The URL seems to look correct.

                    Therefore, I have no idea why you are seeing this :-/

                    Can you post exactly what the values are you specified in the installer entry fields for the database settings (cut-n-paste into a post)? Specifically:

                    a) Database Type
                    b) Database Connection URL
                    c) Database JDBC Driver Class

                    • 7. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
                      mazz

                      oh, wait - ips - don't we ship that out-of-box? I thought we did therefore I assume it was in the correct place.

                      If not, then yes, ips is correct - make sure you put that jdbc driver in the proper place. :)

                      • 8. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
                        mazz

                        OK, ignore everything I said so far :)

                        ips is right.

                        Out of the box, our binary distribution does not include the Oracle JDBC driver (due to licensing restrictions attached to the Oracle JDBC driver .jar, we are unable to do so).

                        So, the problem is you just put your copy of the Oracle JDBC driver .jar in the wrong spot.

                        Put it in that <jopr-install-dir>/jbossas/server/default/lib location and it should work (you will find the postgres jdbc driver in there - we DO ship that out of box since it does not have the same licensing restrictions as the oracle .jar does)

                        • 9. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
                          caio.cesar

                          It's working now!

                          1344 /srv/jopr-server-2.1.0.GA/load_jopr.sh stop
                          1345 jps
                          1346 /srv/jopr-server-2.1.0.GA/load_jopr.sh status
                          1347 ll
                          1348 mv ojdbc14.jar /srv/jopr-server-2.1.0.GA/jbossas/server/default/lib/
                          1349 cd /srv/jopr-server-2.1.0.GA/jbossas/server/default/lib/
                          1350 ll
                          1351 ls
                          1352 /srv/jopr-server-2.1.0.GA/load_jopr.sh start
                          1353 /srv/jopr-server-2.1.0.GA/load_jopr.sh status

                          /srv/jopr-server-2.1.0.GA/jbossas/server/default/lib/ Is the correct place for the ojdbc14 driver...

                          tks!!!!!

                          • 10. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
                            salecha.rohit

                            Hi , i too was getitng the same error for ojdbc14. However my dpeloyment is successfull , but when i try to login to my website using spring security , it throws an error saying

                             

                             

                            Your login attempt was not successful. Reason: Could not get JDBC Connection; nested exception is java.sql.SQLException: No suitable driver found for jdbc\:oracle\:thin\:@172.16.147.143\:1521\:xe .

                             

                            However , all my tables are getting created and and all the url mappings are successful. Deployment is a Success. but it  gives me this error. i dontknow why please help.

                            All works fine with Tomcat.

                            I am using hibernate 3

                            • 11. Re: Problem connecting with oracle (jopr) : ojdbc14.jar
                              pilhuhn

                              First of all, jopr is pretty old and superseeded by RHQ.

                              Then I can imagine that all those backslashes you show may irritate the driver loader.