You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Ludger Wolter (JIRA)" <ji...@apache.org> on 2019/01/20 14:26:00 UTC

[jira] [Commented] (GROOVY-8792) groovy-json not working from Ant task

    [ https://issues.apache.org/jira/browse/GROOVY-8792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16747472#comment-16747472 ] 

Ludger Wolter commented on GROOVY-8792:
---------------------------------------

I get the same error with groovy-2.5.5. With groovy-2.4.15 the problem did not occur. The groovy classes are called from a Java program.

{code}
java.lang.RuntimeException: Unable to load FastStringService
	at org.apache.groovy.json.internal.FastStringUtils.getService(FastStringUtils.java:57)
	at org.apache.groovy.json.internal.FastStringUtils.toCharArray(FastStringUtils.java:67)
	at org.apache.groovy.json.internal.BaseJsonParser.parse(BaseJsonParser.java:112)
	at groovy.json.JsonSlurper.parseText(JsonSlurper.java:205)
	at groovy.json.JsonSlurper$parseText.call(Unknown Source)
	at de.allfa.inet.EncryptParameter.jsonToINetMap(EncryptParameter.groovy:102)
	at de.allfa.inet.EncryptParameter$jsonToINetMap$0.callStatic(Unknown Source)
	at de.allfa.inet.EncryptParameter.decodeINetParameters(EncryptParameter.groovy:36)
	at de.allfa.inet.EncryptParameter.decodeINetParameters(EncryptParameter.groovy)
	at de.allfa.inet.EncryptParameter$decodeINetParameters.call(Unknown Source)
	at ReportServletWithAllfaReportProperties.checkProperties(ReportServletWithAllfaReportProperties.groovy:80)
	at com.inet.report.util.EngineUtils.createEngine(SourceFile:48)
	at com.inet.report.util.EngineUtils.createReportGenerator(SourceFile:84)
	at com.inet.report.cache.store.b.a(SourceFile:315)
	at com.inet.report.cache.store.b.getKey(SourceFile:276)
	at com.inet.report.cache.Cache.getKey(SourceFile:248)
	at com.inet.report.util.WebUtils.a(SourceFile:519)
	at com.inet.report.servlets.ReportPluginServlet.doExecRequest(SourceFile:268)
	at com.inet.report.servlets.ReportPluginServlet.service(SourceFile:465)
	at com.inet.http.PluginDispatcherServlet.a(SourceFile:284)
	at com.inet.http.PluginDispatcherServlet.doFilter(SourceFile:184)
	at com.inet.webserver.f.doFilter(SourceFile:57)
	at com.inet.http.servlet.FilterLoader$a.doFilter(SourceFile:152)
	at com.inet.webserver.a.doFilter(SourceFile:98)
	at com.inet.http.servlet.FilterLoader$a.doFilter(SourceFile:152)
	at com.inet.remote.gui.modules.login.a.doFilter(SourceFile:41)
	at com.inet.http.servlet.FilterLoader$a.doFilter(SourceFile:152)
	at com.inet.http.servlet.multipart.MultiPartFilter.doFilter(SourceFile:117)
	at com.inet.http.servlet.FilterLoader$a.doFilter(SourceFile:152)
	at com.inet.http.servlet.UploadLimitFilter.doFilter(SourceFile:52)
	at com.inet.http.servlet.FilterLoader.doFilter(SourceFile:77)
	at com.inet.http.PluginDispatcherServlet.service(SourceFile:120)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:867)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1588)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:753)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:502)
	at com.inet.webserver.b.handle(SourceFile:273)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
	at java.base/java.lang.Thread.run(Thread.java:834)
{code}

> groovy-json not working from <groovy> Ant task
> ----------------------------------------------
>
>                 Key: GROOVY-8792
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8792
>             Project: Groovy
>          Issue Type: Bug
>          Components: Ant integration, JSON
>    Affects Versions: 2.5.0
>            Reporter: Gregory Moltchadski
>            Priority: Major
>              Labels: ant, json
>         Attachments: testsuite.7z
>
>
> groovy-json 2.5.X uses java.util.ServiceLoader to load FastStringService and therefore doesn't work in a multi-classloader environment
> build.xml
> {code:xml}
> <project name="test" default="build" basedir=".">
>   <taskdef name="groovy" 
>            classname="org.codehaus.groovy.ant.Groovy" 
>            classpath="groovy-2.5.2.jar:groovy-ant-2.5.2.jar:groovy-json-2.5.2.jar"/>
>   <target name="build">
>     <groovy>
>     <![CDATA[
>       import groovy.json.*
>       def json = new JsonSlurper().parseText('{"person":{"name":"Guillaume","age":33,"pets":["dog","cat"]}}')
>       println new JsonBuilder(json).toPrettyString()
>     ]]>
>     </groovy>
>   </target>
>   
> </project>
> {code}
> Build output:
> {code:xml}
> BUILD FAILED
> C:\test2\build.xml:8: java.lang.RuntimeException: Unable to load FastStringService
>         at org.apache.groovy.json.internal.FastStringUtils.getService(FastStringUtils.java:57)
>         at org.apache.groovy.json.internal.FastStringUtils.toCharArray(FastStringUtils.java:67)
>         at org.apache.groovy.json.internal.BaseJsonParser.parse(BaseJsonParser.java:112)
>         at groovy.json.JsonSlurper.parseText(JsonSlurper.java:205)
>         at groovy.json.JsonSlurper$parseText.call(Unknown Source)
>         at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
>         at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
>         at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
>         at embedded_script_in_C__test2_build_dot_xml.run(embedded_script_in_C__test2_build_dot_xml:2)
>         at org.codehaus.groovy.ant.Groovy.parseAndRunScript(Groovy.java:517)
>         at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:464)
>         at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:322)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>         at org.apache.tools.ant.Task.perform(Task.java:348)
>         at org.apache.tools.ant.Target.execute(Target.java:435)
>         at org.apache.tools.ant.Target.performTasks(Target.java:456)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
>         at org.apache.tools.ant.Main.runBuild(Main.java:851)
>         at org.apache.tools.ant.Main.startAnt(Main.java:235)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)