10 Replies Latest reply on Feb 15, 2012 11:02 AM by rareddy

    Remote JDBC Connection Error

      I have successfully deployed my virtual database but when I am trying to remotely connect through my jdbc connection it is not working and getting as null error (refer stack trace below). I also verfied with telnet ip adress with port and I am able to connect with the server so the port is not blocked by firewall.

       

      Please help

       

       

      General Properties

      Name:subcontract.1
      Version:1
      Description:Teiid Virtual Database (VDB)

      Traits

      Status: UP

      Errors: ** There are no errors reported for this VDB. **

       

       


      String url = "jdbc:teiid:subcontract@mm://<ip address>:31000";


       

      Class.forName("org.teiid.jdbc.TeiidDriver");



          Connection connection=null;

       

      connection = DriverManager.getConnection(url, "admin", "teiid");

       

      1 [SingleInstanceCommunicationException]

      2 [EOFException]

                at org.teiid.net.socket.SocketServerConnection.selectServerInstance(SocketServerConnection.java:162)

                at org.teiid.net.socket.SocketServerConnection.<init>(SocketServerConnection.java:94)

                at org.teiid.net.socket.SocketServerConnectionFactory.getConnection(SocketServerConnectionFactory.java:310)

                at org.teiid.jdbc.SocketProfile.createConnection(SocketProfile.java:104)

                at org.teiid.jdbc.SocketProfile.connect(SocketProfile.java:88)

                at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:87)

                at java.sql.DriverManager.getConnection(Unknown Source)

                at java.sql.DriverManager.getConnection(Unknown Source)

                at realtime.test.RealConnectionTest.execute(RealConnectionTest.java:41)

                at realtime.test.RealConnectionTest.main(RealConnectionTest.java:18)

      Caused by: [SingleInstanceCommunicationException]

      1 [EOFException]

                at org.teiid.net.socket.SocketServerInstanceImpl.exceptionOccurred(SocketServerInstanceImpl.java:199)

                at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:257)

                at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:347)

                at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler.invoke(SocketServerInstanceImpl.java:357)

                at $Proxy0.logon(Unknown Source)

                at org.teiid.net.socket.SocketServerConnection.selectServerInstance(SocketServerConnection.java:127)

                ... 9 more

      Caused by: java.io.EOFException

                at org.teiid.netty.handler.codec.serialization.ObjectDecoderInputStream.fillBuffer(ObjectDecoderInputStream.java:166)

                at org.teiid.netty.handler.codec.serialization.ObjectDecoderInputStream.findLength(ObjectDecoderInputStream.java:147)

                at org.teiid.netty.handler.codec.serialization.ObjectDecoderInputStream.readObjectOverride(ObjectDecoderInputStream.java:81)

                at java.io.ObjectInputStream.readObject(Unknown Source)

                at org.teiid.net.socket.OioOjbectChannelFactory$OioObjectChannel.read(OioOjbectChannelFactory.java:114)

                at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:253)

                ... 13 more

       

       

      org.teiid.jdbc.TeiidSQLException: Error establishing socket to host and port: :31000. Reason: null

                at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:109)

                at org.teiid.jdbc.SocketProfile.connect(SocketProfile.java:91)

                at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:87)

                at java.sql.DriverManager.getConnection(Unknown Source)

                at java.sql.DriverManager.getConnection(Unknown Source)

                at realtime.test.RealConnectionTest.execute(RealConnectionTest.java:41)

                at realtime.test.RealConnectionTest.main(RealConnectionTest.java:18)

      Caused by: [SingleInstanceCommunicationException]Error establishing socket to host and port: :31000. Reason: null

      1 [SingleInstanceCommunicationException]

      2 [EOFException]

                at org.teiid.net.socket.SocketServerConnection.selectServerInstance(SocketServerConnection.java:162)

                at org.teiid.net.socket.SocketServerConnection.<init>(SocketServerConnection.java:94)

                at org.teiid.net.socket.SocketServerConnectionFactory.getConnection(SocketServerConnectionFactory.java:310)

                at org.teiid.jdbc.SocketProfile.createConnection(SocketProfile.java:104)

                at org.teiid.jdbc.SocketProfile.connect(SocketProfile.java:88)

                ... 5 more

      Caused by: [SingleInstanceCommunicationException]

      1 [EOFException]

                at org.teiid.net.socket.SocketServerInstanceImpl.exceptionOccurred(SocketServerInstanceImpl.java:199)

                at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:257)

                at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:347)

                at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler.invoke(SocketServer

        • 1. Re: Remote JDBC Connection Error
          rareddy

          What version you are working with?

           

          Make sure you are working right client driver version with the server version. Are there any errors in server log?

           

          Ramesh..

          1 of 1 people found this helpful
          • 2. Re: Remote JDBC Connection Error

            I am using teiid-7.2.0.Final-client.jar in my eclpise jar classpath library and in the back end engine it shows 7.6.0 final

             

            18:07:02,082 INFO  [RUNTIME] Teiid JDBC =  mm://0.0.0.0:31000

            18:07:02,089 INFO  [RUNTIME] Teiid Admin mms://0.0.0.0:31443

            18:07:02,129 INFO  [RUNTIME] Teiid ODBC - SSL= OFF Host = 0.0.0.0 Port = 35432

            18:07:02,131 INFO  [RUNTIME] Teiid Engine 7.6.0.Final Started = Sun Feb 12 18:07:02 UTC 2012

            18:07:02,189 INFO  [RARDeployment] Required license terms exist, view vfszip:/opt/jboss-5.1.0.GA/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml

            18:07:02,200 INFO

            • 3. Re: Remote JDBC Connection Error
              rareddy

              The Server is 7.6, client is 7.2. Did you try with 7.6 Client? I know Teiid client libraries support backward compatibility, but not sure if there were any issues.

               

              Ramesh..

              • 4. Re: Remote JDBC Connection Error

                I have corrected both the version now client/server but now I am getting a different message now

                 

                org.teiid.jdbc.TeiidSQLException: The username "admin" and/or password and/or payload token could not be authenticated by any membership domain.

                • 5. Re: Remote JDBC Connection Error

                  My teiid connection is directloy connected to a web service. Now I am connected to a teiid server but I do not see any results in my schema. Do I need to convert this schema to relational schema using teiid designer? Can I query this data using XPath? Is there any reference tutorial for this?

                   

                        <searchcriteria>

                                      <searchcriterion field="Level of Detail" value="Complete"/>

                                      <searchcriterion field="Spending Category" value="Assistance"/>

                            </searchcriteria>

                      <data total_records="23849746" max_records="1000">

                                      <record detail="complete" description="transaction complete detail record" database="FAADS">

                              <receip_addr3></receip_addr3>

                               <recipient_city_code></recipient_city_code>

                                                <recipient_city_name></recipient_city_name>

                  </record>

                  • 6. Re: Remote JDBC Connection Error
                    rareddy

                    Try "user/user" as the user id and password. These are default, but you can add a specific user credetials as you want.

                     

                    Without knowing what you are trying to do, it is very hard to give you any advise what needs to be done.

                     

                    Ramesh..

                    • 7. Re: Remote JDBC Connection Error

                      I would like to query the following data from my teiid server. I do not see the below data in my teiid server through squirrel. There is only way to check this data by using XTABLE queries? Can I browse through squirrel?

                       

                       

                      <searchcriteria>

                                          <searchcriterion field="Level of Detail" value="Complete"/>

                                          <searchcriterion field="Spending Category" value="Assistance"/>

                                </searchcriteria>

                          <data total_records="23849746" max_records="1000">

                                          <record detail="complete" description="transaction complete detail record" database="FAADS">

                                  <receip_addr3></receip_addr3>

                                   <recipient_city_code></recipient_city_code>

                                                    <recipient_city_name></recipient_city_name>

                      </record>

                      • 8. Re: Remote JDBC Connection Error
                        rareddy

                        Sharad,

                         

                        I understand you want to query the Teiid Server. But what I am looking for is your usecase as to what the issue you are trying to solve, and how you think Teiid can help?

                         

                        1) How is the source data stored? is it relational data in database or XML data or a CSV file? what is is it, and how you are trying to transform it using Teiid?

                         

                        2) To access the data from client (like SquirreL), are you looking to expose the data using the JDBC interface with SQLXML? or do you want expose it using a web-service?

                         

                        My suggestion is go through Quick Start example first, learn how Teiid works and ask us specific questions.

                         

                        Some more examples here

                         

                        https://community.jboss.org/wiki/TextToTableWithTeiid

                         

                        https://community.jboss.org/wiki/ConvertXMLDataIntoRelationalTableDataUsingTeiid

                         

                        Thanks.

                         

                        Ramesh..

                        • 9. Re: Remote JDBC Connection Error

                          Ramesh

                           

                          As teiid diagram states that it is realtime data virtualization. Here is the business case what I am trying to do

                           

                          1. I have live web service xml for example weather or currency or stock exchange or anything else sitting on internet.

                          2. I have attached that web service successfully with teiid by looking or going through the weather example.

                          3. The service in return download an xml file which has the following data

                          <searchcriteria>

                                              <searchcriterion field="Level of Detail" value="Complete"/>

                                              <searchcriterion field="Spending Category" value="Assistance"/>

                                    </searchcriteria>

                              <data total_records="23849746" max_records="1000">

                                              <record detail="complete" description="transaction complete detail record" database="FAADS">

                                      <receip_addr3></receip_addr3>

                                       <recipient_city_code></recipient_city_code>

                                                        <recipient_city_name></recipient_city_name>

                          </record>

                          4. I can see the web service sucessfully up in teiid server

                           

                          Problem: I do not know how to see the data through squirrel or query this xml data.

                           

                          Let me know if you need more information

                           

                          Thanks

                          Sharad

                          • 10. Re: Remote JDBC Connection Error
                            rareddy

                            Sharad,

                             

                            Thanks, that sets the context as to what you are trying to do. Now, how do want to view the results? as XML or relational. My guess is relational as a table as XML would have been straight pass though call where Teiid is not contributing much to your solution. In that case take a look usage of XMLTABLE in Reference Guide, also here is another example converting XML to relational table.

                             

                            https://community.jboss.org/wiki/ConvertXMLDataIntoRelationalTableDataUsingTeiid

                             

                            For example you client code my look like this (if you are using dynamic VDB), or you can use Teiid Designer's XML importer.

                             

                            select t.* from 
                                (call weather.invokeHTTP(action => 'GET', endpoint =><endpoint>)) w, 
                                XMLTABLE('/record'  columns 
                                total_records string PATH 'data/@total_records', 
                                record_detail string PATH 'record/@detail',
                                recipient_city_name string PATH 'recipient_city_name',    
                               ) t
                            

                             

                             

                            Above what are saying is, invoking the web service and feeding the results to the XMLTABLE and creating a columns with defined XPATH expressions. Once you have this working, you can also create a view table using the Designer and use the above SQL as transformation, then user query can be simple as "select * from myrecord.."

                             

                            Hope this helps.

                             

                            Ramesh..