Gonçalo Gonçalo - 10 months ago 111
Java Question

Heroku webapp-runner --enable-naming

I've been facing with a combersome task: deploying a spring project ( using JNDI ).

Right now the problem is related to the webapp-runner option "enable-naming".
My datasources are declared by jndi - using tomcar context.xml.
When i feed webapp-runner with the option referred i get this message:

Exception in thread "main" com.beust.jcommander.ParameterException:
**Unknown option: --enable-naming**
at com.beust.jcommander.JCommander.parseValues(JCommander.java:723)
at com.beust.jcommander.JCommander.parse(JCommander.java:275)
at com.beust.jcommander.JCommander.parse(JCommander.java:258)
at com.beust.jcommander.JCommander.(JCommander.java:203)
at webapp.runner.launch.Main.main(Main.java:74)

I've been digging the webapp-runner code and saw this condition:

if (commandLineParams.enableNaming ||
commandLineParams.enableBasicAuth ||
commandLineParams.tomcatUsersLocation != null) {

So i've tried with --enable-basic-auth option and my app runs just fine... The problem is i don't want basic-auth in my site.

I'm using maven heroku-maven-plugin, and as
WEBAPP_RUNNER_OPTS: --context-xml tomcat-heroku-server-conf/context.xml --enable-naming

Thanks in advance.

Answer Source

This option was added in webapp-runner, but at the time of this writing the Heroku CLI WAR deployment plugin and the Heroku Maven plugin default to version of webapp-runner.

You can set the version like this for the CLI:

$ heroku deploy:war --webapp-runner path/to/app.war

Or like this for Maven:

$ mvn heroku:deploy-war -Dheroku.webappRunnerVersion=

I maintain webapp-runner and those plugins, and I'll update them to use shortly.