SIMBA Amazon Athena JDBC driver causes LogFactoryImpl does not implement org.apache.commons.logging.LogFactory - jdbc

As of 2.0.31 to current (2.0.35), it appears that SIMBA did not shade logging as they had in prior releases such as 2.0.28. Appears to be a SIMBA (InsightSoftware) defect, is anyone aware of them having an open defect for this?
Up to 2.0.28, the SIMBA driver distributed by Amazon could be present on the classpath. As of 2.0.31+ when it is present it causes
Caused by: org.apache.commons.discovery.DiscoveryException: Class org.apache.logging.log4j.jcl.LogFactoryImpl does not implement org.apache.commons.logging.LogFactory
at org.apache.commons.discovery.tools.ClassUtils.verifyAncestory(ClassUtils.java:180)
at org.apache.commons.discovery.tools.SPInterface.verifyAncestory(SPInterface.java:201)
at org.apache.commons.discovery.tools.SPInterface.newInstance(SPInterface.java:195)
at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378)
at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)

Related

Import driver Vertica JDBC into FlyWay

I'm looking into FlyWay 6.3 and there is no support with Vertica 9.X
There is still this issue open:
https://github.com/flyway/flyway/issues/1855
Looking into the documentation I can import into the drivers directory the JDBC of Vertica.
My question is:
If I try do it by my self I'll find any problem?
Are there still some backend problem that needs to be fixed?
Unfortunately Vertica 9 support was removed in 2017. Flyway won't load JDBC drivers for databases it doesn't support.
There is a Pull Request that re-introduces support. So you could try building Flyway from that fork.

Error with nucleusexception and jdofatalexception when starting hive

I am installing hive for the first time on my system with embedded derby metastore but it is not working. It is showing the below mentioned error.
Caused by: javax.jdo.JDOFatalInternalException: The java type java.lang.Long (jdbc-type="",sql-type="") cant be mapped for this metastore.No mapping is available.
NestedThrowables
org.datanucleus.exceptions.NucleusException: The java type java.lang.Long (jdbc-type="",sql-type="") cant be mapped for this metastore.No mapping is available
Please help
Java 9 is not yet supported by Hive. Install either Java 7 or 8 and set the JDK directory as JAVA_HOME in the environment where Hive is installed.
PS: Prefer MySQL for metastore rather than derby.
An embedded metastore database is mainly used for unit tests. Only one process can connect to the metastore database at a time, so it is not really a practical solution but works well for unit tests.

Spring Boot w/o starter-parent pom not loading jdbc driver

I have my Spring-Boot server working well using the 'starter-parent' pom. The problem is that I'd rather not use the spring pom as the parent if at all possible. When I just include the spring-boot-dependencies pom though (as described here), I end up with the driver not being loaded:
18:14:26.127 [localhost-startStop-1] WARN o.a.t.jdbc.pool.PooledConnection - Not loading a JDBC driver as driverClassName property is null.
18:14:26.147 [localhost-startStop-1] ERROR o.a.tomcat.jdbc.pool.ConnectionPool - Unable to create initial connections of pool.
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/mydb
at java.sql.DriverManager.getConnection(DriverManager.java:689) ~[na:1.8.0_45]
at java.sql.DriverManager.getConnection(DriverManager.java:208) ~[na:1.8.0_45]
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:305) ~[tomcat-jdbc-8.0.23.jar:na]
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:200) ~[tomcat-jdbc-8.0.23.jar:na]
...
I'm pretty sure this has to do with the driver not being loaded by the DriverManager & ServiceLoader bits, but I'm not sure how to force that to happen. Any suggestions will be much appreciated.
FWIW: If I try to 'Class.forName()' the MySQL jdbc driver I actually end up with a 'NoClassDefFoundError', which is puzzling because the mysql-connector is definitely in my pom. Multiple class loaders or something?
I believe that my issue is related to how maven is importing vs. inheriting dependencies, those provided by my company's parent pom and those coming with spring-boot. I can't really explain it, but if I comment out the dependency management section of our parent pom everything seems to work correctly. This is definitely some kind of mystical maven behavior, but for now I'm working on separating the dependency management and plugin configuration aspects of our parent pom. That way I can inherit the plugin config, and not the dependency management.
Thanks for your help :)

