Problem connecting to AWS Athena

Four Stars

Problem connecting to AWS Athena

I am trying to connect to AWS Athena through a JDBC connection. I am using Open Studio for Big Data 7.0.1 with AthenaJDBC41_2.0.6.jar

I created my Db Connection a when I run a 'test connection', all is well.

When I try to test my connection in a Job, I am getting this error. 

Anybody ran into something like this

 

Starting job Athena at 09:51 08/02/2019.

[statistics] connecting to socket on port 3599

[statistics] connected

log4j:ERROR Could not create an Appender. Reported error follows.

java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to com.simba.athena.shaded.apache.log4j.Appender

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1004)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778)

at com.simba.athena.shaded.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)

at com.simba.athena.shaded.apache.log4j.LogManager.<clinit>(LogManager.java:127)

at com.simba.athena.shaded.apache.log4j.Logger.getLogger(Logger.java:104)

at com.simba.athena.shaded.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:262)

at com.simba.athena.shaded.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:108)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1025)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:844)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269)

at com.simba.athena.shaded.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)

at com.simba.athena.amazonaws.util.VersionInfoUtils.<clinit>(VersionInfoUtils.java:47)

at com.simba.athena.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:70)

at com.simba.athena.athena.core.AJSettings.<init>(Unknown Source)

at com.simba.athena.athena.core.AJConnection.connect(Unknown Source)

at com.simba.athena.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)

at com.simba.athena.jdbc.common.AbstractDriver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(DriverManager.java:664)

at java.sql.DriverManager.getConnection(DriverManager.java:247)

at org.talend.components.jdbc.runtime.JdbcRuntimeUtils.createConnection(JdbcRuntimeUtils.java:64)

at org.talend.components.jdbc.runtime.JdbcRuntimeUtils.createConnectionOrGetFromSharedConnectionPoolOrDataSource(JdbcRuntimeUtils.java:193)

at org.talend.components.jdbc.runtime.JDBCSourceOrSink.connect(JDBCSourceOrSink.java:217)

at org.talend.components.jdbc.runtime.setting.JdbcRuntimeSourceOrSinkDefault.initConnection(JdbcRuntimeSourceOrSinkDefault.java:46)

at org.talend.components.jdbc.runtime.JdbcRuntimeUtils.validate(JdbcRuntimeUtils.java:88)

at org.talend.components.jdbc.runtime.JDBCSourceOrSink.validate(JDBCSourceOrSink.java:121)

at new_20181031.athena_0_1.Athena.tDBConnection_1Process(Athena.java:446)

at new_20181031.athena_0_1.Athena$4.run(Athena.java:776)

log4j:ERROR Could not create an Appender. Reported error follows.

java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to com.simba.athena.shaded.apache.log4j.Appender

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1006)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872)

at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778)

at com.simba.athena.shaded.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)

at com.simba.athena.shaded.apache.log4j.LogManager.<clinit>(LogManager.java:127)

at com.simba.athena.shaded.apache.log4j.Logger.getLogger(Logger.java:104)

at com.simba.athena.shaded.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:262)

at com.simba.athena.shaded.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:108)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1025)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:844)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)

at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269)

at com.simba.athena.shaded.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)

at com.simba.athena.amazonaws.util.VersionInfoUtils.<clinit>(VersionInfoUtils.java:47)

at com.simba.athena.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:70)

at com.simba.athena.athena.core.AJSettings.<init>(Unknown Source)

at com.simba.athena.athena.core.AJConnection.connect(Unknown Source)

at com.simba.athena.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)

at com.simba.athena.jdbc.common.AbstractDriver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(DriverManager.java:664)

at java.sql.DriverManager.getConnection(DriverManager.java:247)

at org.talend.components.jdbc.runtime.JdbcRuntimeUtils.createConnection(JdbcRuntimeUtils.java:64)

at org.talend.components.jdbc.runtime.JdbcRuntimeUtils.createConnectionOrGetFromSharedConnectionPoolOrDataSource(JdbcRuntimeUtils.java:193)

