sidgate
sidgate

Reputation: 15244

Python ScriptEngine null on docker image

I have a normal spring boot app deployed on docker. The ScriptEngine works properly if app started normally or deployed on tomcat. But if I start it on docker the scriptEngine instance is returned null. Any idea?

ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
scriptEngine = scriptEngineManager.getEngineByName("python");  // returns null

Upvotes: 1

Views: 363

Answers (1)

sidgate
sidgate

Reputation: 15244

Turns out that the jython library needs to be unpacked for docker from the spring boot application. Following configuration in maven makes it work on docker as well.

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <requiresUnpack>
            <dependency>
                <groupId>org.python</groupId>
                <artifactId>jython-standalone</artifactId>
            </dependency>
        </requiresUnpack>
    </configuration>
</plugin>

Upvotes: 2

Related Questions