JVM 在打印堆栈跟踪时崩溃

如何解决JVM 在打印堆栈跟踪时崩溃

我想将异常堆栈跟踪转换为 C 中的字符串。 我有这个代码:

(main.c)

#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

int main() {
  JavaVM *jvm;
  JNIEnv *env;
  JavaVMInitArgs vm_args;
  JavaVMOption *options = calloc(3,sizeof(JavaVMOption));
  assert(options);
  options[0].optionString = "-Djava.class.path=/usr/lib/java:.";
  options[1].optionString = "--enable-preview";
  options[2].optionString = "-XX:+ShowCodeDetailsInExceptionMessages";
  vm_args.version = JNI_VERSION_10;
  vm_args.nOptions = 3;
  vm_args.options = options;
  vm_args.ignoreUnrecognized = 0;
  jint status=JNI_CreateJavaVM(&jvm,(void **)&env,&vm_args);
  assert(status==JNI_OK);
  free(options);
  jclass cls = (*env)->FindClass(env,"A");
  assert(cls==NULL);
  jthrowable throwable=(*env)->ExceptionOccurred(env);
  if (throwable) {
    (*env)->ExceptionClear(env);
    //Following is based on: https://stackoverflow.com/a/1149721/13912132
    jclass stringWriter = (*env)->FindClass(env,"java/io/StringWriter");
    assert(stringWriter);
    jclass printWriter = (*env)->FindClass(env,"java/io/PrintWriter");
    assert(printWriter);
    jmethodID noArgsConstructor =
        (*env)->GetMethodID(env,stringWriter,"<init>","()V");
    assert(noArgsConstructor);
    jmethodID printWriterConstructor =
        (*env)->GetMethodID(env,printWriter,"(Ljava/io/Writer;)V");
    assert(printWriterConstructor);
    jobject sw = (*env)->NewObject(env,noArgsConstructor);
    assert(sw);
    jobject pw = (*env)->NewObject(env,printWriterConstructor,printWriter);
    assert(pw);
    jmethodID printStackTrace =
        (*env)->GetMethodID(env,(*env)->GetObjectClass(env,throwable),"printStackTrace","(Ljava/io/PrintWriter;)V");
    assert(printStackTrace);
    jstring string =
        (*env)->CallObjectMethod(env,throwable,printStackTrace,pw);
    printf("%s\n",(*env)->GetStringUTFChars(env,string,NULL));
  }
  (*jvm)->DestroyJavaVM(jvm);
}

(A.java)

public class A extends B{}

(B.java)

public class B{}

要重现此崩溃:

  1. 编译 main.c (gcc -I $JAVA_HOME/include -I $JAVA_HOME/include/linux main.c -L $JAVA_HOME/lib/server -ljvm -g3 -Og)
  2. 编译 A.java 和 B.java (javac *.java)
  3. 移除B.class(所以加载A失败)

现在我想执行a.out:

$./a.out
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f3a78062056,pid=280779,tid=280779
#
# JRE version: OpenJDK Runtime Environment (15.0.1+9) (build 15.0.1+9-Debian-3)
# Java VM: OpenJDK 64-Bit Server VM (15.0.1+9-Debian-3,mixed mode,sharing,tiered,compressed oops,g1 gc,linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x534056]
#
# Core dump will be written. Default location: /home/<userName>/dir/core
#
# An error report file with more information is saved as:
# /home/<userName>/dir/hs_err_pid280779.log
#
# If you would like to submit a bug report,please visit:
#   https://bugs.debian.org/openjdk-15
#
Aborted (core dumped)

对应的崩溃文件如下所示:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f3a78062056,linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x534056]
#
# Core dump will be written. Default location: /home/<userName>/dir/core
#
# If you would like to submit a bug report,please visit:
#   https://bugs.debian.org/openjdk-15
#

---------------  S U M M A R Y ------------

Command Line: --enable-preview -XX:+ShowCodeDetailsInExceptionMessages 

Host: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz,8 cores,7G,Debian GNU/Linux bullseye/sid
Time: Sat Jan  2 08:35:27 2021 CET elapsed time: 0.039155 seconds (0d 0h 0m 0s)

---------------  T H R E A D  ---------------

Current thread (0x00005568f9ab4dc0):  JavaThread "main" [_thread_in_vm,id=280779,stack(0x00007ffc508ef000,0x00007ffc509ef000)]

