Java 我已经创建了jar文件,但是它显示了类defnotfound错误?怎么逃脱这个?
我正在尝试从单个logger类实现多日志实现,并且使用jar文件根据模块选择动态加载logger文件。我得到一个如下所示的错误 发生了一个错误。 [返回的错误消息是:“method main.com/grpf/Jarclass中的错误” 有关其他错误信息,请参阅部署的应用程序中的日志文件夹 单击此处隐藏详细的错误消息 main.com/grpf/Jarclass方法中出现异常错误Java 我已经创建了jar文件,但是它显示了类defnotfound错误?怎么逃脱这个?,java,logging,portal,Java,Logging,Portal,我正在尝试从单个logger类实现多日志实现,并且使用jar文件根据模块选择动态加载logger文件。我得到一个如下所示的错误 发生了一个错误。 [返回的错误消息是:“method main.com/grpf/Jarclass中的错误” 有关其他错误信息,请参阅部署的应用程序中的日志文件夹 单击此处隐藏详细的错误消息 main.com/grpf/Jarclass方法中出现异常错误 static WebAppAccess rt; public static void main(String ar
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.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" );
}
}
在类路径中包含jar,以便能够链接/使用它
这将有助于您了解您是否链接到外部库?