All Forums Connectivity
sreevaddi 9 posts Joined 07/12
06 Nov 2012
Could not initialize class javax.crypto.SunJCE_b

 

Hi,

 

I am trying to connect to TeraData from R.

 

RStudio v0.96 (R v2.15.1)

JDBC v14.00.00.21

JDK v1.7.0_07

Mac v10.7.4

 

...

library(DBI)

library(RJDBC)

library(rJava)

jdrv <- JDBC(driverClass="com.teradata.jdbc.TeraDriver", classPath="/System/Library/Frameworks/ JavaVM.framework/Home/lib/jce.jar:terajdbc4.jar: tdgssconfig.jar")

conn = dbConnect(drv=jdrv,"jdbc:teradata://DBServer/ TMODE=ANSI,CHARSET=UTF8",user="user",password=" password",dbname="DBName")

....

I get the following error.

I tried without jce.jar in classpath and again with (see above).  Either way, I get the following error. any help ?!

 

 

Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1],  : 

  com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.00.00.21] [Error 1014] [SQLState HY000] TeraEncrypt: Error tdgss-stack-trace-begin>>> java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.SunJCE_b

at javax.crypto.KeyGenerator.a(DashoA13*..)

at javax.crypto.KeyGenerator.<init>(DashoA13*..)

at javax.crypto.KeyGenerator.getInstance(DashoA13*..)

at com.teradata.tdgss.jalgapi.AlgParcel.isKeySupported(Un known Source)

at com.teradata.tdgss.jalgapi.AlgParcel.getCipherSuitesPa rcel(Unknown Source)

at com.teradata.tdgss.jgssp2td2.Td2Context.BuildInitMsg(U nknown Source)

at com.teradata.tdgss.jgssp2td2.Td2Context.initSecContext (Unknown Source)

at com.teradata.tdgss.jtdgss.TdgssContext.initSecContext( Unknown Source)

at com.teradata.jdbc.jdbc.GenericTeraEncrypt.initSecConte xt(GenericTeraEncrypt.java:454)

at com.teradata.jdbc.jdbc.GenericLogonController.run(Gene ricLogonController.java:260)

at com.teradata.jdbc.jdbc_4.TDSession.<in

sreevaddi 9 posts Joined 07/12
06 Nov 2012

The correct version of jce.jar - /Library/Java/Home/lib/jce.jar:
Still, I see the same error.

tomnolan 594 posts Joined 01/08
07 Nov 2012

Googling "Could not initialize class javax.crypto.SunJCE_b" returns many results, with different suggestions for how to fix the problem. I recommend that you try some of the suggestions.

sreevaddi 9 posts Joined 07/12
07 Nov 2012

Thank you for your suggestion, Tom.
 
I had the, Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7.
http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
 
So, reverted back to the JCE that came default with installation. Fixed this issue.
 

sreevaddi 9 posts Joined 07/12
07 Nov 2012

Final steps:
> library(RJDBC)
> jdrv <- JDBC(driverClass="com.teradata.jdbc.TeraDriver", classPath="~/mydrivers/td/terajdbc4.jar:~/mydrivers/ td/tdgssconfig.jar")
> conn <- dbConnect(jdrv,"jdbc:teradata://TDServer/ TMODE=ANSI,CHARSET=UTF8,uid=tduser,pwd=passwd")

tomnolan 594 posts Joined 01/08
08 Nov 2012

That JDBC URL is not correct.
Beginning with Teradata JDBC Driver version 14.00.00.13, the USER and PASSWORD URL parameters are available, but there are no "uid" or "pwd" URL parameters.

You must sign in to leave a comment.