All Forums Connectivity
15 Jul 2013
Unable to connect to Teradta Express 13 via JDBC

Hi,
 
I just installed Teradata Express 13 VMWare instance. Everything installed and works fine, except I am unable to connect to the dbc database via a Teradata 13 JDBC driver. The URL supplied is:  "jdbc:teradata://localhost/ DBS_PORT=1025,DATABASE=dbc,CHARSET=UTF8".
Please advise?
 
Thanks... Vince
 

tomnolan 594 posts Joined 01/08
16 Jul 2013

What exception are you getting?

16 Jul 2013

Hi,
Yes... forgot the details... :)
 
I am using the JDBC jar file: terajdbc4.jar and on of the two driver entry points in the file: com.teradata.jdbc.TeraDriver version: 13.10.00.31.
 
The connection string is similar either specifying localhost or the VM's IP dependening if I am local (on the same VM using SQuirreL) or remote, Below is the available stack trace from SQuirreL:
 
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException
 at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
 at java.util.concurrent.FutureTask.get(Unknown Source)
 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:175)
 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
 ... 6 more
Caused by: java.lang.NullPointerException
 at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms(Unknown Source)
 at com.teradata.tdgss.jtdgss.TdgssManager.<init>(Unknown Source)
 at com.teradata.tdgss.jtdgss.TdgssManager.getInstance(Unknown Source)
 at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:623)
 at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(GenericTeraEncrypt.java:641)
 at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameForOid(GenericTeraEncrypt.java:734)
 at com.teradata.jdbc.AuthMechanism.<init>(AuthMechanism.java:50)
 at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:121)
 at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:209)
 at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:30)
 at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22)
 at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:130)
 at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:120)
 at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:220)
 at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:153)
 at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
 ... 8 more
 
And the stack trace from DB Visualizer:
 
An error occurred while establishing the connection:
Details:
   Type: java.lang.NullPointerException
Stack Trace:
java.lang.NullPointerException
   at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms(Unknown Source)
   at com.teradata.tdgss.jtdgss.TdgssManager.<init>(Unknown Source)
   at com.teradata.tdgss.jtdgss.TdgssManager.getInstance(Unknown Source)
   at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:623)
   at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(GenericTeraEncrypt.java:641)
   at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameForOid(GenericTeraEncrypt.java:734)
   at com.teradata.jdbc.AuthMechanism.<init>(AuthMechanism.java:50)
   at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:121)
   at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:209)
   at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:30)
   at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22)
   at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:130)
   at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:120)
   at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:220)
   at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:153)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.onseven.dbvis.g.B.D.ā(Z:1413)
   at com.onseven.dbvis.g.B.F$A.call(Z:1474)
   at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
 
Thx... Vince

 

tomnolan 594 posts Joined 01/08
16 Jul 2013

You are getting java.lang.NullPointerException at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms ...

We talk about this problem in the Troubleshooting section of the Teradata JDBC Driver User Guide, available here on Developer Exchange:
http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_5.html#CHDIJJJH

In short, you get that exception when tdgssconfig.jar is not available on your classpath, or not accessible due to permission restrictions.

You need both terajdbc4.jar and tdgssconfig.jar listed on your classpath.

16 Jul 2013

That was it. I am too biased by single JDBC Type-4 driver Jar files...
Thank you very much for your timely assistance!  
 
 

vasu6 12 posts Joined 10/12
19 Oct 2013

