gpt4 book ai didi

java - org.apache.http.NoHttpResponseException :localhost:2377 failed to respond

转载 作者:行者123 更新时间:2023-11-28 23:11:08 24 4
gpt4 key购买 nike

错误:

Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default-cli) on project Bookstore: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.NoHttpResponseException: localhost:2377 failed to respond 

Docker文件:

FROM tomcat:8-alpine
EXPOSE 2377:8080
ADD /WebContent/WEB-INF/web.xml /usr/local/tomcat/conf/
VOLUEME /tmp/webappdata/
COPY /target/Bookstore-1.war /usr/local/tomcat/webapps/
RUN sh -c 'touch /usr/local/tomcat/webapps/Bookstore-1.war'
ENTRYPOINT ["sh", "-c" , "java -Djava.security.edg=file:/dev/./urandom -jar /usr/local/tomcat/webapps/Bookstore-1.war]

pom.xml

<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>net.codejava.javaee.bookstore</groupId>
<artifactId>Bookstore</artifactId>
<version>1</version>
<packaging>war</packaging>

<properties>
<docker.image.prefix>alesblaze</docker.image.prefix>
</properties>

<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</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>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<finalName>BookStore</finalName>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>

<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>Docker</dockerDirectory>
<dockerHost>http://localhost:2377</dockerHost>
<forceTags>true</forceTags>
<imageTags>
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
<serverId>docker-hub</serverId>
<registryUrl>http://hub.docker.com/</registryUrl>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.war</include>
</resource>
</resources>
</configuration>
<!-- <executions> -->
<!-- <execution> -->
<!-- <phase>package</phase> -->
<!-- <goals> -->
<!-- <goal>build</goal> -->
<!-- </goals> -->
<!-- </execution> -->
<!-- </executions> -->
</plugin>

</plugins>
</build>

</project>

有人可以向我解释这里出了什么问题以及如何解决吗?

我正在尝试在运行 tomcat 的容器中部署示例 java web 应用程序,并且我正在使用 maven 构建 war 文件,但是当我运行 mvn clean package docker:build 时(我正在使用 maven 的构建 dockerfile 的 spotify 插件)

在构建阶段,它显示了 NoHttpResponseException ,幕后出了什么问题?

最佳答案

尝试端口 8080,这通常是本地主机的默认端口。

关于java - org.apache.http.NoHttpResponseException :localhost:2377 failed to respond,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58048156/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com