Stack: [0x00007ffc508ef000,0x00007ffc509ef000],sp=0x00007ffc509ed070,free space=1016k
Native frames: (J=compiled Java code,A=aot compiled Java code,j=interpreted,Vv=VM code,C=native code)
V  [libjvm.so+0x534056]
V  [libjvm.so+0x53413d]
V  [libjvm.so+0x9d6656]
V  [libjvm.so+0x9d8103]
V  [libjvm.so+0x77ff88]
V  [libjvm.so+0x780567]
j  java.io.PrintWriter.write(Ljava/lang/String;II)V+19 java.base@15.0.1
j  java.io.PrintWriter.write(Ljava/lang/String;)V+7 java.base@15.0.1
j  java.io.PrintWriter.print(Ljava/lang/String;)V+5 java.base@15.0.1
j  java.io.PrintWriter.println(Ljava/lang/Object;)V+14 java.base@15.0.1
j  java.lang.Throwable$WrappedPrintWriter.println(Ljava/lang/Object;)V+5 java.base@15.0.1
j  java.lang.Throwable.printStackTrace(Ljava/lang/Throwable$PrintStreamOrWriter;)V+28 java.base@15.0.1
j  java.lang.Throwable.printStackTrace(Ljava/io/PrintWriter;)V+9 java.base@15.0.1
v  ~StubRoutines::call_stub
V  [libjvm.so+0x784c49]
V  [libjvm.so+0x8193eb]
V  [libjvm.so+0x819eec]

Java frames: (J=compiled Java code,Vv=VM code)
j  java.io.PrintWriter.write(Ljava/lang/String;II)V+19 java.base@15.0.1
j  java.io.PrintWriter.write(Ljava/lang/String;)V+7 java.base@15.0.1
j  java.io.PrintWriter.print(Ljava/lang/String;)V+5 java.base@15.0.1
j  java.io.PrintWriter.println(Ljava/lang/Object;)V+14 java.base@15.0.1
j  java.lang.Throwable$WrappedPrintWriter.println(Ljava/lang/Object;)V+5 java.base@15.0.1
j  java.lang.Throwable.printStackTrace(Ljava/lang/Throwable$PrintStreamOrWriter;)V+28 java.base@15.0.1
j  java.lang.Throwable.printStackTrace(Ljava/io/PrintWriter;)V+9 java.base@15.0.1
v  ~StubRoutines::call_stub

siginfo: si_signo: 11 (SIGSEGV),si_code: 1 (SEGV_MAPERR),si_addr: 0x0000000000000039

Register to memory mapping:

RAX=0x0000000000000011 is an unknown value
RBX=0x00007ffc509ed0f0 is pointing into the stack for thread: 0x00005568f9ab4dc0
RCX=0x0000000020000001 is an unknown value
RDX=0x0000000800149798 is a pointer to class: 
java.io.Writer {0x0000000800149798}
RSP=0x00007ffc509ed070 is pointing into the stack for thread: 0x00005568f9ab4dc0
RBP=0x00007ffc509ed080 is pointing into the stack for thread: 0x00005568f9ab4dc0
RSI=0x00000000fffffffe points into unknown readable memory: 00 00
RDI=0x00000008000097a8 is a pointer to class: 
java.lang.constant.Constable {0x00000008000097a8}
R8 =0x00005568f9ab5450 points into unknown readable memory: 0x00000008000270b0 | b0 70 02 00 08 00 00 00
R9 =0x00007ffc509ed0f0 is pointing into the stack for thread: 0x00005568f9ab4dc0
R10=0x00000008003fd6f8 is pointing into metadata
R11=0x000000080041c940 is pointing into metadata
R12=0x0 is NULL
R13=0x00007ffc509ed0f0 is pointing into the stack for thread: 0x00005568f9ab4dc0
R14=0x000000000000000f is an unknown value
R15=0x00007ffc509ed170 is pointing into the stack for thread: 0x00005568f9ab4dc0


Registers:
RAX=0x0000000000000011,RBX=0x00007ffc509ed0f0,RCX=0x0000000020000001,RDX=0x0000000800149798
RSP=0x00007ffc509ed070,RBP=0x00007ffc509ed080,RSI=0x00000000fffffffe,RDI=0x00000008000097a8
R8 =0x00005568f9ab5450,R9 =0x00007ffc509ed0f0,R10=0x00000008003fd6f8,R11=0x000000080041c940
R12=0x0000000000000000,R13=0x00007ffc509ed0f0,R14=0x000000000000000f,R15=0x00007ffc509ed170
RIP=0x00007f3a78062056,EFLAGS=0x0000000000010202,CSGSFS=0x002b000000000033,ERR=0x0000000000000004
  TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007ffc509ed070)
0x00007ffc509ed070:   00005568f9ab4dc0 00007ffc509ed0f0
0x00007ffc509ed080:   00007ffc509ed0c0 00007f3a7806213d
0x00007ffc509ed090:   00007ffc509ed150 00007f3a78503fca
0x00007ffc509ed0a0:   00007ffc509ed0e0 00007ffc509ed290 

