我最近选择了一名前员工的未完成的Java Appengine项目。从今天早上开始,我一直在尝试启动该应用程序,但是我似乎无法弄清楚问题出在哪里。 我正在使用Java 8。 我通过终端做了一个mvn干净的程序包,然后运行了另一个appengine maven构建并得到了这个:
*
"C:\Program Files\Java\jdk1.8.0_101\bin\java" -Dmaven.multiModuleProjectDirectory=C:\Users\ORVIFSTAGIERE\Documents\MesProjectJava\SiteOrvifMaven\website "-Dmaven.home=C:\Program Files\Maven\apache-maven-3.5.4" "-Dclassworlds.conf=C:\Program Files\Maven\apache-maven-3.5.4\bin\m2.conf" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.4\lib\idea_rt.jar=49872:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Maven\apache-maven-3.5.4\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.3.4 com.google.cloud.tools:appengine-maven-plugin:1.3.2:run
[INFO] Scanning for projects...
[WARNING] The project com.orvif.website:website:war:1.0-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO]
[INFO] ---------------------< com.orvif.website:website >----------------------
[INFO] Building website 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] >>> appengine-maven-plugin:1.3.2:run (default-cli) > package @ website >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ website ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ website ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ website ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- versions-maven-plugin:2.3:display-dependency-updates (default) @ website ---
[INFO] The following dependencies in Dependencies have newer versions:
[INFO] com.google.appengine:appengine-api-1.0-sdk .......... 1.9.76 -> 1.9.78
[INFO] com.google.appengine:appengine-api-stubs ............ 1.9.76 -> 1.9.78
[INFO] com.google.appengine:appengine-testing .............. 1.9.76 -> 1.9.78
[INFO] com.google.appengine:appengine-tools-sdk ............ 1.9.76 -> 1.9.78
[INFO] com.google.cloud:google-cloud-storage .............. 1.81.0 -> 1.103.1
[INFO] com.google.cloud.sql:mysql-socket-factory-connector-j-8 ...
[INFO] 1.0.14 -> 1.0.15
[INFO] com.google.code.gson:gson ............................. 2.8.5 -> 2.8.6
[INFO] com.google.truth:truth .............................. 1.0-rc2 -> 1.0.1
[INFO] com.googlecode.objectify:objectify .................... 6.0.4 -> 6.0.6
[INFO] com.zaxxer:HikariCP ................................... 3.3.1 -> 3.4.2
[INFO] commons-codec:commons-codec ............................. 1.12 -> 1.14
[INFO] javax.servlet:javax.servlet-api ....................... 3.1.0 -> 4.0.1
[INFO] joda-time:joda-time ................................. 2.10.2 -> 2.10.5
[INFO] junit:junit ...................................... 4.13-beta-3 -> 4.13
[INFO] mysql:mysql-connector-java .......................... 8.0.16 -> 8.0.19
[INFO]
[INFO]
[INFO] --- versions-maven-plugin:2.3:display-plugin-updates (default) @ website ---
[INFO]
[INFO] The following plugin updates are available:
[INFO] com.google.cloud.tools:appengine-maven-plugin ........ 1.3.2 -> 2.2.0
[INFO] maven-clean-plugin ................................... 3.0.0 -> 3.1.0
[INFO] maven-compiler-plugin ................................ 3.6.1 -> 3.8.1
[INFO] maven-deploy-plugin ................................. 2.7 -> 3.0.0-M1
[INFO] maven-enforcer-plugin ............................. 1.4.1 -> 3.0.0-M3
[INFO] maven-install-plugin .............................. 2.5.2 -> 3.0.0-M1
[INFO] maven-resources-plugin ............................... 3.0.2 -> 3.1.0
[INFO] maven-site-plugin ...................................... 3.6 -> 3.8.2
[INFO] maven-surefire-plugin .............................. 2.20 -> 3.0.0-M4
[INFO] maven-war-plugin ..................................... 3.1.0 -> 3.2.3
[INFO] org.codehaus.mojo:versions-maven-plugin .................. 2.3 -> 2.7
[INFO]
[INFO] All plugins have a version specified.
[INFO]
[INFO] Project defines minimum Maven version as: 3.5
[INFO] Plugins require minimum Maven version of: 3.0
[INFO]
[INFO] No plugins require a newer version of Maven than specified by the pom.
[INFO]
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ website ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\ORVIFSTAGIERE\Documents\MesProjectJava\SiteOrvifMaven\website\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ website ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.20:test (default-test) @ website ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:3.1.0:war (default-war) @ website ---
[INFO] Packaging webapp
[INFO] Assembling webapp [website] in [C:\Users\ORVIFSTAGIERE\Documents\MesProjectJava\SiteOrvifMaven\website\target\website-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\ORVIFSTAGIERE\Documents\MesProjectJava\SiteOrvifMaven\website\src\main\webapp]
[INFO] Webapp assembled in [1296 msecs]
[INFO] Building war: C:\Users\ORVIFSTAGIERE\Documents\MesProjectJava\SiteOrvifMaven\website\target\website-1.0-SNAPSHOT.war
[INFO]
[INFO] <<< appengine-maven-plugin:1.3.2:run (default-cli) < package @ website <<<
[INFO]
[INFO]
[INFO] --- appengine-maven-plugin:1.3.2:run (default-cli) @ website ---
janv. 30, 2020 4:38:55 PM com.google.cloud.tools.appengine.cloudsdk.CloudSdk logCommand
INFOS: submitting command: C:\Program Files\Java\jdk1.8.0_101\jre\bin\java.exe -Duse_jetty9_runtime=true -D--enable_all_permissions=true -Dappengine.sdk.root=C:\Users\ORVIFSTAGIERE\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\java -cp C:\Users\ORVIFSTAGIERE\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\java\lib\appengine-tools-api.jar com.google.appengine.tools.development.DevAppServerMain --allow_remote_shutdown --disable_update_check --no_java_agent C:\Users\ORVIFSTAGIERE\Documents\MesProjectJava\SiteOrvifMaven\website\target\website-1.0-SNAPSHOT
[INFO] GCLOUD: janv. 30, 2020 4:38:55 PM java.util.prefs.WindowsPreferences <init>
[INFO] GCLOUD: AVERTISSEMENT: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[INFO] GCLOUD: janv. 30, 2020 4:38:55 PM com.google.appengine.tools.development.SystemPropertiesManager setSystemProperties
[INFO] GCLOUD: INFOS: Overwriting system property key 'java.util.logging.config.file', value 'C:\Users\ORVIFSTAGIERE\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\java\config\sdk\logging.properties' with value 'WEB-INF/logging.properties' from 'C:\Users\ORVIFSTAGIERE\Documents\MesProjectJava\SiteOrvifMaven\website\target\website-1.0-SNAPSHOT\WEB-INF\appengine-web.xml'
[INFO] GCLOUD: 2020-01-30 16:38:56.084:INFO::main: Logging initialized @633ms to org.eclipse.jetty.util.log.StdErrLog
[INFO] GCLOUD: 2020-01-30 16:38:56.138:WARN:oejs.AbstractConnector:main: Ignoring deprecated socket close linger time
[INFO] GCLOUD: java.io.IOException: Failed to bind to localhost/127.0.0.1:8080
[INFO] GCLOUD: at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346)
[INFO] GCLOUD: at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:308)
[INFO] GCLOUD: at com.google.appengine.tools.development.jetty9.JettyContainerService.connectContainer(JettyContainerService.java:309)
[INFO] GCLOUD: at com.google.appengine.tools.development.AbstractContainerService.createConnection(AbstractContainerService.java:268)
[INFO] GCLOUD: at com.google.appengine.tools.development.AbstractInstanceHolder.createConnection(AbstractInstanceHolder.java:37)
[INFO] GCLOUD: at com.google.appengine.tools.development.AbstractModule.createConnection(AbstractModule.java:73)
[INFO] GCLOUD: at com.google.appengine.tools.development.Modules.createConnections(Modules.java:99)
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:245)
[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: Caused by: java.net.BindException: Address already in use: bind
[INFO] GCLOUD: at sun.nio.ch.Net.bind0(Native Method)
[INFO] GCLOUD: at sun.nio.ch.Net.bind(Net.java:433)
[INFO] GCLOUD: at sun.nio.ch.Net.bind(Net.java:425)
[INFO] GCLOUD: at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
[INFO] GCLOUD: at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
[INFO] GCLOUD: at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342)
[INFO] GCLOUD: ... 16 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.945 s
[INFO] Finished at: 2020-01-30T16:38:56+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.2:run (default-cli) on project website: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.2:run failed: Non zero exit: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Process finished with exit code 1
*
这也是pom.xml文件。我猜这可能是我的一个依赖项中的版本问题?:
<?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.0-SNAPSHOT</version>
<groupId>com.orvif.website</groupId>
<artifactId>website</artifactId>
<properties>
<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>
<archiveClasses>true</archiveClasses>
</properties>
<prerequisites>
<maven>3.5</maven>
</prerequisites>
<dependencies>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.76</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>1.19.4</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>1.9.76</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>1.9.76</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-tools-sdk</artifactId>
<version>1.9.76</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.0-rc2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13-beta-3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.55</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.2</version>
</dependency>
<dependency>
<groupId>com.googlecode.objectify</groupId>
<artifactId>objectify</artifactId>
<version>6.0.4</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>com.sun.jna</groupId>
<artifactId>jna</artifactId>
<version>3.0.9</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>platform</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>mysql-socket-factory-connector-j-8</artifactId>
<version>1.0.14</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.16</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.5.0-b01</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>com.google.appengine.tools</groupId>
<artifactId>appengine-gcs-client</artifactId>
<version>0.8</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>1.81.0</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.3.1</version>
</dependency>
</dependencies>
<build>
<!-- for hot reload of the web application -->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<project>orvifgcp</project>
<version>1</version>
</configuration>
</plugin>
<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>
<configuration>
<excludes>
<exclude>javax.servlet:javax.servlet-api</exclude>
<exclude>com.google.guava:guava</exclude> <!-- avoid android version -->
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.6</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.5</version>
</requireMavenVersion>
<requirePluginVersions>
<message>Best Practice is to always define plugin versions!</message>
<banLatest>true</banLatest>
<banRelease>true</banRelease>
<phases>
clean,deploy,verify,appengine:run,appengine:deploy,appengine:update,appengine:devappaserver,site
</phases>
</requirePluginVersions>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
答案 0 :(得分:0)
很可能有另一个进程正在监听8080,以找出该进程是什么,请使用以下命令:
在Windows中:
netstat -ano | find "8080"
然后使用以下命令将其停止:
taskkill -pid <PID> /f
在Linux中:
netstat -tulpn | grep 8080
使用以下方法停止它:
kill <PID>