at org.talend.components.jdbc.runtime.JDBCSourceOrSink.connect(JDBCSourceOrSink.java:217)

at org.talend.components.jdbc.runtime.setting.JdbcRuntimeSourceOrSinkDefault.initConnection(JdbcRuntimeSourceOrSinkDefault.java:46)

at org.talend.components.jdbc.runtime.JdbcRuntimeUtils.validate(JdbcRuntimeUtils.java:88)

at org.talend.components.jdbc.runtime.JDBCSourceOrSink.validate(JDBCSourceOrSink.java:121)

at new_20181031.athena_0_1.Athena.tDBConnection_1Process(Athena.java:446)

at new_20181031.athena_0_1.Athena$4.run(Athena.java:776)

[statistics] disconnected

Job Athena ended at 09:51 08/02/2019. [exit code=0]

Moderator

Re: Problem connecting to AWS Athena

Hello,

The tJDBCConnection component is  configured to use "AthenaJDBC42_2.0.5.jar" that contains log4j which is conflicting with the one used by the Job.

Could you please try to configure tJDBCConnection to use "AthenaJDBC41-1.1.0.jar" and adjust driver class name to be "com.amazonaws.athena.jdbc.AthenaDriver"?

Feel free to let us know if it doesn't work for you.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Two Stars

Re: Problem connecting to AWS Athena

I am also getting the same error.

 

Tried switching to AthenaJDBC41-1.1.0.jar and adjusting the driver class but the error still  appears. Error is listed below.

 

Any other possible solutions?

 

Thanks

 

log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to com.simba.athena.shaded.apache.log4j.Appender
at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248)
at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)
at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1004)
at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872)
at com.simba.athena.shaded.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778)
at com.simba.athena.shaded.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
at com.simba.athena.shaded.apache.log4j.LogManager.<clinit>(LogManager.java:127)
at com.simba.athena.shaded.apache.log4j.Logger.getLogger(Logger.java:104)
at com.simba.athena.shaded.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:262)
at com.simba.athena.shaded.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:108)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1025)
at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:844)
at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541)
at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)
at com.simba.athena.shaded.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269)
at com.simba.athena.shaded.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
at com.simba.athena.amazonaws.util.VersionInfoUtils.<clinit>(VersionInfoUtils.java:47)
at com.simba.athena.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:70)
at com.simba.athena.athena.core.AJSettings.<init>(Unknown Source)
at com.simba.athena.athena.core.AJConnection.connect(Unknown Source)
at com.simba.athena.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
at com.simba.athena.jdbc.common.AbstractDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.talend.components.jdbc.runtime.JdbcRuntimeUtils.createConnection(JdbcRuntimeUtils.java:65)
at org.talend.components.jdbc.runtime.JdbcRuntimeUtils.createConnectionOrGetFromSharedConnectionPoolOrDataSource(JdbcRuntimeUtils.java:194)
at org.talend.components.jdbc.runtime.JDBCSourceOrSink.connect(JDBCSourceOrSink.java:217)
at org.talend.components.jdbc.runtime.setting.JdbcRuntimeSourceOrSinkDefault.initConnection(JdbcRuntimeSourceOrSinkDefault.java:46)
at org.talend.components.jdbc.runtime.JdbcRuntimeUtils.validate(JdbcRuntimeUtils.java:89)
at org.talend.components.jdbc.runtime.JDBCSourceOrSink.validate(JDBCSourceOrSink.java:121)
at ipave_data_load.athena_query_1_1_0_jar_0_1.Athena_Query_1_1_0_JAR.tDBConnection_2Process(Athena_Query_1_1_0_JAR.java:466)
at ipave_data_load.athena_query_1_1_0_jar_0_1.Athena_Query_1_1_0_JAR.runJobInTOS(Athena_Query_1_1_0_JAR.java:1487)
at ipave_data_load.athena_query_1_1_0_jar_0_1.Athena_Query_1_1_0_JAR.main(Athena_Query_1_1_0_JAR.java:1326)

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now