【问题标题】:i have created jar file but its showing the class defnotfound error? how to get away with this?我已经创建了 jar 文件,但它显示类 defnotfound 错误?如何摆脱这个?
【发布时间】:2014-03-05 23:33:27
【问题描述】:

我正在尝试从单个记录器类实现多日志实现,并且我已使用 jar 文件根据模块选择动态加载记录器文件。我收到如下所示的错误 发生了错误。 [返回的错误信息是:“方法 main.com/grpf/Jarclass 中的错误”。

有关其他错误信息,请参阅已部署应用程序中的日志文件夹。

点击这里隐藏详细的错误信息。

方法 main 中的异常错误。 com/grpf/Jarclass

堆栈跟踪 java.lang.NoClassDefFoundError: com/grpf/Jarclass

static WebAppAccess rt;

public static void main(String args[]){
    CommonClassForLogFileSelection1();
}

public static String CommonClassForLogFileSelection1(){

    try{
        if(rt.getModelName().equals("qwe"))
        return "logf2";
        else
            return "CommonECPLogs";
    }catch(final Exception e){
        throw new WebAppRuntimeException( e, "PropertyFileSelectionHandler Has encountered an error while processing a profile" );
    }
}

【问题讨论】:

  • 您是否链接到外部库?

标签: java logging portal


【解决方案1】:

在您的 CLASSPATH 中包含 jar 以便能够链接/使用它

这个SO thread 应该可以帮助你

【讨论】:

    猜你喜欢
    • 2022-11-20
    • 1970-01-01
    • 2015-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多