intuit / QuickBooks-V3-Java-SDK

Java SDK for QuickBooks REST API v3 services
Apache License 2.0
70 stars 142 forks source link

Cannot refresh oath access token on release 6.0.4 #125

Closed mputnam-xima closed 4 years ago

mputnam-xima commented 4 years ago

I recently upgraded to release 6.0.4. Refreshing the oath access token fails on this version, and downgrading to 6.0.2 fixed the problem for us. Here is a related stacktrace, and please let me know if I can provide any more info to help you solve the issue, we need 6.0.4 because it supports BUSINESS_CHECKING and BUSINESS_SAVINGS accounts:

org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonAnyGetter.enabled()Z
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:978) ~[spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) [spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) [spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) [tomcat-embed-core-8.5.5.jar!/:8.5.5]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) [spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [tomcat-embed-core-8.5.5.jar!/:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [tomcat-embed-core-8.5.5.jar!/:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.5.jar!/:8.5.5]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.5.jar!/:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.5.jar!/:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.5.jar!/:8.5.5]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) [spring-security-web-4.1.3.RELEASE.jar!/:4.1.3.RELEASE]
        [spring/apache frames omitted]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.5.jar!/:8.5.5]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_171]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_171]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.5.jar!/:8.5.5]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonAnyGetter.enabled()Z
    at com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector.hasAnyGetter(JacksonAnnotationIntrospector.java:1035) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addGetterMethod(POJOPropertiesCollector.java:559) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addMethods(POJOPropertiesCollector.java:533) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collectAll(POJOPropertiesCollector.java:309) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getPropertyMap(POJOPropertiesCollector.java:287) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getProperties(POJOPropertiesCollector.java:170) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.introspect.BasicBeanDescription._properties(BasicBeanDescription.java:164) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.introspect.BasicBeanDescription.findProperties(BasicBeanDescription.java:239) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._findCreatorsFromProperties(BasicDeserializerFactory.java:361) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._constructDefaultValueInstantiator(BasicDeserializerFactory.java:345) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findValueInstantiator(BasicDeserializerFactory.java:269) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:214) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:137) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:411) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.ObjectReader._prefetchRootDeserializer(ObjectReader.java:1938) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.ObjectReader.<init>(ObjectReader.java:189) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.ObjectMapper._newReader(ObjectMapper.java:658) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.fasterxml.jackson.databind.ObjectMapper.readerFor(ObjectMapper.java:3530) ~[ipp-v3-java-devkit-6.0.4-jar-with-dependencies.jar!/:na]
    at com.intuit.oauth2.client.OAuth2PlatformClient.refreshToken(OAuth2PlatformClient.java:143) ~[oauth2-platform-api-6.0.4.jar!/:na]
    at com.ximasoftware.payments.service.internaltools.QuickBooksInternalService.refreshAccessToken(QuickBooksInternalService.java:161) ~[classes!/:0.0.1-SNAPSHOT]
    at com.ximasoftware.payments.service.internaltools.QuickBooksInternalService.guaranteeFreshAccessToken(QuickBooksInternalService.java:143) ~[classes!/:0.0.1-SNAPSHOT]
    at com.ximasoftware.payments.service.internaltools.QuickBooksInternalService.getDataService(QuickBooksInternalService.java:177) ~[classes!/:0.0.1-SNAPSHOT]
    at com.ximasoftware.payments.service.internaltools.QuickBooksInternalService.executeQuery(QuickBooksInternalService.java:68) ~[classes!/:0.0.1-SNAPSHOT]
    at com.ximasoftware.payments.service.internaltools.QuickBooksInternalService$$FastClassBySpringCGLIB$$b1e43306.invoke(<generated>) ~[classes!/:0.0.1-SNAPSHOT]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) ~[spring-aop-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) ~[spring-aop-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at com.ximasoftware.payments.service.internaltools.QuickBooksInternalService$$EnhancerBySpringCGLIB$$400cb74c.executeQuery(<generated>) ~[classes!/:0.0.1-SNAPSHOT]
    at com.ximasoftware.payments.service.quickbooks.QuickBooksService.findCustomerByName(QuickBooksService.java:48) ~[classes!/:0.0.1-SNAPSHOT]
    at com.ximasoftware.payments.service.quickbooks.QuickBooksService.getInvoicesByCustomerName(QuickBooksService.java:68) ~[classes!/:0.0.1-SNAPSHOT]
    at com.ximasoftware.payments.service.quickbooks.QuickBooksService$$FastClassBySpringCGLIB$$965b3a0c.invoke(<generated>) ~[classes!/:0.0.1-SNAPSHOT]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) ~[spring-aop-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) ~[spring-aop-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at com.ximasoftware.payments.service.quickbooks.QuickBooksService$$EnhancerBySpringCGLIB$$a633601e.getInvoicesByCustomerName(<generated>) ~[classes!/:0.0.1-SNAPSHOT]
    at com.ximasoftware.payments.controller.IndexController.invoiceList(IndexController.java:71) ~[classes!/:0.0.1-SNAPSHOT]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114) ~[spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
    ... 75 common frames omitted
e-d commented 4 years ago

Following...

diana-derose commented 4 years ago

Hi @mputnam-xima - Could you run the dependency tree and see if there are any conflicts on the jackson versions? @e-d - Are you getting the error too?

mputnam-xima commented 4 years ago

No conflicts in Jackson versions: see here

However, I haven't been able to rule out some sort of environmental/deployment problem on our end. I'm working on it, will update if I find anything

mputnam-xima commented 4 years ago

@diana-derose manually setting the Jackson version in my project to 2.9.10 (the same version used in the develop branch) fixed it for me. However, I'm not sure if there's a problem with QuickBooks-V3-Java-SDK or a something else going on with my project setup. Here are the lines I added in pom.xml:

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-jaxb-annotations</artifactId>
                <version>2.9.10</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>2.9.10</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>2.9.10</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.jaxrs</groupId>
                <artifactId>jackson-jaxrs-json-provider</artifactId>
                <version>2.9.10</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
diana-derose commented 4 years ago

Thanks for letting me know. I'll do some more testing on my end and try to see if I can add all the dependency in the base pom and package it.

e-d commented 4 years ago

Hi @mputnam-xima - Could you run the dependency tree and see if there are any conflicts on the jackson versions? @e-d - Are you getting the error too?

@diana-derose I work with @mputnam-xima and wanted to be in-the-loop with what was happening. Thanks for looking into this.