Instructions: (pc=0x00007f3a78062056)
0x00007f3a78061f56:   c3 66 0f 1f 84 00 00 00 00 00 e8 fb 56 5a 00 83
0x00007f3a78061f66:   f0 01 84 c0 74 e4 48 8d 05 a8 42 c5 00 80 38 00
0x00007f3a78061f76:   75 08 b8 01 00 00 00 eb d3 90 4c 8d 25 84 42 c5
0x00007f3a78061f86:   00 41 80 3c 24 00 74 c2 48 8d 05 c3 d3 cb 00 80
0x00007f3a78061f96:   38 00 74 b6 48 8b 3b 8b 47 20 85 c0 79 6a a9 00
0x00007f3a78061fa6:   00 00 40 74 a5 48 8d 05 d6 2c c5 00 8b 00 83 f8
0x00007f3a78061fb6:   01 0f 94 c0 eb 96 0f 1f 40 00 48 8d 05 f9 3e c5
0x00007f3a78061fc6:   00 80 38 00 74 2c be 01 00 00 00 e8 8a 56 5a 00
0x00007f3a78061fd6:   84 c0 74 92 48 8b 3b be 04 00 00 00 e8 79 56 5a
0x00007f3a78061fe6:   00 84 c0 0f 85 61 ff ff ff e9 78 ff ff ff 0f 1f
0x00007f3a78061ff6:   40 00 48 8d 05 ed 2c c5 00 8b 30 e8 5a 56 5a 00
0x00007f3a78062006:   83 f0 01 e9 5a ff ff ff e8 dd 9f 5a 00 84 c0 0f
0x00007f3a78062016:   84 35 ff ff ff 41 80 3c 24 00 0f 84 2a ff ff ff
0x00007f3a78062026:   eb 83 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 54
0x00007f3a78062036:   45 31 e4 53 48 89 fb 48 8b 3f f6 47 21 04 75 3d
0x00007f3a78062046:   48 8d 05 bc 41 c5 00 80 38 00 74 0c 48 8b 47 08
0x00007f3a78062056:   66 81 78 28 40 1f 77 25 0f b7 47 28 83 e8 06 66
0x00007f3a78062066:   83 f8 20 77 25 48 8d 15 a2 90 98 00 0f b7 c0 48
0x00007f3a78062076:   63 04 82 48 01 d0 ff e0 66 90 45 31 e4 44 89 e0
0x00007f3a78062086:   5b 41 5c 5d c3 0f 1f 44 00 00 83 fe fe 74 23 8d
0x00007f3a78062096:   46 ff 45 31 e4 83 f8 03 77 e3 e8 bb 55 5a 00 5b
0x00007f3a780620a6:   83 f0 01 41 89 c4 44 89 e0 41 5c 5d c3 0f 1f 44
0x00007f3a780620b6:   00 00 48 8d 05 01 3e c5 00 44 0f b6 20 45 84 e4
0x00007f3a780620c6:   74 28 be 01 00 00 00 e8 8e 55 5a 00 84 c0 74 ad
0x00007f3a780620d6:   48 8b 3b be 04 00 00 00 e8 7d 55 5a 00 83 f0 01
0x00007f3a780620e6:   41 89 c4 eb 98 0f 1f 44 00 00 48 8d 05 f5 2b c5
0x00007f3a780620f6:   00 8b 30 e8 62 55 5a 00 83 f0 01 41 89 c4 e9 7a
0x00007f3a78062106:   ff ff ff 90 66 0f 1f 44 00 00 48 8b 07 48 8b 40
0x00007f3a78062116:   40 48 85 c0 74 04 c3 0f 1f 00 55 48 89 e5 41 55
0x00007f3a78062126:   41 54 49 89 fc 53 48 89 f3 be fe ff ff ff 48 83
0x00007f3a78062136:   ec 18 e8 f3 fe ff ff 84 c0 74 4a 48 8d 05 d3 40
0x00007f3a78062146:   c5 00 80 38 00 74 53 4c 8d 2d b7 40 c5 00 41 80 
....

(整个日志:https://pastebin.com/ZGEQPw3y,因为它太长了)

我使用的是 debian sid,java 15

openjdk 15.0.1 2020-10-20
OpenJDK Runtime Environment (build 15.0.1+9-Debian-3)
OpenJDK 64-Bit Server VM (build 15.0.1+9-Debian-3,sharing)

如果我不添加任何命令行参数,它甚至会崩溃。

编辑: 回溯 (gdb) 是:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fd526b0f537 in __GI_abort () at abort.c:79
#2  0x00007fd526ebd3b3 in os::abort (dump_core=<optimized out>,siginfo=<optimized out>,context=<optimized out>) at ./src/hotspot/os/linux/os_linux.cpp:1542
#3  0x00007fd527ac388a in VMError::report_and_die (id=<optimized out>,message=message@entry=0x0,detail_fmt=<optimized out>,detail_args=detail_args@entry=0x7ffef14f0ba8,thread=thread@entry=0x55d76b440d50,pc=pc@entry=0x7fd5271e3056 <CompilationPolicy::can_be_compiled(methodHandle const&,int)+38> "f\201x(@\037w%\017\267G(\203\350\006f\203\370 w%H\215\025\242\220\230",siginfo=0x7ffef14f0f30,context=0x7ffef14f0e00,filename=<optimized out>,lineno=0,size=0) at ./src/hotspot/share/utilities/vmError.cpp:1635
#4  0x00007fd527ac40cb in VMError::report_and_die (thread=thread@entry=0x55d76b440d50,sig=sig@entry=11,siginfo=siginfo@entry=0x7ffef14f0f30,context=context@entry=0x7ffef14f0e00,detail_fmt=detail_fmt@entry=0x7fd527b848ae "%s") at ./src/hotspot/share/utilities/vmError.cpp:1315
#5  0x00007fd527ac40fe in VMError::report_and_die (thread=thread@entry=0x55d76b440d50,context=context@entry=0x7ffef14f0e00) at ./src/hotspot/share/utilities/vmError.cpp:1321
#6  0x00007fd527800fc2 in JVM_handle_linux_signal (sig=sig@entry=11,info=info@entry=0x7ffef14f0f30,ucVoid=ucVoid@entry=0x7ffef14f0e00,abort_if_unrecognized=abort_if_unrecognized@entry=1)
    at ./src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp:601
#7  0x00007fd5277f4738 in signalHandler (sig=11,info=0x7ffef14f0f30,uc=0x7ffef14f0e00) at ./src/hotspot/os/linux/os_linux.cpp:4738
#8  <signal handler called>
#9  0x00007fd5271e3056 in CompilationPolicy::can_be_compiled (m=...,comp_level=-2) at ./src/hotspot/share/compiler/compilationPolicy.cpp:118
#10 0x00007fd5271e313d in CompilationPolicy::must_be_compiled (comp_level=-2,m=...) at ./src/hotspot/share/compiler/compilationPolicy.cpp:79
#11 CompilationPolicy::compile_if_required (selected_method=...,__the_thread__=__the_thread__@entry=0x55d76b440d50) at ./src/hotspot/share/compiler/compilationPolicy.cpp:86
#12 0x00007fd527685656 in CallInfo::set_common (__the_thread__=<optimized out>,index=15,kind=CallInfo::vtable_call,selected_method=...,resolved_method=...,resolved_klass=0x800149798,this=0x7ffef14f16d0)
    at ./src/hotspot/share/interpreter/linkResolver.cpp:128
#13 CallInfo::set_virtual (__the_thread__=<optimized out>,vtable_index=15,this=0x7ffef14f16d0) at ./src/hotspot/share/interpreter/linkResolver.cpp:91
#14 LinkResolver::runtime_resolve_virtual_method (result=...,resolved_klass=<optimized out>,recv=...,recv@entry=...,recv_klass=recv_klass@entry=0x800007438,check_null_and_abstract=check_null_and_abstract@entry=true,__the_thread__=<optimized out>) at ./src/hotspot/share/interpreter/linkResolver.cpp:1424
#15 0x00007fd527687103 in LinkResolver::resolve_virtual_call (__the_thread__=0x55d76b440d50,check_null_and_abstract=true,link_info=...,receiver_klass=0x800007438,result=...)
    at ./src/hotspot/share/interpreter/linkResolver.cpp:1311
#16 LinkResolver::resolve_invokevirtual (__the_thread__=0x55d76b440d50,index=<optimized out>,pool=...,result=...) at ./src/hotspot/share/interpreter/linkResolver.cpp:1689
#17 LinkResolver::resolve_invoke (result=...,byte=byte@entry=Bytecodes::_invokevirtual,__the_thread__=__the_thread__@entry=0x55d76b440d50)
    at ./src/hotspot/share/interpreter/linkResolver.cpp:1633
#18 0x00007fd52742ef88 in InterpreterRuntime::resolve_invoke (thread=thread@entry=0x55d76b440d50,bytecode=Bytecodes::_invokevirtual) at ./src/hotspot/share/interpreter/interpreterRuntime.cpp:854
#19 0x00007fd52742f567 in InterpreterRuntime::resolve_from_cache (thread=0x55d76b440d50,bytecode=<optimized out>) at ./src/hotspot/share/interpreter/interpreterRuntime.cpp:991
#20 0x00007fd50efb1aac in ?? ()
#21 0x00007fd5087300f0 in ?? ()
#22 0x00007fd50efb1a72 in ?? ()
#23 0x0000000000000021 in ?? ()
#24 0x0000000000000000 in ?? ()

编辑 2:

在尝试解决这个问题时,我反汇编了 PrintWriter::write:

public void write(java.lang.String,int,int);
    descriptor: (Ljava/lang/String;II)V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=4,locals=6,args_size=4
         0: aload_0
         1: getfield      #97                 // Field lock:Ljava/lang/Object;
         4: dup
         5: astore        4
         7: monitorenter
         8: aload_0
         9: invokevirtual #101                // Method ensureOpen:()V
        12: aload_0
        13: getfield      #43                 // Field out:Ljava/io/Writer;
        16: aload_1
        17: iload_2
        18: iload_3
        19: invokevirtual #136      <--This instruction is crashing          // Method java/io/Writer.write:(Ljava/lang/String;II)V`
        22: aload         4
        24: monitorexit
        25: goto          36
        28: astore        5
        30: aload         4
        32: monitorexit
        33: aload         5
        35: athrow
        36: goto          57
        39: astore        4
        41: invokestatic  #123                // Method java/lang/Thread.currentThread:()Ljava/lang/Thread;
        44: invokevirtual #129                // Method java/lang/Thread.interrupt:()V
        47: goto          57
        50: astore        4
        52: aload_0
        53: iconst_1
        54: putfield      #35                 // Field trouble:Z
        57: return

我能够在 Windows 上重现它。 (Java 15 也是)

编辑 3:

#include <assert.h>
#include <jni.h>
#include <stdio.h>
#include <stdlib.h>

int main() {
  JavaVM *jvm;
  JNIEnv *env;
  JavaVMInitArgs vm_args;
  JavaVMOption *options = calloc(3,sizeof(JavaVMOption));
  assert(options);
  options[0].optionString = "-Djava.class.path=/usr/lib/java:.";
  options[1].optionString = "-verbose";
  options[2].optionString = "-Xcheck:jni";
  vm_args.version = JNI_VERSION_10;
  vm_args.nOptions = 3;
  vm_args.options = options;
  vm_args.ignoreUnrecognized = 0;
  jint status = JNI_CreateJavaVM(&jvm,&vm_args);
  assert(status == JNI_OK);
  free(options);
  jclass cls = (*env)->FindClass(env,"A");
  assert(cls == NULL);
  jthrowable throwable = (*env)->ExceptionOccurred(env);
  (*env)->ExceptionDescribe(env);
  if (throwable) {
    (*env)->ExceptionClear(env);
    jclass stringWriter = (*env)->FindClass(env,"(Ljava/io/PrintWriter;)V");
    assert(printStackTrace);
    (*env)->CallVoidMethod(env,pw);
    jmethodID mid = (*env)->GetMethodID(env,"toString","()Ljava/lang/String;");
    printf("%s\n",(*env)->GetStringUTFChars(
                       env,(*env)->CallObjectMethod(env,sw,mid),NULL));
  }
  (*jvm)->DestroyJavaVM(jvm);
}

我用 CallObjectMethod 解决了这个问题,但它仍然崩溃。

解决方法

这段代码有两个问题:

问题一:

jstring string =
        (*env)->CallObjectMethod(env,throwable,printStackTrace,pw);

printStackTrace 是一种空方法,不返回任何内容。如果此调用成功,则 string 中将出现垃圾。

固定代码:

(*env)->CallObjectMethod(env,sw);
jmethodID mid = (*env)->GetMethodID(env,stringWriter,"toString","()Ljava/lang/String;");
jstring string = (*env)->CallObjectMethod(env,sw,mid);

第二个问题(感谢您指出@apangin)是,这一行:

jobject pw = (*env)->NewObject(env,printWriter,printWriterConstructor,printWriter);

通常,我想调用的printwriter构造函数的签名是:

PrintWriter(Writer w);

但是我以某种方式把它和参数搞混了,并传递了印刷机的类,所以它本质上就像执行:

PrintWriter(Class<PrintWriter>);

这一直有效到 java.io.PrintWriter.write(Ljava/lang/String;II)V+19,因为第一次访问坏对象,导致崩溃。

现在正确的行是:

jobject pw = (*env)->NewObject(env,sw);

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-