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

framework: fix leftover Play.getVirtualFile() usage in tags (#198, #291) #522

Merged

Conversation

xabolcs
Copy link
Collaborator

@xabolcs xabolcs commented Feb 10, 2025

"tags/script.tag" and "tags/stylesheet.tag" files were left out from
the rename commit 397f4ca.

Fixes: 397f4ca ("rename 'getVirtualFile()' to just 'file()'")

Extend commit playframework/play1@c8cd95432825 ("wrap original exception
to the TagnternalException") to tags/script.tag to help debugging.
Add an empty page for the helloworld test application for upcoming tag
tests.
Exclude it from uitest-netty4 task, because it casues the very same
TimeoutException (TagsSpec.java was the original file name):

org.openqa.selenium.TimeoutException: Navigation timed out after 30000 ms
Build info: version: '4.28.0', revision: 'ac342546e9'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.8.0-52-generic', java.version: '17.0.14'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Command: [62048eeb-6de6-4e1f-a09f-4538f68b9165, get {url=http://localhost:35077/empty}]
selenide.url: http://localhost:35077/empty
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 135.0, moz:accessibilityChecks: false, moz:buildID: 20250130195129, moz:debuggerAddress: 127.0.0.1:26674, moz:geckodriverVersion: 0.35.0, moz:headless: false, moz:platformVersion: 6.8.0-52-generic, moz:processID: 44707, moz:profile: /tmp/rust_mozprofileEQ9uft, moz:shutdownTimeout: 60000, moz:webdriverClick: true, moz:windowless: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:cdp: ws://127.0.0.1:26674/devtoo..., se:cdpVersion: 85.0, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: accept, userAgent: Mozilla/5.0 (X11; Linux x86...}
selenide.baseUrl: http://localhost:35077
Session ID: 62048eeb-6de6-4e1f-a09f-4538f68b9165
	at java.base@17.0.14/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base@17.0.14/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base@17.0.14/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base@17.0.14/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base@17.0.14/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
	at app//org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167)
	at app//org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138)
	at app//org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50)
	at app//org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:215)
	at app//org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216)
	at app//org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174)
	at app//org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
	at app//org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:313)
	at app//org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:1090)
	at app//com.codeborne.selenide.drivercommands.Navigator.lambda$navigateTo$0(Navigator.java:69)
	at app//com.codeborne.selenide.logevents.SelenideLogger.lambda$run$0(SelenideLogger.java:99)
	at app//com.codeborne.selenide.logevents.SelenideLogger.wrap(SelenideLogger.java:128)
	at app//com.codeborne.selenide.logevents.SelenideLogger.run(SelenideLogger.java:98)
	at app//com.codeborne.selenide.drivercommands.Navigator.navigateTo(Navigator.java:65)
	at app//com.codeborne.selenide.drivercommands.Navigator.open(Navigator.java:29)
	at app//com.codeborne.selenide.SelenideDriver.open(SelenideDriver.java:86)
	at app//com.codeborne.selenide.Selenide.open(Selenide.java:50)
	at app//ui.hello.TagsSpec.openEmptyPage(TagsSpec.java:11)
	...
Play.getVirtualFile() was renamed to Play.file() in commit
397f4ca and we got
groovy.lang.MissingMethodException now:

groovy.lang.MissingMethodException: No signature of method: static play.Play.getVirtualFile() is applicable for argument types: (String) values: [app/public/stylesheets/empty.css]
	at tags/stylesheet.tag.(line:18)

16:41:42,133 ERROR [play.server.javanet.PlayHandler] ~ Internal Server Error (500) for GET /empty (GTAppClassException)
play.template2.exceptions.GTAppClassException: File not found: app/public/stylesheets/empty.css
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at tags/stylesheet.tag.(line:20)
	at play.template2.GTJavaBase.internalRenderTemplate(GTJavaBase.java:146)
	at play.template2.GTJavaBase.invokeTagFile(GTJavaBase.java:290)
	at /app/views/HelloWorld/empty.html.(line:4)
	at play.template2.GTJavaBase.internalRenderTemplate(GTJavaBase.java:146)
	at play.template2.GTJavaBase.internalRenderTemplate(GTJavaBase.java:110)
	at play.modules.gtengineplugin.gt_integration.GTJavaBase1xImpl.internalRenderTemplate(GTJavaBase1xImpl.java:96)
	at play.template2.GTJavaBase.renderTemplate(GTJavaBase.java:104)
	at play.modules.gtengineplugin.GTTemplate.renderGTTemplate(GTTemplate.java:67)
	at play.modules.gtengineplugin.GTTemplate.internalGTRender(GTTemplate.java:54)
	at play.modules.gtengineplugin.GTTemplate.internalRender(GTTemplate.java:38)
	at play.modules.gtengineplugin.GTTemplate.render(GTTemplate.java:73)
	at play.rebel.View.renderView(View.java:71)
	at play.rebel.View.apply(View.java:50)
	at play.mvc.ActionInvoker.applyResult(ActionInvoker.java:191)
	at play.mvc.ActionInvoker.invoke(ActionInvoker.java:158)
	at play.server.javanet.PlayHandler$JavaNetInvocation.execute(PlayHandler.java:434)
	at play.server.javanet.PlayHandler$JavaNetInvocation.lambda$run$0(PlayHandler.java:409)
	at play.db.jpa.JPA.withTransaction(JPA.java:271)
	at play.db.jpa.JPA.withinFilter(JPA.java:172)
	at play.server.javanet.PlayHandler$JavaNetInvocation.run(PlayHandler.java:407)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: play.template2.exceptions.GTAppClassException: File not found: app/public/stylesheets/empty.css
	... 30 more
Caused by: play.exceptions.TagInternalException: File not found: app/public/stylesheets/empty.css
	... 30 more
Caused by: groovy.lang.MissingMethodException: No signature of method: static play.Play.getVirtualFile() is applicable for argument types: (String) values: [app/public/stylesheets/empty.css]
	at tags/stylesheet.tag.(line:18)
	... 26 more
Play.getVirtualFile() was renamed to Play.file() in commit
397f4ca and we got
groovy.lang.MissingMethodException now:

No signature of method: static play.Play.getVirtualFile() is applicable for argument types: (String) values: [app/public/javascripts/empty.js]
	at tags/script.tag.(line:19)

17:28:59,385 ERROR [play.server.javanet.PlayHandler] ~ Internal Server Error (500) for GET /empty (GTAppClassException)
play.template2.exceptions.GTAppClassException: File not found: app/public/javascripts/empty.js
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at tags/script.tag.(line:21)
	at play.template2.GTJavaBase.internalRenderTemplate(GTJavaBase.java:146)
	at play.template2.GTJavaBase.invokeTagFile(GTJavaBase.java:290)
	at /app/views/HelloWorld/empty.html.(line:4)
	at play.template2.GTJavaBase.internalRenderTemplate(GTJavaBase.java:146)
	at play.template2.GTJavaBase.internalRenderTemplate(GTJavaBase.java:110)
	at play.modules.gtengineplugin.gt_integration.GTJavaBase1xImpl.internalRenderTemplate(GTJavaBase1xImpl.java:96)
	at play.template2.GTJavaBase.renderTemplate(GTJavaBase.java:104)
	at play.modules.gtengineplugin.GTTemplate.renderGTTemplate(GTTemplate.java:67)
	at play.modules.gtengineplugin.GTTemplate.internalGTRender(GTTemplate.java:54)
	at play.modules.gtengineplugin.GTTemplate.internalRender(GTTemplate.java:38)
	at play.modules.gtengineplugin.GTTemplate.render(GTTemplate.java:73)
	at play.rebel.View.renderView(View.java:71)
	at play.rebel.View.apply(View.java:50)
	at play.mvc.ActionInvoker.applyResult(ActionInvoker.java:191)
	at play.mvc.ActionInvoker.invoke(ActionInvoker.java:158)
	at play.server.javanet.PlayHandler$JavaNetInvocation.execute(PlayHandler.java:434)
	at play.server.javanet.PlayHandler$JavaNetInvocation.lambda$run$0(PlayHandler.java:409)
	at play.db.jpa.JPA.withTransaction(JPA.java:271)
	at play.db.jpa.JPA.withinFilter(JPA.java:172)
	at play.server.javanet.PlayHandler$JavaNetInvocation.run(PlayHandler.java:407)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: play.template2.exceptions.GTAppClassException: File not found: app/public/javascripts/empty.js
	... 30 more
Caused by: play.exceptions.TagInternalException: File not found: app/public/javascripts/empty.js
	... 30 more
Caused by: groovy.lang.MissingMethodException: No signature of method: static play.Play.getVirtualFile() is applicable for argument types: (String) values: [app/public/javascripts/empty.js]
	at tags/script.tag.(line:19)
	... 26 more
…ramework#198, replay-framework#291)

"tags/script.tag" and "tags/stylesheet.tag" files were left out from
the rename commit 397f4ca.

Fixes: 397f4ca ("rename 'getVirtualFile()' to just 'file()'")
@xabolcs
Copy link
Collaborator Author

xabolcs commented Feb 10, 2025

Wow!

GitHub lists the commits on the commit page in date order, instead of "parent" order. 🤦

$ git log --oneline master..HEAD | tac
0c27be9 replay-tests: add an empty page for upcoming tag tests
5d62e06 replay-tests: exercise tags/stylesheet.tag as it's currently failing
e28ed11 framework: script.tag: wrap original exception into TagInternalException
c3afe1d replay-tests: exercise tags/script.tag as it's currently failing
615fb95 framework: fix leftover Play.getVirtualFile() usage in tags (#198, #291)

@xabolcs xabolcs changed the title framework: fix leftover Play.getVirtualFile() usage in tags (#198, #291) framework: fix leftover Play.getVirtualFile() usage in tags (#198, #291) Feb 10, 2025
@asolntsev asolntsev added this to the 2.6.4 milestone Feb 11, 2025
@asolntsev asolntsev merged commit 496dbd3 into replay-framework:main Feb 11, 2025
3 checks passed
@xabolcs
Copy link
Collaborator Author

xabolcs commented Feb 11, 2025

Thank you very much!

@xabolcs xabolcs deleted the getVirtualFile-leftovers-tags branch February 11, 2025 07:08
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 this pull request may close these issues.

2 participants