【问题标题】:How to solve "WrapperSimpleApp: Unable to locate the class ..." in tanukisoftware wrapper如何解决 tanukisoftware 包装器中的“WrapperSimpleApp: Unable to locate the class ...”
【发布时间】:2020-08-17 05:26:01
【问题描述】:

运行 tanukisoftware wrapper 时出现错误。

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文件。那么,如何解决这个错误。

【问题讨论】:

    标签: java maven wrapper maven-assembly-plugin


    【解决方案1】:

    我找到了解决方案。来自 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替换了appassembler-maven-plugin生成的jar文件。

    【讨论】:

    • 谢谢,它正在和我一起工作。我使用版本 spring boot 2.4.0
    猜你喜欢
    • 1970-01-01
    • 2016-04-03
    • 2011-05-22
    • 1970-01-01
    • 2020-05-13
    • 2022-12-26
    • 1970-01-01
    • 2019-09-29
    • 2017-07-10
    相关资源
    最近更新 更多