What is difference between oracle.jdbc.xa.client.OracleXADataSource and oracle.jdbc.pool.OracleDataSource

I am trying to understand the difference between XA vs Non XA JDBC datasource. Also how do I know which type and version of JDBC dtriver is used. I am currently on 10.3 weblogic and trying some tet to kill long running queries using setQueryTimeout, which isnt seem to be reliable with OracleXADataSource as it is only working the first time and not always.
Sorry for this basic question but I am new to Weblogic Datasource configuration
Thanks
XA jdbc drivers are used to implement two-phase commit, meaning the two remote resources are part of the same transaction. Java specifies an implementation of this via JTA. A good reading is e.g. http://www.javaworld.com/javaworld/jw-07-2000/jw-0714-transaction.html; if you google for 'xa jdbc driver' you'll find plenty more info.
You should not use the XA driver if not necessary. I remember reading that there are some problems with them.
To identify JDBC driver your WLS is using, go to the <domain_dir>/config/jdbc and open the data souce file, check the driver-name value in the file.
To identify the Driver version, check from which .jar is the driver being loaded (run the WLS with -verbose:class)- the name of the jar will contain the version number. Also, you can use java -jar my-jdbc-file.jar which will print the driver version. The OJDBC drivers are usually stored in a file named ojdbc6.jar or ojdbc7.jar, etc.

Deploying ojdbc14.jar in a code module for a FileNet code module

I'm trying to deploy a couple of jar files in a code module for an event action in FileNet P8 4.0 (the FileNet server runs on WebSphere 6.1). One of these jars is my custom code, and the other jar is the thin driver for Oracle called ojdbc14.jar (I also tried with ojdbc15.jar), the custom code uses the oracle jar in order to connect to a data source and get a connection using the JNDI name.
When the event action is executed (after a subscription is invoked) the code in my custom module is called OK, the problem occurs when my code needs to load classes from the Oracle jar, I get this cause:
ERROR - Mon Sep 21 16:42:17 UTC 2009 - com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is java.lang.reflect.InvocationTargetException]
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:1000)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:705)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:2093)
...
Caused by: java.lang.NoClassDefFoundError: oracle.jdbc.driver.OracleLog
at com.ibm.ws.rsadapter.dbutils.impl.OracleUtilityImpl.setLogVolume(OracleUtilityImpl.java:85)
at com.ibm.ws.rsadapter.spi.InternalOracleDataStoreHelper.setProperties(InternalOracleDataStoreHelper.java:142)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.(WSRdbDataSource.java:846)
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.setDataSourceProperties(WSManagedConnectionFactoryImpl.java:1947)
... 43 more
...
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleLog
at java.net.URLClassLoader.findClass(URLClassLoader.java:496)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:132)
at java.lang.ClassLoader.loadClass(ClassLoader.java:631)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
... 48 more
Since I'm deploying the oracle jar with the code module, shouldn't FileNet should be able to find the class? Do you think I need to configure something else?
Thanks in advance.
Is it possible for your application to use WebSphere's own JDBC connection pools? When you set up a pool for a particulr database you get all the vendor-specific drivers installed there.
Generally, all manner of classpath and classloader confisions ensue when you try to place infrastructure code in your own applications. I don't know for certain that this is the case for your situation, but I do find taht staying on the known path in WebSphere tends to give the smoothest results.
I found the problem... somehow the ojdbc14.jar file got corrupted, so even when the classpath was correct and no matter what I tried to fix the problem, the problem was always there.
Thanks for the comments!

Resources