自学java失败,JsonSlurper执行失败

我试图使用JsonSlurper从不同的文件输入变量 . 但它在第二次执行时失败了 . 有人能帮帮我吗?

它从步骤 Jenkins_File_Path = readFile ( "${Local_Path_App}" + "/Jenkinsfile" ) 失败了

Main.groovy

import groovy.json.JsonSlurper

Global_Settings_Path = readFile ("${Main_Local_Path}" + "/Config/GlobalSettings_Java.json" )

def jsonSlurper = new JsonSlurper()

def GlobalVariables = jsonSlurper.parseText(Global_Settings_Path)

Jenkins_File_Path = readFile ( "${Local_Path_App}" + "/Jenkinsfile" )

def jsonSlurper1 = new JsonSlurper()

def json = jsonSlurper1.parseText(Jenkins_File_Path)

GlobalSettings_Java.json

{

"LOB": {

"SVN_Config_Path": "testpath",

"Local_Path_LOB": "test",

}

}

Jenkinsfile

{

"BUILD_INFO": {

"Build_Type" : "Maven",

}

}

Error Logs

java.io.NotSerializableException:groovy.json.internal.LazyMap在org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)在org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java: 65)在org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)在org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)在org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride (RiverObjectOutputStream.java:179)在java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)在java.util.HashMap.internalWriteEntries(HashMap.java:1785)在java.util.HashMap.writeObject(HashMap.java: 1362)在sun.reflect.GeneratedMethodAccessor469.invoke(未知来源)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.invoke(Method.java:498)在org.jboss .marshalling.reflect.SerializableClass.callWriteObject( SerializableClass.java:271)在org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)在org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)在org.jboss.marshalling .river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)在org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)在org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854 )在org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)在org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)在org.jboss.marshalling.river.RiverMarshaller . doWriteSerializableObject(RiverMarshaller.java:967)在org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)在org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)在org.jboss .marshalling.river.RiverMarshaller.doWr iteSerializableObject(RiverMarshaller.java:988)在org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)在org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)在org.jboss .marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)在org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)在org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java :854)在org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)在org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)在org.jboss.marshalling.MarshallerObjectOutputStream . writeObjectOverride(MarshallerObjectOutputStream.java:50)在org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)在java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)在java.util.TreeMap.writeObje CT(TreeMap.java:2438)在sun.reflect.GeneratedMethodAccessor475.invoke(未知来源)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.invoke(Method.java: 498)在org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)在org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)在org.jboss.marshalling.river.RiverMarshaller .doWriteObject(RiverMarshaller.java:854)在org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)在org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)在有机jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)在org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58)在org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111)在org.jenkinsci.plugins.workflow.support.pi ckles.serialization.RiverWriter.writeObject(RiverWriter.java:132)在org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:433)在org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram( CpsThreadGroup.java:412)在org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:357)在org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access $ 100(CpsThreadGroup.java:78)在org.jenkinsci.plugins.workflow.cps.CpsThreadGroup $ 2.call(CpsThreadGroup.java:236)位于org.jenkinsci.plugins的org.jenkinsci.plugins.workflow.cps.CpsThreadGroup $ 2.call(CpsThreadGroup.java:224) . workflow.cps.CpsVmExecutorService $ 2.call(CpsVmExecutorService.java:63)atjava.util.concurrent.FutureTask.run(FutureTask.java:266)位于java的jenkins.util.ContextResettingExecutorService $ 1.run(ContextResettingExecutorService.java:28)的hudson.remoting.SingleLaneExecutorService $ 1.run(SingleLaneExecutorService.java:112) .util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) )java.util.concurrent.ThreadPoolExecutor $ java.lang.Thread.run(Thread.java:745)中的java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)由以下原因引起的异常:在字段调用者中的字段本地对象中的字段程序中的字段e对象org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@7abaf96e中的字段线程完成:FAILURE

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值