我在 minishift 上使用 Java 应用程序时遇到问题。构建看起来不错,但部署失败。
我有以下错误:
Starting the Java application using /opt/jboss/container/java/run/run-java.sh ...
INFO exec java -javaagent:/opt/jboss/container/jolokia/jolokia.jar=config=/opt/jboss/container/jolokia/etc/jolokia.properties -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:+ExitOnOutOfMemoryError -cp "." -jar /deployments/demo-0.0.1-SNAPSHOT.jar
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
no main manifest attribute, in /deployments/demo-0.0.1-SNAPSHOT.jar
最佳答案
看起来您的最终图像没有META-INF/MANIFEST.MF。
对于您的应用程序,您应该有一个像这样的 pom.xml:
<build>
<plugins>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.mypackage.MyClass</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
Openshift 将为您创建 META-INF/MANIFEST.MF
。
关于java - Minishift - Pod 未启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60661140/