NullPointerException with Dremio JDBC driver

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

We have been trying JRS 7.1 (with integrated Tomcat and PSQL) with Dremio (https://www.dremio.com) via JDBC but hit constantly problems with it. The last issue is the one we just can't get around and we were wondering if anybody has seen anything similar.

When trying test connection when setting JDBC datasource fro Dremio, the test fails with connection failed error in catalina.out:

2018-12-12 11:21:09,156 ERROR GenericExceptionMapper,http-nio-8081-exec-2:51 - Unexpected error occurs
java.lang.NullPointerException
        at com.jaspersoft.jasperserver.remote.connection.jdbc.JdbcConnector.testConnection(JdbcConnector.java:86)
        at com.jaspersoft.jasperserver.remote.connection.jdbc.ClientJdbcConnector.testConnection(ClientJdbcConnector.java:49)
        at com.jaspersoft.jasperserver.remote.connection.jdbc.JdbcContextStrategy.createContext(JdbcContextStrategy.java:51)
        at com.jaspersoft.jasperserver.remote.connection.jdbc.JdbcContextStrategy.createContext(JdbcContextStrategy.java:40)
        at com.jaspersoft.jasperserver.remote.connection.ContextsManager.createConnection(ContextsManager.java:94)
        at com.jaspersoft.jasperserver.jaxrs.connection.ConnectionsJaxrsService.createConnection(ConnectionsJaxrsService.java:100)
        at com.jaspersoft.jasperserver.jaxrs.connection.ConnectionsJaxrsService$$FastClassBySpringCGLIB$$b9db4938.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:701)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:51)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:51)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:633)
        at com.jaspersoft.jasperserver.jaxrs.connection.ConnectionsJaxrsService$$EnhancerBySpringCGLIB$$d3a77c29.createConnection(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)

       ...and so forth.

The only change done to JRS config was setting defaultAutoCommit property to True, as Dremio's JDBC driver does nto work with default False setting.

The same NullPointerException happens also when trying to use JNDI. However, the driver work fine with Studio, so somehow this point either to issue either in Tomcat or in JRS. Any idea how to go on from here?

jyri.heinonen's picture
Joined: Oct 12 2018 - 9:59am
Last seen: 3 years 6 months ago

3 Answers:

Not sure where you copied the driver file to but check that you copied it to these locations on the server:

jasperserver-pro\WEB-INF\lib

<tomcat>\lib

If the test button worked in Studio, compare the URL connection string and ensure the same driver is copied to the server. 

vchiem's picture
31494
Joined: May 1 2017 - 5:33pm
Last seen: 4 days 7 hours ago

The driver was copied to both directories and wee also used the GUI option to deploy driver. JRS clearly found the driver, as it gave the exception defined by the driver when using with defaultAutoCommit = False.

jyri.heinonen's picture
Joined: Oct 12 2018 - 9:59am
Last seen: 3 years 6 months ago

I´m using the jasperserver 7.2.0.

Edit applicationContext.xml and find "jdbcDataSourceServiceFactory" bean declaration.

Add dremio class driver item named "com.dremio.jdbc.Driver" in the  "autoCommitUnsupportedDrivers" property values:  

       <property name="autoCommitUnsupportedDrivers">
            <set>
                <value>com.simba.cassandra.jdbc4.Driver</value>
                <value>com.simba.impala.jdbc4.Driver</value>
                <value>com.simba.spark.jdbc4.Driver</value>
                <value>com.simba.googlebigquery.jdbc41.Driver</value>
                <value>com.dremio.jdbc.Driver</value>
            </set>
        </property>

Restart the tomcat.

jhmjesus's picture
Joined: Feb 13 2012 - 10:43am
Last seen: 2 years 4 months ago
Feedback
randomness