2

I'm sure this issue is resolved somewhere online, but I haven't been able to find it. I read over this other answer, but I'm not sure how to go about adding in a new ScriptEngine for Javascript.

I wrote a Java application that, to my knowledge, does not use JavaScript anywhere in it. This is a Spring application that uses Maven, but following a mvn clean package and successful build, running java -jar app/target/app-X.X.X-SNAPSHOT.jar results in main ERROR No ScriptEngine found for language js.

Would anyone happen to know why a project that does not use JS, throw an error in regards to it? Is there any known way (or even documentation anywere) to resolve it or other issues related to ScriptEngine?

2020年12月10日 20:43:50,584 main ERROR No ScriptEngine found for language js. Available languages are: 
2020年12月10日 20:43:50,641 main ERROR Unable to create file /data/logs/out/out.log java.io.IOException: Could not create directory /data/logs/out
 at org.apache.logging.log4j.core.util.FileUtils.mkdir(FileUtils.java:127)
 at org.apache.logging.log4j.core.util.FileUtils.makeParentDirs(FileUtils.java:144)
 at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:650)
 at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:631)
 at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:113)
 at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
 at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:205)
 at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:146)
 at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:62)
 at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
 at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1002)
 at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:942)
 at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:934)
 at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:552)
 at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:241)
 at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:288)
 at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:579)
 at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:651)
 at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:668)
 at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
 at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
 at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
 at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
 at org.apache.commons.logging.LogAdapter$Log4jLog.<clinit>(LogAdapter.java:155)
 at org.apache.commons.logging.LogAdapter$Log4jAdapter.createLog(LogAdapter.java:122)
 at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:89)
 at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:67)
 at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:59)
 at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:196)
 at xxx.xxx.xxx.xxx.xxx.Application.main(Application.java:48)
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:564)
 at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
 at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
 at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
 at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
asked Dec 10, 2020 at 23:28
3
  • Include your entire stack trace and the actual behavior: Does that ERROR output actually cause any problems with your program, or is it just a diagnostic? Commented Dec 10, 2020 at 23:30
  • It has been added. Commented Dec 11, 2020 at 18:40
  • Again, does your application fail to start or otherwise malfunction? (Note, by the way, that log4j is obsolete, and in a new application you should be using either slf4j, which is the Boot default, or log4j2.) Commented Dec 11, 2020 at 19:05

1 Answer 1

1

Since your application is failing in Log4J I assume you used JavaScript in Log4J configuration.

The JavaScript engine was removed in JDK 15. See JEP 372: Remove the Nashorn JavaScript Engine

A possible solution is to use Groovy instead.

answered Jan 30, 2022 at 13:36
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.