Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Not able to to connect Oracle Database through jndi

    I had downloaded the SmartClient software and not able to create the Oracle Connection through jndi

    Please find attached the error for the reference.

    Can anybody help me on the same
    Attached Files

    #2
    Well, the error message is pretty straightforward: the JNDI name you provided does not appear to be correct.

    Note that that field is a drop-down and shows you options that we auto-detect; try each available option.

    If you still can't get it working, check the server logs for details of how the connection failed, and post it here if you need further help.

    Comment


      #3
      I am edited the server.properties files as below for JNDI connection :

      # -------------- SAMPLE JNDI SETTINGS ------------------
      # This is the minimal set of properties needed to define a SmartClient/SmartGWT
      # database connection to a JNDI resource. These sample properties assume an
      # Oracle JNDI resource with the name "jndiTest" - such a resource would be
      # configured similar to this in Tomcat:
      #
      <Resource name="jdbc/jndiTest"
      auth="Container"
      type="javax.sql.DataSource"
      driverClassName="oracle.jdbc.driver.OracleDriver"
      url="jdbc:oracle:thin:@192.168.0.18:1521:AILDB"
      username="erp"
      password="erp"
      initialSize="5"
      maxActive="50" />

      # (Note that the java:comp/env/ prelude in this line is optional - SC/SGWT Server will
      # automatically look there if it can't find the resource in the absolute location)
      sql.mydb.driver.name: java:comp/env/jdbc/jndiTest
      sql.mydb.database.type: oracle
      sql.mydb.interface.type: jndi
      ------------------------------------------------------------------------------

      And trying to connect the through mydb in database JNDI connection.

      And here is the server log

      -----------------------------------------------------------------------------------
      appID:"isc_builtin",
      className:"com.isomorphic.tools.AdminConsole",
      methodName:"testDB",
      arguments:[
      "mydb",
      {
      driver_name:"java:comp/env/jdbc/jndiTest",
      interface_type:"jndi",
      database_type:"oracle",
      dbName:"mydb",
      dbStatus:"Unable to connect",
      _selection_10:true,
      driver_context:"",
      driver_serverName:"localhost",
      interface_credentialsInURL:true,
      driver_networkProtocol:"tcp",
      driver_password:null
      }
      ],
      is_ISC_RPC_DMI:true
      }
      === 2016-05-28 06:39:04,921 [80-6] INFO BuiltinRPC - testing db 'mydb' with config: {
      "driver.name":"java:comp/env/jdbc/jndiTest",
      "interface.type":"jndi",
      "driver.networkProtocol":"tcp",
      "driver.context":"",
      "database.type":"oracle",
      "interface.credentialsInURL":true,
      "driver.serverName":"localhost"
      }
      === 2016-05-28 06:39:04,921 [80-6] DEBUG BuiltinRPC - Testing DB connection for database: mydb with config: {
      "driver.name":"java:comp/env/jdbc/jndiTest",
      "interface.type":"jndi",
      "driver.networkProtocol":"tcp",
      "driver.context":"",
      "database.type":"oracle",
      "interface.credentialsInURL":true,
      "driver.serverName":"localhost"
      }
      === 2016-05-28 06:39:04,922 [80-6] DEBUG PoolableSQLConnectionFactory - Initializing SQL config for 'mydb' via JNDI
      === 2016-05-28 06:39:04,922 [80-6] INFO BuiltinRPC - testDB (mydb) error: javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
      === 2016-05-28 06:39:04,922 [80-6] DEBUG RPCDMI - rpc returned RPCResponse
      === 2016-05-28 06:39:04,922 [80-6] WARN RequestContext - Content type has already been set to: text/html - setting to: text/plain; charset=UTF-8
      === 2016-05-28 06:39:04,922 [80-6] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
      === 2016-05-28 06:39:04,923 [80-6] INFO Compression - /tools/adminConsoleOperations.jsp: 192 -> 168 bytes
      ---------------------------------------------------------------------------------------------------------------------------


      Can you help me out for the same

      Here is my server settings through which I am connecting the database

      Server IP : 192.168.0.18 :1521

      SID : AILDB

      And using Oracle Database.

      I had trying to connec through JDBC, but connection area shows that JDBC driver is not installed.

      If you also help me on that also, then It will be great for me.

      Thanks for your precious time & support for the same.

      Comment


        #4
        Can you help on above. As we are right now testing the SmartClient. If we found that we can use with Oracle for our in-house ERP Up-gradation then we will purchase the same for our development tools.

        Comment


          #5
          Hi SACHINBARAD,

          well, you obviously need a driver to have JDBC connect to Oracle, independent of using JNDI or not.
          The driver is called and either goes to your war\WEB-INF\lib (will become WEB-INF\lib when deployed) if you run only one application accessing Oracle on your server or your server's lib directory. For Tomcat, this is ojdbc6.jar, available from the Oracle OTN. Watch that you get the correct one for your DB version.

          Best regards
          Blama

          Comment


            #6
            Thanks Blama for your valuable reply on my query.

            Is there any other settings is require for setup of ojdbc6.jar with SmartClient. Or just put the proper file in the \WEB-INF\lib directory.

            Can you give me step to do these.

            Regards,
            Sachin

            Comment


              #7
              IMHO only the file - and the DB configuration in server.properties of course. I don't use JNDI and for me it is this for Oracle 11.2:
              Code:
              sql.defaultDatabase: Oracle
              sql.useAnsiJoins: true
              
              sql.Oracle.database.type: oracle
              sql.Oracle.autoJoinTransactions: true
              sql.Oracle.database.supportsSQLLimit: false
              
              sql.Oracle.interface.credentialsInURL: true
              sql.Oracle.interface.type: dataSource
              
              sql.Oracle.driver: oracle.jdbc.pool.OracleDataSource
              sql.Oracle.driver.serverName: localhost
              sql.Oracle.driver.portNumber: 1521
              sql.Oracle.driver.databaseName: REMOVED
              sql.Oracle.driver.user: REMOVED
              sql.Oracle.driver.password: REMOVED
              
              sql.Oracle.driver.driverType: thin
              sql.Oracle.driver.networkProtocol: tcp
              sql.Oracle.driver.context:
              Best regards
              Blama

              Comment


                #8
                Hi Administrator @ Isomorphic

                I am edited the server.properties files as below for JNDI connection :

                # -------------- SAMPLE JNDI SETTINGS ------------------
                # This is the minimal set of properties needed to define a SmartClient/SmartGWT
                # database connection to a JNDI resource. These sample properties assume an
                # Oracle JNDI resource with the name "jndiTest" - such a resource would be
                # configured similar to this in Tomcat:
                #
                <Resource name="jdbc/jndiTest"
                auth="Container"
                type="javax.sql.DataSource"
                driverClassName="oracle.jdbc.driver.OracleDriver"
                url="jdbc:oracle:thin:@192.168.0.18:1521:AILDB"
                username="erp"
                password="erp"
                initialSize="5"
                maxActive="50" />

                # (Note that the java:comp/env/ prelude in this line is optional - SC/SGWT Server will
                # automatically look there if it can't find the resource in the absolute location)
                sql.mydb.driver.name: java:comp/env/jdbc/jndiTest
                sql.mydb.database.type: oracle
                sql.mydb.interface.type: jndi
                ------------------------------------------------------------------------------

                And trying to connect the through mydb in database JNDI connection.

                And here is the server log

                -----------------------------------------------------------------------------------
                appID:"isc_builtin",
                className:"com.isomorphic.tools.AdminConsole",
                methodName:"testDB",
                arguments:[
                "mydb",
                {
                driver_name:"java:comp/env/jdbc/jndiTest",
                interface_type:"jndi",
                database_type:"oracle",
                dbName:"mydb",
                dbStatus:"Unable to connect",
                _selection_10:true,
                driver_context:"",
                driver_serverName:"localhost",
                interface_credentialsInURL:true,
                driver_networkProtocol:"tcp",
                driver_password:null
                }
                ],
                is_ISC_RPC_DMI:true
                }
                === 2016-05-28 06:39:04,921 [80-6] INFO BuiltinRPC - testing db 'mydb' with config: {
                "driver.name":"java:comp/env/jdbc/jndiTest",
                "interface.type":"jndi",
                "driver.networkProtocol":"tcp",
                "driver.context":"",
                "database.type":"oracle",
                "interface.credentialsInURL":true,
                "driver.serverName":"localhost"
                }
                === 2016-05-28 06:39:04,921 [80-6] DEBUG BuiltinRPC - Testing DB connection for database: mydb with config: {
                "driver.name":"java:comp/env/jdbc/jndiTest",
                "interface.type":"jndi",
                "driver.networkProtocol":"tcp",
                "driver.context":"",
                "database.type":"oracle",
                "interface.credentialsInURL":true,
                "driver.serverName":"localhost"
                }
                === 2016-05-28 06:39:04,922 [80-6] DEBUG PoolableSQLConnectionFactory - Initializing SQL config for 'mydb' via JNDI
                === 2016-05-28 06:39:04,922 [80-6] INFO BuiltinRPC - testDB (mydb) error: javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
                === 2016-05-28 06:39:04,922 [80-6] DEBUG RPCDMI - rpc returned RPCResponse
                === 2016-05-28 06:39:04,922 [80-6] WARN RequestContext - Content type has already been set to: text/html - setting to: text/plain; charset=UTF-8
                === 2016-05-28 06:39:04,922 [80-6] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
                === 2016-05-28 06:39:04,923 [80-6] INFO Compression - /tools/adminConsoleOperations.jsp: 192 -> 168 bytes
                ---------------------------------------------------------------------------------------------------------------------------


                Can you help me out for the same

                Here is my server settings through which I am connecting the database

                Server IP : 192.168.0.18 :1521

                SID : AILDB

                And using Oracle Database.

                I had trying to connec through JDBC, but connection area shows that JDBC driver is not installed.

                If you also help me on that also, then It will be great for me.

                Thanks for your precious time & support for the same.

                Comment


                  #9
                  Once again Thanks Blama for your valuable reply on my query.

                  Let me try and revert you the status on the same.

                  Regards,
                  Sachin

                  Comment


                    #10
                    Use any of several thousand tutorials available on the web to set up a working JNDI or JDBC connection and test it.

                    Then return to SmartGWT and everything will immediately work.

                    Comment

                    Working...
                    X