feat : 模拟执行报错
This commit is contained in:
@@ -100,7 +100,8 @@ public class JavaCodeEngine {
|
||||
// 设置安全检查器
|
||||
System.setSecurityManager(securityManager);
|
||||
// 执行方法并返回结果
|
||||
return ConsoleCapture.capture(() -> method.invoke(null, args));
|
||||
return new EngineResult(method.invoke(null, args), null);
|
||||
// return ConsoleCapture.capture(() -> method.invoke(null, args));
|
||||
} catch (CustomException e) {
|
||||
EngineResult result = new EngineResult();
|
||||
result.setSuccess(Boolean.FALSE);
|
||||
@@ -279,7 +280,7 @@ public class JavaCodeEngine {
|
||||
}
|
||||
|
||||
|
||||
public void remove(){
|
||||
public void remove() {
|
||||
clazz = null;
|
||||
classLoader = null;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import cn.fateverse.common.code.console.ConsoleCapture;
|
||||
import cn.fateverse.common.code.lock.SegmentLock;
|
||||
import cn.fateverse.common.code.model.EngineResult;
|
||||
import cn.fateverse.common.core.exception.CustomException;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import org.graalvm.polyglot.Context;
|
||||
import org.graalvm.polyglot.Value;
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 162.14.111.170:8848
|
||||
namespace: clay
|
||||
dubbo:
|
||||
registry:
|
||||
parameters:
|
||||
namespace: dubbo-clay
|
||||
code:
|
||||
java:
|
||||
class-path: E:\home\clay\code\
|
||||
seata:
|
||||
service:
|
||||
grouplist:
|
||||
seata-server: 192.168.31.102:8091
|
||||
registry:
|
||||
nacos:
|
||||
namespace: clay
|
||||
config:
|
||||
apollo:
|
||||
namespace: clay
|
||||
|
||||
Reference in New Issue
Block a user