Hi Tomnolan,
Exacetely i am also getting same issue..Can you please help me on this ?.
Error log is :
16-Oct-2013 09:57:01IST Unable to create a connection using the jdbc:teradata://10.65.142.204/DATABASE=rts_dev,TMODE=ANSI,CHARSET=UTF16 URL with dbc username because of the following error: [Teradata JDBC Driver] [TeraJDBC 1
16-Oct-2013 09:57:01IST 4.00.00.00] [Error 1000] [SQLState 08S01] Login failure for Packet receive Wed Oct 16 09:57:01 IST 2013 socket orig=10.65.142.204 local=0.0.0.0/0.0.0.0:33409 remote=/10.65.142.204:1025 keepalive=unava
16-Oct-2013 09:57:01IST ilable nodelay=unavailable receive=unavailable send=unavailable linger=unavailable traffic=unavailable concurrent=3 contimeout=10000 conwait=1000 connecttime=6 connecttotaltime=8 connectattempts=1 con
16-Oct-2013 09:57:01IST nectfailures=0 failurecache={} cid=10fd7411 sess=20662 java.io.IOException: Incomplete LAN message header: read 0 bytes at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:659) at c
16-Oct-2013 09:57:01IST om.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:818) at com.teradata.jdbc.jdbc.GenericEncryptContextState.action(GenericEncryptContextState.java:119) at com.teradata.jdbc.jd
16-Oct-2013 09:57:01IST bc.GenericLogonController.run(GenericLogonController.java:120) at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:212) at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connecti
16-Oct-2013 09:57:01IST on.java:30) at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22) at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:130
16-Oct-2013 09:57:01IST ) at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:120) at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:220) at com.teradata.jdbc.TeraDriver.connect(Ter
16-Oct-2013 09:57:01IST aDriver.java:153) at java.sql.DriverManager.getConnection(DriverManager.java:579) at java.sql.DriverManager.getConnection(DriverManager.java:221) at com.applimation.jdbc.JdbcTemplateFactory$AMDataS
16-Oct-2013 09:57:01IST ource.createConnection(JdbcTemplateFactory.java:620) at com.applimation.jdbc.JdbcTemplateFactory$AMDataSource.getConnection(JdbcTemplateFactory.java:611) at com.applimation.jdbc.JdbcTemplateFactory.
16-Oct-2013 09:57:01IST createJdbcTemplate(JdbcTemplateFactory.java:421) at com.applimation.jdbc.JdbcTemplateFactory.createJdbcTemplate(JdbcTemplateFactory.java:487) at com.applimation.jdbc.JdbcTemplateFactory.getJdbcTempl
16-Oct-2013 09:57:01IST ateForStaging(JdbcTemplateFactory.java:515) at com.applimation.archive.dao.impl.AbstractArchiveEngineDAOImpl.getJdbcTemplateForStaging(AbstractArchiveEngineDAOImpl.java:244) at com.applimation.archi
16-Oct-2013 09:57:01IST ve.dao.impl.InsertIntoDestinationTableDAOImpl.copyTableToDestination(InsertIntoDestinationTableDAOImpl.java:167) at com.applimation.archive.services.thread.CopyToDestinationThread.run(CopyToDestinati
16-Oct-2013 09:57:01IST onThread.java:130) at com.applimation.services.thread.AMThreadQueueManager$AMThreadQueueElement.run(AMThreadQueueManager.java:503) at java.lang.Thread.run(Thread.java:722)
16-Oct-2013 09:57:01IST com.applimation.jdbc.JdbcTemplateFactory.createJdbcTemplate(JdbcTemplateFactory.java:446)
16-Oct-2013 09:57:01IST com.applimation.jdbc.JdbcTemplateFactory.createJdbcTemplate(JdbcTemplateFactory.java:487)
16-Oct-2013 09:57:01IST com.applimation.jdbc.JdbcTemplateFactory.getJdbcTemplateForStaging(JdbcTemplateFactory.java:515)
16-Oct-2013 09:57:01IST com.applimation.archive.dao.impl.AbstractArchiveEngineDAOImpl.getJdbcTemplateForStaging(AbstractArchiveEngineDAOImpl.java:244)
16-Oct-2013 09:57:01IST com.applimation.archive.dao.impl.InsertIntoDestinationTableDAOImpl.copyTableToDestination(InsertIntoDestinationTableDAOImpl.java:167)
16-Oct-2013 09:57:01IST com.applimation.archive.services.thread.CopyToDestinationThread.run(CopyToDestinationThread.java:130)
16-Oct-2013 09:57:01IST com.applimation.services.thread.AMThreadQueueManager$AMThreadQueueElement.run(AMThreadQueueManager.java:503)
16-Oct-2013 09:57:01IST java.lang.Thread.run(Thread.java:722)
Any idea or can you please let me know what is the issue on this ? either Driver issue ?  N/w Issue ?  oR Teradata DB Issue ?  
Plesae let me know what is the exactely issue here ?

Thanks,
Vasudeva Rao

tomnolan 594 posts Joined 01/08
21 Oct 2013

Are you running your program on Linux? If the "Incomplete LAN message header: read 0 bytes" error occurs when running on a Linux machine,
then the most likely cause is the "Slow Logon on Linux" problem.
 
The problem, and workarounds, are documented in the Teradata JDBC Driver User Guide here on Developer Exchange:
http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_5.html#CHDDACIH

mcetraro 2 posts Joined 04/13
16 Nov 2013

I am facing a similar problem too. I am connected to the Aster Database located in San Carlos, CA.  I am using Teradata Studio as the client application.  I don't have any problem to connect to the database “toysrus” and see all the tables that I need.  My problem is that I can't perform any SQL command... I get the error message "java.lang.NullPointerException".  Base on the information provided the problem should be resolved if I add an environment variable "classpath" pointing to the files "terajdbc4.jar" and "terajdbc4.jar".   I have done this but still I have the same issue.  Where should I look for these files to make sure that I have them? Thanks you for any help.
 

Marco

tomnolan 594 posts Joined 01/08
18 Nov 2013

Marco, you probably have a different problem that the one discussed in this forum thread. The Teradata JDBC Driver is used to connect to the Teradata Database, not the Aster Database.
 
You must use the Aster JDBC Driver to connect to the Aster Database. Teradata Studio 14.10.01 (the latest release) includes the Aster JDBC Driver version 5.10.

vasu6 12 posts Joined 10/12
19 Dec 2013

Hi Tomnolan,
JDBC application is running on windows.And Teradata Database is running on Linux  AND WINDOWS.Can you please help me on this ? 

Thanks,
Vasudeva Rao

