ResourceService.resolve(..) throws exception if invoked from a Spring Boot application
Error:
Caused by: org.metaborg.core.MetaborgRuntimeException: org.apache.commons.vfs2.FileSystemException: Could not replicate "file:///home/oskar/repos/pgx/internal/spring_boot_test/build/libs/pgx-spring-boot-test-1.0.0.jar!/BOOT-INF/lib/gm-compiler-0.1.2-20180910.jar" as it does not exist. at org.metaborg.core.resource.ResourceService.resolve(ResourceService.java:77) at oracle.gm.SpoofaxAdapter.loadChildLanguages(SpoofaxAdapter.java:77)
To reproduce, create a basic Spring Boot application (https://spring.io/guides/gs/spring-boot/) that loads a Spoofax language.
Build the spring boot application and invoke throughjava -jar my-spring-boot-app-1.0.0.jar
I expect it may be a VFS issue. A workaround is to copy the Spoofax binary to the file system before invoking resourceService.resolve(..):
Submitted by Oskar van Rest on 6 October 2018 at 00:55URL inputUrl = getClass().getResource(SPOOFAX_BINARIES); spoofaxBinaryFile = File.createTempFile(SPOOFAX_BINARIES, ""); FileUtils.copyURLToFile(inputUrl, spoofaxBinaryFile); FileObject fileObject = spoofax.resourceService.resolve(spoofaxBinaryFile.getAbsolutePath());
Log in to post comments