2017-02-23 3 views
1

내 파이프 라인의 끝에서 메일 빌드를 성공적으로 완료했는지 확인하고 싶습니다. 따라서 나는 다음과 같은 그루비 스크립트를 사용emailext 플러그인을 사용하는 동안 java.lang.StackOverflowError

emailext (
to: '[email protected]', 
subject: 'Job: ' + env.JOB_NAME + '/' +'Build #' + env.BUILD_NUMBER + '/' + ' Summary', 
body:'Integrity Checkout: '+ '\t\t\t' + checkoutStatus +'\n\n' + 'Build1: '+ '\t\t\t' + Build1 + '\n' 
                 + 'Build2 :'+ '\t' + Build2 + '\n' 
                 + 'Build3 :'+ '\t' + Build3 + '\n' 
                 + 'Build4 :'+ '\t' + Build4 + '\n' 
                 + 'Build5 :'+ '\t' + Build5 + '\n' 
                 + 'Build6 :'+ '\t' + Build6 + '\n' 
                 + 'Build7 :'+ '\t' + Build7 + '\n' 
                 + 'Build8 :'+ '\t' + Build8 + '\n' 
                 + 'Build9 :'+ '\t' + Build9 + '\n' 
                 + 'Build10:'+ '\t' + Build10 + '\n' 
                 + 'Build11:'+ '\t' + Build11 + '\n' 
                 + 'Build12:'+ '\t' + Build12 + '\n' 
                 + 'Build13:'+ '\t' + Build13 + '\n' 
                 + 'Build14:'+ '\t' + Build14 + '\n' 
                 + 'Build15:'+ '\t' + Build15 + '\n' 
                 + 'Build16:'+ '\t' + Build16, 
attachLog: true, 
compressLog: true 
) 

기본적으로 코드가 작동하지만 마지막 줄 (build16)를 주석 경우에만 가능합니다. 변수가 올바르게 지정되었습니다. 하지만 코드를 실행하면 java.lang.StackOverflowError가 발생합니다. (1000 라인) 짧은 냈다

는 :

java.lang.StackOverflowError 
at java.lang.Exception.<init>(Unknown Source) 
at java.lang.ReflectiveOperationException.<init>(Unknown Source) 
at java.lang.reflect.InvocationTargetException.<init>(Unknown Source) 
at sun.reflect.GeneratedMethodAccessor4094.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) 
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) 
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) 
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) 
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) 
at com.cloudbees.groovy.cps.CpsTransformer$_visitBinaryExpression_closure26.doCall(CpsTransformer.groovy) 
at sun.reflect.GeneratedMethodAccessor4092.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) 
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) 
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) 
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) 
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) 
at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.groovy:355) 
at sun.reflect.GeneratedMethodAccessor3945.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) 
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) 
at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.groovy:330) 
at sun.reflect.GeneratedMethodAccessor3944.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) 
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174) 
at com.cloudbees.groovy.cps.CpsTransformer.visitBinaryExpression(CpsTransformer.groovy:636) 
at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51) 
at org.codehaus.groovy.ast.expr.BinaryExpression$visit.call(Unknown Source) 
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.groovy:290) 
at sun.reflect.GeneratedMethodAccessor3946.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) 
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) 
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384) 
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) 
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) 
at com.cloudbees.groovy.cps.CpsTransformer$_visitBinaryExpression_closure26.doCall(CpsTransformer.groovy:630) 
at sun.reflect.GeneratedMethodAccessor4094.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) 
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) 
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) 
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) 
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) 
at com.cloudbees.groovy.cps.CpsTransformer$_visitBinaryExpression_closure26.doCall(CpsTransformer.groovy) 
at sun.reflect.GeneratedMethodAccessor4092.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) 
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) 
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) 
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) 
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) 
at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.groovy:355) 
at sun.reflect.GeneratedMethodAccessor3945.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) 
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) 
at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.groovy:330) 
at sun.reflect.GeneratedMethodAccessor3944.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) 
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174) 
at com.cloudbees.groovy.cps.CpsTransformer.visitBinaryExpression(CpsTransformer.groovy:636) 
at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51) 
at org.codehaus.groovy.ast.expr.BinaryExpression$visit.call(Unknown Source) 
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.groovy:290) 
at sun.reflect.GeneratedMethodAccessor3946.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 

답변

1

문제를 해결했다. 엄청난 양의 '+'연산자가 오버플로를 일으켰습니다. 이제 출력 문자열을 빌드하려면 java.lang.StringBuilder.append을 사용했습니다.