0

While deploying AppEngine stadard Java code to Google Cloud instance, using the mvn appengine:deploy or mvn appengine:run command then getting java.lang.NoSuchMethodError: org.hibernate.boot.model.TypeContributions.contributeJavaTypeDescriptor. Below is the detailed error log as highlighted,

INFO] GCLOUD: Sep 19, 2019 10:05:21 AM com.google.appengine.tools.development.ApiProxyLocalImpl log
[INFO] GCLOUD: INFO: javax.servlet.ServletContext log: No Spring WebApplicationInitializer types detected on classpath
[INFO] GCLOUD: Sep 19, 2019 10:05:24 AM com.google.appengine.tools.development.ApiProxyLocalImpl log
[INFO] GCLOUD: INFO: javax.servlet.ServletContext log: Initializing Spring root WebApplicationContext
[INFO] GCLOUD: SLF4J: No SLF4J providers were found.
[INFO] GCLOUD: SLF4J: Defaulting to no-operation (NOP) logger implementation
[INFO] GCLOUD: SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
[INFO] GCLOUD: SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8.
[INFO] GCLOUD: SLF4J: Ignoring binding found at [jar:file:/C:/Lourdu/Development/RBR/target/rbr-1/WEB-INF/lib/slf4j-nop-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[INFO] GCLOUD: SLF4J: See http://www.slf4j.org/codes.html#ignoredBindings for an explanation.
[INFO] GCLOUD: Sep 19, 2019 10:05:35 AM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation
[INFO] GCLOUD: INFO: HHH000204: Processing PersistenceUnitInfo [name: punit]
[INFO] GCLOUD: Sep 19, 2019 10:05:35 AM org.hibernate.Version logVersion
[INFO] GCLOUD: INFO: HHH000412: Hibernate Core {5.4.3.Final}
[INFO] GCLOUD: Sep 19, 2019 10:05:35 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
[INFO] GCLOUD: INFO: HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
[INFO] GCLOUD: Sep 19, 2019 10:05:39 AM org.hibernate.dialect.Dialect <init>
[INFO] GCLOUD: INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
[INFO] GCLOUD: Sep 19, 2019 10:05:40 AM org.hibernate.envers.boot.internal.EnversServiceImpl configure
[INFO] GCLOUD: INFO: Envers integration enabled? : true
[INFO] GCLOUD: 2019-09-19 15:35:40.079:WARN:oejw.WebAppContext:main: Failed startup of context c.g.a.t.d.j.DevAppEngineWebAppContext@72a2312e{/,file:///C:/Lourdu/Development/RBR/target/rbr-1/,UNAVAILABLE}{C:\Lourdu\Development\RBR\target\rbr-1}
[INFO] GCLOUD: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/jpaContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.model.TypeContributions.contributeJavaTypeDescriptor(Lorg/hibernate/type/descriptor/java/spi/JavaTypeDescriptor;)V
[INFO] GCLOUD:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
[INFO] GCLOUD:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
[INFO] GCLOUD:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
[INFO] GCLOUD:  at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
[INFO] GCLOUD:  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
[INFO] GCLOUD:  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
[INFO] GCLOUD:  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
[INFO] GCLOUD:  at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
[INFO] GCLOUD:  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
[INFO] GCLOUD:  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
[INFO] GCLOUD:  at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
[INFO] GCLOUD:  at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
[INFO] GCLOUD:  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
[INFO] GCLOUD:  at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:957)
[INFO] GCLOUD:  at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
[INFO] GCLOUD:  at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:922)
[INFO] GCLOUD:  at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
[INFO] GCLOUD:  at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
[INFO] GCLOUD:  at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
[INFO] GCLOUD:  at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:852)
[INFO] GCLOUD:  at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
[INFO] GCLOUD:  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
[INFO] GCLOUD:  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
[INFO] GCLOUD:  at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
[INFO] GCLOUD:  at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
[INFO] GCLOUD:  at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
[INFO] GCLOUD:  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
[INFO] GCLOUD:  at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
[INFO] GCLOUD:  at org.eclipse.jetty.server.Server.start(Server.java:418)
[INFO] GCLOUD:  at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
[INFO] GCLOUD:  at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
[INFO] GCLOUD:  at org.eclipse.jetty.server.Server.doStart(Server.java:382)
[INFO] GCLOUD:  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
[INFO] GCLOUD:  at com.google.appengine.tools.development.jetty9.JettyContainerService.startContainer(JettyContainerService.java:343)
[INFO] GCLOUD:  at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:283)
[INFO] GCLOUD:  at com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)
[INFO] GCLOUD:  at com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:87)
[INFO] GCLOUD:  at com.google.appengine.tools.development.Modules.startup(Modules.java:105)
[INFO] GCLOUD:  at com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:282)
[INFO] GCLOUD:  at com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:47)
[INFO] GCLOUD:  at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:223)
[INFO] GCLOUD:  at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:221)
[INFO] GCLOUD:  at java.security.AccessController.doPrivileged(Native Method)
[INFO] GCLOUD:  at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:221)
[INFO] GCLOUD:  at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:404)
[INFO] GCLOUD:  at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:45)
[INFO] GCLOUD:  at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:257)
[INFO] GCLOUD:  at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:248)
[INFO] GCLOUD: 2019-09-19 15:35:40.079:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
[INFO] GCLOUD: 2019-09-19 15:35:40.079:INFO:oejs.session:main: node0 Scavenging disabled
[INFO] GCLOUD: 2019-09-19 15:35:40.680:INFO:oejs.AbstractConnector:main: Started NetworkTrafficSelectChannelConnector@56235b8e{HTTP/1.1,[http/1.1]}{localhost:8080}
[INFO] GCLOUD: 2019-09-19 15:35:40.860:INFO:oejs.Server:main: Started @43134ms
[INFO] GCLOUD: Sep 19, 2019 10:05:41 AM com.google.appengine.tools.development.AbstractModule startup
[INFO] GCLOUD: INFO: Module instance default is running at http://localhost:8080/
[INFO] GCLOUD: Sep 19, 2019 10:05:41 AM com.google.appengine.tools.development.AbstractModule startup
[INFO] GCLOUD: INFO: The admin console is running at http://localhost:8080/_ah/admin
[INFO] GCLOUD: Sep 19, 2019 3:35:41 PM com.google.appengine.tools.development.DevAppServerImpl doStart
[INFO] GCLOUD: INFO: Dev App Server is now running

Here is the complete POM file that I used to deploy/run this code,

<?xml version="1.0" encoding="UTF-8"?>
<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>
    <packaging>war</packaging>
    <version>1</version>

    <groupId>com.sanmina</groupId>
    <artifactId>rbr</artifactId>

    <properties>
        <appengine-sdk-version>1.9.76</appengine-sdk-version>
        <objectify.version>6.0.4</objectify.version>
        <guava.version>28.1-jre</guava.version>
        <spring-version>5.1.9.RELEASE</spring-version>
        <spring-security-version>5.1.6.RELEASE</spring-security-version>
        <spring-ldap-version>2.0.1.RELEASE</spring-ldap-version>
        <spring-data-jpa-version>2.1.10.RELEASE</spring-data-jpa-version>
    </properties>

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

    <profiles>

        <!-- Production Enviroment -->
        <profile>
            <id>prod</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <appengine.application>google-project-id</appengine.application>
                <appengine.version>v4</appengine.version>
                <appengine.instance-class>B2</appengine.instance-class>
            </properties>
            <build>
                <filters>
                    <filter>src/main/resources/profiles/prod.properties</filter>
                </filters>
            </build>
        </profile>

        <profile>
            <id>local</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <appengine.application>google-project-id</appengine.application>
                <appengine.version>local</appengine.version>
                <appengine.instance-class>B1</appengine.instance-class>
            </properties>
            <build>
                <filters>
                    <filter>src/main/resources/profiles/local.properties</filter>
                </filters>
            </build>
        </profile>

    </profiles>
    <dependencies>
        <!-- Compile/runtime dependencies -->

        <dependency>
            <groupId>aopalliance</groupId>
            <artifactId>aopalliance</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-1.0-sdk</artifactId>
            <version>${appengine-sdk-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.google.endpoints/endpoints-framework -->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt</artifactId>
            <version>0.9.1</version>
        </dependency>

        <dependency>
            <groupId>com.google.endpoints</groupId>
            <artifactId>endpoints-framework</artifactId>
            <version>2.2.1</version>
        </dependency>

        <dependency>
            <groupId>com.google.endpoints</groupId>
            <artifactId>endpoints-management-control-appengine-all</artifactId>
            <version>1.0.11</version>
        </dependency>

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

        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>javax.jdo</groupId>
            <artifactId>jdo-api</artifactId>
            <version>3.1</version>
        </dependency>

        <!-- [START Objectify_Dependencies] -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>

        <dependency>
            <groupId>com.googlecode.objectify</groupId>
            <artifactId>objectify</artifactId>
            <version>${objectify.version}</version>
        </dependency>
        <!-- [END Objectify_Dependencies] -->

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <!-- WEB -->

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <!-- Security -->

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring-security-version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring-security-version}</version>
        </dependency>

        <!-- Spring JDBC & JPA -->

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>${spring-data-jpa-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.4.0-b180830.0359</version>
        </dependency>


        <!-- Hibernate -->

        <!-- https://mvnrepository.com/artifact/org.hibernate.orm/hibernate-core -->

        <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>6.0.0.Alpha2</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-orm</artifactId>
            <version>5.11.2.Final</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.infinispan/infinispan-directory-provider -->
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-directory-provider</artifactId>
            <version>10.0.0.CR2</version>
        </dependency>


        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.2.Final</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.hibernate.orm/hibernate-c3p0 -->
        <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-c3p0</artifactId>
            <version>6.0.0.Alpha2</version>
        </dependency>


        <!-- Open ID -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-openid</artifactId>
            <version>5.1.6.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot</artifactId>
            <version>2.1.8.RELEASE</version>
        </dependency>


        <!-- Database -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.17</version>
        </dependency>

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


        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
            <version>2.7.0</version>
        </dependency>


        <!-- @Inject -->
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.0-alpha0</version>
        </dependency>

        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>8.0.1</version>
            <scope>provided</scope>
        </dependency>
        <!-- Jason Object -->

        <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.5</version>
        </dependency>

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20190722</version>
        </dependency>


        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.13</version>
        </dependency>

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

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.10.0.pr3</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.10.0.pr3</version>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>jsr250-api</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>javax.json</groupId>
            <artifactId>javax.json-api</artifactId>
            <version>1.1.4</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>1.1.4</version>
        </dependency>

        <!-- Google oAuth -->
        <dependency>
            <groupId>org.apache.oltu.oauth2</groupId>
            <artifactId>org.apache.oltu.oauth2.client</artifactId>
            <version>1.0.2</version>
        </dependency>

        <!-- Excel library -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>4.1.0</version>
        </dependency>

        <!-- Apache Commons IO -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
        </dependency>

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.13.0</version>
        </dependency>
        <dependency>
            <groupId>org.neo4j</groupId>
            <artifactId>neo4j-cypher-compiler-2.1</artifactId>
            <version>2.1.8</version>
        </dependency>

    </dependencies>
    <build>
        <!-- for profile execution -->
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <!-- for hot reload of the web application -->
        <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.7</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>display-dependency-updates</goal>
                            <goal>display-plugin-updates</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.2.3</version>
                <configuration>
                    <webResources>
                        <resources>
                            <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                            <filtering>true</filtering>
                            <targetPath>WEB-INF</targetPath>
                        </resources>
                    </webResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>endpoints-framework-maven-plugin</artifactId>
                <version>2.0.1</version>
                <configuration>
                    <hostname>${appengine.application}.appspot.com</hostname>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>

            <plugin>
              <artifactId>maven-install-plugin</artifactId>
              <version>3.0.0-M1</version>
            </plugin>

            <plugin>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>3.0.0-M3</version>
            </plugin>

            <plugin>
              <artifactId>maven-site-plugin</artifactId>
              <version>3.8.2</version>
            </plugin>

            <plugin>
              <artifactId>maven-resources-plugin</artifactId>
              <version>3.1.0</version>
            </plugin>

            <plugin>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>3.0.0-M1</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>


            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>appengine-maven-plugin</artifactId>
                <version>2.1.0</version>
                <configuration>
                    <stage.enableJarSplitting>true</stage.enableJarSplitting>
                    <deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
                    <deploy.projectId>${appengine.application}</deploy.projectId>
                    <deploy.version>prod</deploy.version>
                    <!-- <port>8090</port> -->
                    <!-- <jvmFlags> -->
                    <!-- <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8080,server=y,suspend=y</jvmFlag> -->
                    <!-- </jvmFlags> -->
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M2</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.0</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>

It would be good some one help me solve this case.

lourdu rajan
  • 329
  • 1
  • 5
  • 24

2 Answers2

0

Are you familiar with this Google official quickstart for Java 8?

I have tried to deploy a Hello world app and worked for me using the step-by-step guide. Perhaps, following the documentation can help you deploy your app using mvn appengine:deploy with no errors.

Looking at the error you are getting:

[Errno 2] No such file or directory

This can mean two things, either Java is not looking in the place that you think it should be, or the file or directory that you are trying to access does not exist.

Also, check this OS issue because it shows you how to get your current working directory.


Update - Error when creating a bean

As the stack trace shows:

[INFO] GCLOUD: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/jpaContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.model.TypeContributions.contributeJavaTypeDescriptor(Lorg/hibernate/type/descriptor/java/spi/JavaTypeDescriptor;)

This means that there has been an error when creating a bean with the name of 'entityManagerFactory', which is defined in your jpaContext.xml file.

I would suggest to go back to your jpaContext.xml and make sure that you are creating the 'entityManagerFactory' bean accordingly. This is the official Java documentation for that. Also, this guide may come in handy if you would like to check it out.

sllopis
  • 2,292
  • 1
  • 8
  • 13
  • This same code was working few months ago(when I publish it last time), but now the same code got the above mentioned error. The sample code from Google official document, able to deploy it with out problem. – lourdu rajan Sep 12 '19 at 14:46
  • Hi @Lourdu, I would suggest you to go back to the last version you deployed that actually worked and check for what differs now. Because based on the explanation about your code, it is highly unlikely that issue resides on Google App Engine's side. – sllopis Sep 12 '19 at 15:20
  • Currently all my dependencies are the same version when I deploy the code last time, except the one Google Cloud SDK version. Its automatically upgraded while trying to deploy my code. Probably, I may upgrade all my dependencies to it's latest version and see is there any difference. – lourdu rajan Sep 12 '19 at 15:27
  • Sure, keep me posted. Good luck! – sllopis Sep 12 '19 at 15:30
  • After upgraded all dependencies to its latest version, then got below error message, when i run it in local(appengine:run), **Cannot resolve reference to bean 'jpaMappingContext' while setting bean property 'mappingContext'; Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource[/WEB-INF/jpaContext.xml]: nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]** – lourdu rajan Sep 13 '19 at 15:15
  • Hi @lourdurajan, I think it would be helpful if you could post your pom.xml file. Nonetheless, check your dependencies because there may be some mismatch among the dependency versions that you are using,. You may need to upgrade/downgrade your dependencies, so they are all in sync. – sllopis Sep 16 '19 at 11:15
  • Hi @sllopis, thanks for your feedback. After updated few more dependencies to its latest version then got different error now when I say **appengine:run**. I have updated my question along with the latest error message and complete POM file that I used. I hope I have upgraded all dependencies to their latest version. Could you please check and let me know If anything missed here. – lourdu rajan Sep 19 '19 at 14:04
  • Thanks for the update @lourdurajan, my first observation is that your server is up and running since you are not getting any ERROR messages, but rather INFO messages from the GCLOUD stacktrace. Among the INFO messages, I can see that you are using the [Simple Logging Facade for Java (SLF4J)](https://cloud.google.com/logging/docs/setup/java#logback_appender_for); however, no providers were found for SLF4J. Check the link for further details. In regards to the INFO message that you are getting now, I will updated my answer above with my suggestion since I am running out of characters here. – sllopis Sep 20 '19 at 08:27
  • Hi Sllopis, thanks for your feedback. Yes, all its GCLOUD info(just realized) and not an error messages. However the app is not working/up when I say **http://localhost:8080**. For SLF4J, based on you provided the link I will implement it in my project. Waiting for your feedback on INFO messages which I am getting now... – lourdu rajan Sep 20 '19 at 12:16
0

I can see that in the current state build is successful, however errors in your code prevent your app to run correctly. In general updating your dependencies seems to create more issues that you had in the beginning.

Please read your error trace carefully to identify your issues. I suggest addressing them step by step. It also seems reasonable to open new questions about errors that will persist:

  1. Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8.

Your code needs update due to usage of the new version 1.8 In the error trace you have a link to error description: "Earlier versions of SLF4J relied on the static binder mechanism which is no longer honored by slf4j-api. In case SLF4J finds no providers targeting SLF4J 1.8 but finds instead bindings targeting SLF4J 1.7 or earlier, it will list the bindings it finds but otherwise ignores them." Please address this issue in the code or use version 1.7 instead

  1. WARN:oejw.WebAppContext:main: Failed startup of context c.g.a.t.d.j.DevAppEngineWebAppContext

C:\Lourdu\Development\RBR\target\rbr-1 is reported as Unavailable. It was not found.

  1. Error creating bean with name 'entityManagerFactory'

Most probably the problem is version mismatch. It happens when you got some dependencies which bring it’s related dependencies together with certain version. And if you have included those dependencies with different version numbers, they can give undesired results in compile time. For more information please check this community response

Pawel Czuczwara
  • 1,442
  • 9
  • 20
  • Thanks for your feedback. I got little spark now. From your message noted that old version of dependency might get-in due to other dependencies. Just cross checked and noted that Hibernate Core {5.4.3.Final} included though I used version 6.x. Found that culprit from "hibernate-jpa-2.1-api" dependency. After upgraded it then now I got below new error message after few days struck :) **[/WEB-INF/jpaContext.xml]: Cannot create inner bean 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter' ; java.lang.ClassNotFoundException: org.hibernate.jpa.HibernateEntityManagerFactory** – lourdu rajan Sep 23 '19 at 15:34
  • Got the below Error Message now: Caused by: [INFO] GCLOUD: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#ddf20fd' defined in ServletContext resource [/WEB-INF/jpaContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/jpa/HibernateEntityManagerFactory – lourdu rajan Sep 24 '19 at 15:31
  • Did you try to [clean dependencies](https://stackoverflow.com/questions/4662452/in-maven-why-run-mvn-clean)? You may also be calling some methods that does not exist in the current version of dependencies. So if cleaning will not work, you may consider going back to original configuration and changing dependency one by one, to see witch one is causing issues. – Pawel Czuczwara Sep 25 '19 at 09:25
  • I always used to clean command before executing the orginal command appengine:run. Problem I noted that "hibernate-entitymanager" is not available in "hibernate-core" atrifact, so only got error like class "org/hibernate/jpa/HibernateEntityManagerFactory" not found. This "hibernate-entitymanager" artifact has been moved to "hibernate-core" atrifact in recent version( as per mvn repository information). But when I look the org.hibernate.orm -> hibernate-core dependencies, I couldn't find the hibernate-entitymanager dependency. So want to know the alternative class for hibernate-entitymanager. – lourdu rajan Sep 25 '19 at 09:59
  • For new questions please create new question in StackOverflow. It is for better visiblity for another users. As you can [see here hibernate-entitymanager is deprecated](https://mvnrepository.com/artifact/org.hibernate/hibernate-entitymanager) it says: use hibernate-core instead – Pawel Czuczwara Sep 25 '19 at 10:24
  • If my original answer was helpful, please accept it for better visibility for another users. – Pawel Czuczwara Sep 25 '19 at 10:25
  • Yes, hibernate-entitymanager is deprecated thats why I used hibernate-core from org.hibernate.orm in my POM and now I got error like class not found "org/hibernate/jpa/HibernateEntityManagerFactory", though used proper dependencies. I created new stackoverflow for this new error [link] (https://stackoverflow.com/questions/58096767/appengine-standard-java-code-deploy-java-lang-noclassdeffounderror-org-hibern). I will accept & give your point once I get sorted out all issues. Thank you. – lourdu rajan Sep 25 '19 at 11:01