tomnolan 594 posts Joined 01/08
19 Dec 2013

If your Java application is running on Windows and you receive an error message "Incomplete LAN message header", then you have a different problem than the "Slow Logon on Linux" problem.
 
That is too complicated to troubleshoot in a forum. If you're a customer, open an incident with Teradata Customer Support.

vasu6 12 posts Joined 10/12
19 Dec 2013

Hi Tomnolan,
I have raised a SR with Teradata..But those guys are also giving same solution for this . (THey are thinking this is happend on linux)..But i am facing this issue first on windows (TD is running on Windows  and Application also running on windows) .After that my developers are tryied on Linux TD Server...But no luck..Same error getting on both Linux & Windows.
FYI... Error msg is : 
[Error 1000] [SQLState 08S01] Login failure for Packet transmit Fri Sep 20 15:21:18 IST 2013 socket orig=in23td1310.informatica.com local=/10.65.140.38:58551 remote=in23td1310.informatica.com/10.65.4 
20-Sep-2013 15:21:18IST  3.62:1025 keepalive=false nodelay=false receive=65156 send=65156 linger=10 traffic=0 concurrent=3 contimeout=10000 conwait=1000 connecttime=0 connecttotaltime=1 connectattempts=1 connectfailures=0 fai 
20-Sep-2013 15:21:18IST  lurecache={} cid=878153 sess=154546 java.net.SocketException: Connection reset at
Just I got some info from google on this error :  Pls check following information :

Teradata Session Reconnect
A Java application uses a JDBC java.sql.Connection object to interact with a Teradata Database session. The JDBC connection can be disconnected from the Teradata Database session in various ways outside the control of the Teradata JDBC Driver, such as:

  • a network cable being unplugged
  • a network communication failure
  • an administrator terminating the session with the Monitor partition command Abort Session
  • an administrator terminating the session with the Gateway command Kill Session
  • a Teradata Database restart

Note:  The Teradata Database only permits reconnecting to a session if the communication failure was due to a Teradata Database restart. The Teradata Database will reject a reconnect attempt after a communication failure due to any other reason.
When a communication failure occurs, the Teradata JDBC Driver's default behavior is to close the JDBC connection and throw a SQLException with SQLState 08S01.
Teradata Session Reconnect is available beginning with Teradata JDBC Driver version 13.10.00.24. When Teradata Session Reconnect is enabled, the Teradata JDBC Driver will attempt to reconnect the JDBC connection to the Teradata Database session after a communication failure. Teradata Session Reconnect is enabled by specifying one or both of the following connection parameters:

  • RECONNECT_COUNT=number (if omitted, the default is 11 attempts)
  • RECONNECT_INTERVAL=seconds (if omitted, the default is 30 seconds)

The maximum possible elapsed time for reconnect attempts is:
    (ReconnectCount - 1) * ReconnectInterval
When both connection parameters are omitted, Teradata Session Reconnect is disabled, and the Teradata JDBC Driver will close the JDBC connection when a communication failure occurs.
When a communication failure occurs, regardless of whether Teradata Session Reconnect is enabled, the operation in progress always fails and a SQLException is thrown. When Teradata Session Reconnect is enabled, and the Teradata JDBC Driver attempts to reconnect, the SQLException will have one of the following error codes to indicate the outcome of the reconnect attempt:

  • 1278 - Reconnected to the Teradata Database after a communication failure.
  • 1279 - Reconnected to the Teradata Database after a communication failure. A failure occurred after reconnecting to the Teradata Database.
  • 1280 - Unable to reconnect to the Teradata Database.

Reconnect is never attempted if a communication failure occurs while a JDBC connection is being closed.
The Teradata Database enforces a limited time period for reconnecting to a session after a Teradata Database restart. The amount of time is set using the Teradata Database utility program "gtwcontrol". The standard value is 20 minutes. The Teradata Database will reject all reconnect attempts after the time period expires.
When a Teradata Database restart occurs, a significant part of each session's state is discarded.

  • The current transaction is rolled back.
  • All open result sets are discarded.
  • All open BLOB and CLOB values are discarded.
  • All volatile tables are discarded.
  • All materialized global temp tables are discarded.

Applications that use Teradata Session Reconnect must be designed to accommodate the possible loss of session state at any point in time. Because of the limitations of Teradata Session Reconnect, it is not recommended for use with JDBC connection pools.
 
Please cehck above info and guide me on this ?
Thanks alot 
 

Thanks,
Vasudeva Rao

tomnolan 594 posts Joined 01/08
20 Dec 2013

I'm not sure why you copy-and-pasted all that documentation from the Teradata JDBC Driver User Guide. Yes, I'm familiar with all that documentation, because I wrote it.
 
You now said that you got "SocketException: Connection reset". That is different from "IOException: Incomplete LAN message header: read 0 bytes".
 
As I mentioned earlier, this kind of issue is too complex to troubleshoot in a forum thread. Now that you've opened an incident, please work with Teradata Customer Service.
 

You must sign in to leave a comment.