Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
activator start errror - Bad application path: -Dhttp.port=9000 #3081
Unable to start app in PROD mode in PlayJava, even sample app fails when running in Windows.
[info] Packaging C:\Dev\my-first-app\target\scala-2.11\my-first-app_2.11-1.0-SNA
(Starting server. Type Ctrl+D to exit logs, the server will remain in background
Bad application path: -Dhttp.port=9000
I just did a clean windows activator app with no java args set in console and still getting same error , so it's not JAVA_OPTIONS.
Also ran the sample app on linux and "activator start" works like a charm.
So this looks like activator.bat startup script error and should only effect Windows platform.
@jroper, is hinting at it, but the reason for that error is because the
i.e. We should be running
but we're actually running
This is probably a bug in sbt-native-packager, which is what Play uses to bundle its prod mode applications.
@polanskya, is there any chance you could run
If you want, you could even look in the generated launcher bat file and see if there's anything obvious that looks wrong. But no worries if you can't. :)
Disregard my last (deleted) comment. The problem I believe is that SBT native packager simply doesn't support extracting out -D args and putting them in the right place on Windows... doing that in a Windows batch script is... well... crazy. So it's sort of a bug in Play, in that it's using the batch script in a way that isn't supported.
What we should probably do is put the arguments into an environment variable instead of passing them on the command line.
I am using Windows 7.
I occurred "Bad application path: -Dhttp.port=9000" when I invoke "activator start".
Then I try to run "activator dist", unzip the package, run the batch file, it shows me the error message the value is too long.
I echo out the value as this
When I change my project directory to d:\temp\1.0, the problem is solved.
My conclusion is
Note: change PROJ_OPTS to YOURPROJECTNAME_OPTS and proj.bat to yourprojectname.bat
I'm also experiencing this issue when running "activator run", but not when running "activator dist" and unzipping the package on my desktop. As with mickyp if I unzip the package in \target\universal and run the .bat I get "The input line is too long. The syntax of the command is incorrect."
I am having this problem and I am on Mac. java version -
It used to work ok before. How do I investigate this further?
@jroper don't you think a command line longer than 8000 characters is a bit excessive?
I mean I know "M$ sucks" and we must hate them, but look what people can do with only 4 KB of binary code: https://www.youtube.com/watch?v=AWcbj7ksqwE . But it's probably easier to bash MS than to fix the issue.
Back to the topic, and fixing the issue, this bullshit starts with the
line in the stage/bin bat file.
In my case, that returns
Then we have:
So that thing becomes:
A few lines later we have:
Anyway, the obvious solution to reduce the length is to replace this:
That will reduce APP_CLASSPATH from 6750 characters to 2846 characters in my case:
However, with or without this change, my project works when I start it by running the batch file manually from \target\universal\stage\bin\
Only when I use sbt start I receive:
That happens even if I move the project to C:, so I think this command line length is not the issue (at least in my case). There must be some other bug that causes the "Bad application path" error.
Got the same error. To fix this issue find following lines in generated .BAT file:
And remove %* from the end of 2nd line (as we don't need to pass any parameters to play.core.server.NettyServer).
referenced this issue
Apr 27, 2015
After experiencing this annoying issue on Windows in the past now I'm starting to experience this issue on Linux as well.
After adding javaOptions += "-Xmx2048m" to my project file I get Bad application path: -Xmx2048m when starting my app.
It was working fine before adding that java option.
I use play scala 2.3.10, sbt 0.13.9, Java 8, Ubuntu 14.04.3 LTS.
I'm starting my app like this:
I'm starting to run out of excuses for why I keep trying to make this framework work for me.
Also see the #3081 (comment) comment -- this is sbt-native-packager related, and any bugs should be sent there, and "start" is deprecated in 2.5. Closing.