Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browse Bean template errors on editing Regex Pattern #378

Closed
ldko opened this issue May 11, 2021 · 0 comments · Fixed by #379
Closed

Browse Bean template errors on editing Regex Pattern #378

ldko opened this issue May 11, 2021 · 0 comments · Fixed by #379

Comments

@ldko
Copy link
Contributor

ldko commented May 11, 2021

When trying to edit the regular expression of a MatchesListRegexDecideRule in a built job via the Browse Beans interface, there is an error rendering the page.

broken_edit_form_cropped

In the data structure used by writeHTML, the bean for the editable Pattern now includes properties (pattern and flags) that were not in the structure before the Spring upgrade:...bean={class=java.util.regex.Pattern, properties=[{field=pattern, class=java.lang.String, propValue=^https?://blah/.*$}, {field=flags, class=java.lang.Integer, propValue=0}]}.... Because there is not an associated url provided for these properties in the structure it causes the following error:

Expression bean.url is undefined on line 128, column 81 in Beans.ftl.
The problematic instruction:
----------
==> ${bean.url} [on line 128, column 79 in Beans.ftl]
 in user-directive beanTemplate [on line 156, column 21 in Beans.ftl]
 in user-directive beanTemplate [on line 73, column 65 in Beans.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression bean.url is undefined on line 128, column 81 in Beans.ftl.
	at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
	at freemarker.core.Expression.getStringValue(Expression.java:118)
	at freemarker.core.Expression.getStringValue(Expression.java:93)
	at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.MixedContent.accept(MixedContent.java:92)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.IfBlock.accept(IfBlock.java:82)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.MixedContent.accept(MixedContent.java:92)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.MixedContent.accept(MixedContent.java:92)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.Macro$Context.runMacro(Macro.java:172)
	at freemarker.core.Environment.visit(Environment.java:614)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.MixedContent.accept(MixedContent.java:92)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167)
	at freemarker.core.Environment.visit(Environment.java:428)
	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.MixedContent.accept(MixedContent.java:92)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.MixedContent.accept(MixedContent.java:92)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.Macro$Context.runMacro(Macro.java:172)
	at freemarker.core.Environment.visit(Environment.java:614)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.MixedContent.accept(MixedContent.java:92)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.IfBlock.accept(IfBlock.java:82)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.MixedContent.accept(MixedContent.java:92)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.MixedContent.accept(MixedContent.java:92)
	at freemarker.core.Environment.visit(Environment.java:221)
	at freemarker.core.Environment.process(Environment.java:199)
	at freemarker.template.Template.process(Template.java:259)
	at org.archive.crawler.restlet.BeanBrowseResource.writeHtml(BeanBrowseResource.java:250)
	at org.archive.crawler.restlet.BeanBrowseResource$2.write(BeanBrowseResource.java:163)
	at org.restlet.representation.CharacterRepresentation.write(CharacterRepresentation.java:67)
	at org.restlet.engine.adapter.ServerCall.writeResponseBody(ServerCall.java:507)
	at org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:451)
	at org.restlet.ext.jetty.internal.JettyServerCall.sendResponse(JettyServerCall.java:309)
	at org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:191)
	at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144)
	at org.restlet.ext.jetty.JettyServerHelper$WrappedServer.handle(JettyServerHelper.java:237)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
	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.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:427)
	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:321)
	at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:159)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	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:781)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:917)
	at java.base/java.lang.Thread.run(Thread.java:834)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant