GoogleCloudPlatform / getting-started-java

https://cloud.google.com/java
Apache License 2.0
480 stars 522 forks source link

Uncaught exception from servlet java.lang.NoSuchMethodError: com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.<init> #422

Closed nmnschaitanya closed 5 years ago

nmnschaitanya commented 5 years ago

Uncaught exception from servlet java.lang.NoSuchMethodError: com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.(Lcom/google/api/client/http/HttpTransport;Lcom/google/api/client/http/HttpRequestInitializer;Ljava/lang/String;Ljava/lang/String;Lcom/google/api/client/json/JsonObjectParser;Lcom/google/api/client/googleapis/services/GoogleClientRequestInitializer;Ljava/lang/String;Z)V at com.google.api.services.drive.Drive.(Drive.java:135) at com.google.api.services.drive.Drive$Builder.build(Drive.java:8036) at com.valeo.redalerts.helper.ReportsHelper.fetchSpreadsheet(ReportsHelper.java:77) at com.valeo.redalerts.web.controller.HomeController.exportreports(HomeController.java:1909) 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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:111) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:806) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:729) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1772) at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) at com.google.apphosting.runtime.jetty9.ParseBlobUploadHandler.handle(ParseBlobUploadHandler.java:119) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1182) at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.doHandle(AppEngineWebAppContext.java:171) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:296) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) at org.eclipse.jetty.server.Server.handle(Server.java:539) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) at com.google.apphosting.runtime.jetty9.RpcConnection.handle(RpcConnection.java:202) at com.google.apphosting.runtime.jetty9.RpcConnector.serviceRequest(RpcConnector.java:81) at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:699) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:661) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:631) at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:825) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:273) at java.lang.Thread.run(Thread.java:745)

nmnschaitanya commented 5 years ago

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>ISRA</groupId>
<artifactId>ISRA-redalert-dev</artifactId>
<version>0.0.2</version>
<packaging>war</packaging>

<properties>
    <appengine.maven.plugin.version>1.3.2</appengine.maven.plugin.version>
    <appengine.api.sdk.version>1.9.64</appengine.api.sdk.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
</properties>

<prerequisites>
    <maven>3.3.9</maven>
</prerequisites>

<dependencies>

    <!-- https://mvnrepository.com/artifact/com.google.http-client/google-http-client-jackson2 -->
    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client-jackson2</artifactId>
        <version>1.27.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client</artifactId>
        <version>1.27.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.http-client/google-http-client -->
    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client</artifactId>
        <version>1.27.0</version>
    </dependency>

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>7.0</version> <!-- Put here the version of your Java EE app, in my case 7.0 -->
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>4.2.0.RELEASE</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>4.2.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>4.2.0.RELEASE</version>
    </dependency>

    <!-- Below dependency is used for spring mvc framework. -->

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>4.2.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>4.2.0.RELEASE</version>
    </dependency>
    <!-- Below dependency is used for servlet and jsp. -->
    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>javax.servlet.jsp-api</artifactId>
        <version>2.3.1</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency>

    <!-- <dependency> -->
    <!-- <groupId>com.google.cloud</groupId> -->
    <!-- <artifactId>google-cloud-datastore</artifactId> -->
    <!-- <version>1.40.0</version> -->
    <!-- </dependency> -->

    <!-- <dependency> -->
    <!-- <groupId>com.google.apis</groupId> -->
    <!-- <artifactId>google-api-services-cloudresourcemanager</artifactId> -->
    <!-- <version>v1-rev505-1.25.0</version> -->
    <!-- </dependency> -->

    <!-- https://mvnrepository.com/artifact/com.google.appengine/appengine-testing -->
    <!-- <dependency> -->
    <!-- <groupId>com.google.appengine</groupId> -->
    <!-- <artifactId>appengine-testing</artifactId> -->
    <!-- <version>1.9.24</version> -->
    <!-- <scope>test</scope> -->
    <!-- </dependency> -->

    <!-- https://mvnrepository.com/artifact/com.google.appengine/appengine-api-1.0-sdk -->
    <!-- <dependency> -->
    <!-- <groupId>com.google.appengine</groupId> -->
    <!-- <artifactId>appengine-api-1.0-sdk</artifactId> -->
    <!-- <version>1.3.1</version> -->
    <!-- </dependency> -->

    <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-api-1.0-sdk</artifactId>
        <version>1.9.65</version>
    </dependency>
    <!-- <dependency> <groupId>com.google.endpoints</groupId> <artifactId>endpoints-framework</artifactId> 
        <version>2.1.2</version> </dependency> -->
    <!-- <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-translate</artifactId> 
        <version>1.44.0</version> </dependency> -->
    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-datastore</artifactId>
        <version>1.50.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-storage</artifactId>
        <version>1.44.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-os-login</artifactId>
        <version>0.62.0-alpha</version>
    </dependency>
    <!-- <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-firestore</artifactId> 
        <version>0.62.0-beta</version> </dependency> -->

    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.6.2</version>
    </dependency>

    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-core</artifactId>
        <version>3.1.1</version>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-api-jdo</artifactId>
        <version>3.1.2</version>
    </dependency>
    <dependency>
        <groupId>com.google.appengine.orm</groupId>
        <artifactId>datanucleus-appengine</artifactId>
        <version>2.1.2</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-enhancer</artifactId>
        <version>3.1.1</version>
    </dependency>
    <!-- Dependencies for drive rest api testing -->
    <!-- <dependency> <groupId>com.google.api-client</groupId> <artifactId>google-api-client</artifactId> 
        <version>1.23.0</version> </dependency> -->

    <dependency>
        <groupId>com.google.oauth-client</groupId>
        <artifactId>google-oauth-client-jetty</artifactId>
        <version>1.23.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-drive</artifactId>
        <version>v3-rev130-1.25.0</version>
    </dependency>

    <!-- // for sheets -->

    <!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-sheets -->
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-sheets</artifactId>
        <version>v4-rev516-1.23.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.json/json -->
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20140107</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.google.gdata/core -->
    <dependency>
        <groupId>com.google.gdata</groupId>
        <artifactId>core</artifactId>
        <version>1.47.1</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-drive -->
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-drive</artifactId>
        <version>v2-rev65-1.13.2-beta</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.fasterxml/jackson-xml-databind -->
    <dependency>
        <groupId>com.fasterxml</groupId>
        <artifactId>jackson-xml-databind</artifactId>
        <version>0.6.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/net.sf.jsr107cache/jsr107cache -->
    <dependency>
        <groupId>net.sf.jsr107cache</groupId>
        <artifactId>jsr107cache</artifactId>
        <version>1.1</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity -->
    <dependency>
        <groupId>org.apache.velocity</groupId>
        <artifactId>velocity</artifactId>
        <version>1.7</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client</artifactId>
        <version>1.23.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.cedarsoftware/java-util -->
    <!-- <dependency> <groupId>com.cedarsoftware</groupId> <artifactId>java-util</artifactId> 
        <version>1.8.0</version> </dependency> -->
    <!-- https://mvnrepository.com/artifact/javax.jdo/jdo-api -->
    <!-- <dependency> <groupId>javax.jdo</groupId> <artifactId>jdo-api</artifactId> 
        <version>3.0.1</version> </dependency> -->
    <!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client</artifactId>
        <version>1.26.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.endpoints/endpoints-framework -->
    <!-- <dependency> <groupId>com.google.endpoints</groupId> <artifactId>endpoints-framework</artifactId> 
        <version>2.2.0</version> </dependency> -->
    <!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
    <!-- <dependency> <groupId>com.google.api-client</groupId> <artifactId>google-api-client</artifactId> 
        <version>1.23.0</version> </dependency> -->

    <!-- https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-jetty -->
    <dependency>
        <groupId>com.google.oauth-client</groupId>
        <artifactId>google-oauth-client-jetty</artifactId>
        <version>1.23.0</version>
    </dependency>

    <dependency>
        <groupId>com.vs.gae</groupId>
        <artifactId>baselibrary</artifactId>
        <version>3.0</version>
    </dependency>
    <dependency>
        <groupId>com.vs.gae</groupId>
        <artifactId>baseweblibrary</artifactId>
        <version>4.0</version>
    </dependency>

    <dependency>
        <groupId>com.valeo</groupId>
        <artifactId>cloudservices</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>com.valeo</groupId>
        <artifactId>contactsearch-proxy</artifactId>
        <version>1.2.1</version>
    </dependency>
    <dependency>
        <groupId>com.valeo</groupId>
        <artifactId>organisationsearch-proxy</artifactId>
        <version>1.0.1</version>
    </dependency>
    <!-- <dependency> <groupId>com.googlecode.objectify</groupId> <artifactId>objectify</artifactId> 
        <version>5.1.22</version> </dependency> -->

    <!-- https://mvnrepository.com/artifact/com.google.appengine/appengine-maven-plugin -->
    <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-maven-plugin</artifactId>
        <version>1.9.67</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.sendgrid/sendgrid-java -->
    <dependency>
        <groupId>com.sendgrid</groupId>
        <artifactId>sendgrid-java</artifactId>
        <version>3.0.5</version>
    </dependency>

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>22.0</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-cache</artifactId>
        <version>3.1.3</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.google.http-client/google-http-client-jackson -->
    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client-jackson</artifactId>
        <version>1.27.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->

    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
    </dependency>
    <!-- <dependency> <groupId>com.google.gdata</groupId> <artifactId>gdata-appsforyourdomain-meta</artifactId> 
        <version>1.0-1.26</version> </dependency> <dependency> <groupId>com.google.gdata</groupId> 
        <artifactId>gdata-appsforyourdomain</artifactId> <version>1.0</version> </dependency> 
        <dependency> <groupId>com.google.gdata</groupId> <artifactId>gdata-core-1.0</artifactId> 
        <version>1.41.5</version> </dependency> <dependency> <groupId>com.google.gdata</groupId> 
        <artifactId>gdata-spreadsheet-3.0</artifactId> <version>1.41.5</version> 
        </dependency> -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.9.7</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.9.13</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.13</version>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.14</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>4.2.1.RELEASE</version>
    </dependency>
    <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-asm</artifactId> 
        <version>3.1.1.RELEASE</version> </dependency> -->

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>5.1.2.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-expression</artifactId>
        <version>5.1.1.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>5.0.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.monitorjbl</groupId>
        <artifactId>xlsx-streamer</artifactId>
        <version>2.0.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.appengine/appengine-jsr107cache -->
    <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-jsr107cache</artifactId>
        <version>1.9.64</version>
    </dependency>

    <!-- <dependency> <groupId>com.google.api.client</groupId> <artifactId>google-api-client-json</artifactId> 
        <version>1.2.3-alpha</version> </dependency> -->

</dependencies>

<build>
    <finalName>ISRA-redalert</finalName>

    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>

    <plugins>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>2.3</version>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <goals>
                        <goal>display-dependency-updates</goal>
                        <goal>display-plugin-updates</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>${appengine.maven.plugin.version}</version>
        </plugin>

        <plugin>
            <groupId>org.datanucleus</groupId>
            <artifactId>maven-datanucleus-plugin</artifactId>
            <version>3.1.2</version>
            <configuration>
                <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                <verbose>false</verbose>
                <fork>false</fork>
            </configuration>
            <executions>
                <execution>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>enhance</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

    </plugins>
</build>

nmnschaitanya commented 5 years ago

Any experts ,give me an answer to resolve the subjected issue

dzlier-gcp commented 5 years ago

This is a Guava version issue. Try using the most recent version of guava. If that still presents an error, then run mvn dependency:treeand try to match the version of Guava required by other libraries. Or remove Guava from your top-level dependencies entirely.