如何在tanukisoftware包装器中解决“ WrapperSimpleApp:无法找到类...”

问题描述

运行tanukisoftware包装程序时出现错误。

wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software,Inc.  All Rights Reserved.
jvm 1    | 
jvm 1    | WrapperSimpleApp: Unable to locate the class com.aplova.productimagesautouploader.ProductImagesAutoUploaderApplication.class: java.lang.ClassNotFoundException: com.aplova.productimagesautouploader.ProductImagesAutoUploaderApplication.class
jvm 1    | 
jvm 1    | WrapperSimpleApp Usage:
jvm 1    |   java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class} [app_arguments]
jvm 1    | 
jvm 1    | Where:
jvm 1    |   app_class:      The fully qualified class name of the application to run.
jvm 1    |   app_arguments:  The arguments that would normally be passed to the
jvm 1    |                   application.
wrapper  | <-- Wrapper Stopped

我是创建包装器的新手,对此错误一无所知。 我的wrapper.conf看起来像这样,

#********************************************************************
# Wrapper Properties
#********************************************************************
# Java Application
wrapper.java.command=java
wrapper.working.dir=..

# Java Main class.  This class must implement the WrapperListener interface
#  or guarantee that the WrapperManager class is initialized.  Helper
#  classes are provided to do this for you.  See the Integration section
#  of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
set.default.REPO_DIR=lib
set.APP_BASE=.

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
wrapper.java.classpath.1=lib/wrapper.jar
wrapper.java.classpath.2=conf
wrapper.java.classpath.3=%REPO_DIR%/product-images-auto-uploader-0.0.1-SNAPSHOT.jar
wrapper.java.classpath.4=%REPO_DIR%/spring-boot-configuration-processor-2.3.2.RELEASE.jar
wrapper.java.classpath.5=%REPO_DIR%/thumbnailator-0.4.11.jar

并且lib目录也需要jar文件。因此,如何解决此错误。

解决方法

我找到了解决方案。来自pom.xml的错误。在pom中有

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> 

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>appassembler-maven-plugin</artifactId>
    <version>1.10</version>
    <configuration>
    ...

两个插件。但唯一需要的插件是appassembler-maven-plugin。因此,删除spring-boot-maven-plugin后,它就可以工作了。

结论是,由于spring-boot-maven-plugin生成的jar替换appassembler-maven-plugin文件而导致此错误。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...