Ask a Question

Previously working test no longer works...

New Contributor

Previously working test no longer works...



I have been asked to run a ReadyAPI test that was last run about a year ago.


I am now getting this groovy error when I try to run it:



startup failed:
Script3.groovy: 1: Unexpected input: '\' @ line 1, column 86.
   eDateFormat; use(TimeCategory)\u007B new
org.codehaus.groovy.syntax.SyntaxException: Unexpected input: '\' @ line 1, column 86.
	at org.apache.groovy.parser.antlr4.AstBuilder$1.syntaxError(
	at groovyjarjarantlr4.v4.runtime.ProxyErrorListener.syntaxError(
	at groovyjarjarantlr4.v4.runtime.Parser.notifyErrorListeners(
	at groovyjarjarantlr4.v4.runtime.DefaultErrorStrategy.notifyErrorListeners(
	at org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy.reportInputMismatch(
	at org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy.recover(
	at org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy.recoverInline(
	at groovyjarjarantlr4.v4.runtime.Parser.match(
	at org.apache.groovy.parser.antlr4.GroovyParser.compilationUnit(
	at org.apache.groovy.parser.antlr4.AstBuilder.buildCST(
	at org.apache.groovy.parser.antlr4.AstBuilder.buildCST(
	at org.apache.groovy.parser.antlr4.AstBuilder.buildAST(
	at org.apache.groovy.parser.antlr4.Antlr4ParserPlugin.buildAST(
	at org.codehaus.groovy.control.SourceUnit.buildAST(
	at java.base/java.util.Iterator.forEachRemaining(
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(
	at java.base/$Head.forEach(
	at org.codehaus.groovy.control.CompilationUnit.buildASTs(
	at org.codehaus.groovy.control.CompilationUnit.compile(
	at groovy.lang.GroovyClassLoader.doParseClass(
	at groovy.lang.GroovyClassLoader.lambda$parseClass$3(
	at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(
	at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(
	at groovy.lang.GroovyClassLoader.parseClass(
	at groovy.lang.GroovyShell.parseClass(
	at groovy.lang.GroovyShell.parse(
	at groovy.lang.GroovyShell.parse(
	at groovy.lang.GroovyShell.parse(
	at com.eviware.soapui.model.propertyexpansion.resolvers.EvalPropertyResolver.doEval(
	at com.eviware.soapui.model.propertyexpansion.resolvers.EvalPropertyResolver.resolveProperty(
	at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(
	at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(
	at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(
	at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(
	at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expandProperties(
	at com.eviware.soapui.impl.wsdl.submit.filters.PropertyExpansionRequestFilter.filterAbstractHttpRequest(
	at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(
	at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.filterRequest(
	at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(
	at java.base/java.util.concurrent.Executors$
	at java.base/
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/

1 error



I get this error when it tries to evaluate this:



${=import groovy.time.TimeCategory; import java.text.SimpleDateFormat; use(TimeCategory)\u007B new SimpleDateFormat("yyyy/MM/dd").format(new Date("${#Project#birthDate0an}") - 58.year)\u007D}



The code in question is put in a custom project property and birthDate0an exists and it is correctly initialized.


Now as far as I can see the parsing of the groovy code fails at the "\u007B" (right curly bracket code in Unicode).


Now I tried to replace "\u007B" by "{" and "\u007D" by "}" and it did not work so it looks like the inner curly brackets must be escaped.


The only thing I can think could have changed between now and 1 year ago when that test was last run is the version of ReadyAPI.


What can I do to make this test work again?


Thank you and have a nice day!



Frequent Contributor

Hey @LostInSpace 


Could you please provide more details?, like what is expected output format, and what format you are passing in 

Community Hero

Hey @LostInSpace,

I suspect youve stumbled across a change that occurred within the last year. A lot of people had this.... i believe a date handling method in the jre was deprecated in the newer version of java or something similar

Im typing on my phone right now,but when i get back to my laptop i'll post what i started using instead.


if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
SmartBear Alumni (Retired)

Thank you @richie ! That would be awesome if you could share your approach here!

Sonya Mihaljova
Community and Education Specialist

Community Hero

There are changes in data time libraries from Jdk 8.

Try something like below:


	"date": "${= import java.time.LocalDate; import java.time.format.DateTimeFormatter; LocalDate.from(LocalDate.parse('2021/03/01', DateTimeFormatter.ofPattern('yyyy/MM/dd'))).minusYears(58)}"

SmartBear Alumni (Retired)

Thanks Rao!

@LostInSpace did you give the suggested script a go?

Sonya Mihaljova
Community and Education Specialist

Showing results for 
Search instead for 
Did you mean: