Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Unable to launch "-Dfile.encoding=UTF-8": 2 #2

Open
dchelimsky opened this issue Jul 1, 2011 · 7 comments
Open

Unable to launch "-Dfile.encoding=UTF-8": 2 #2

dchelimsky opened this issue Jul 1, 2011 · 7 comments

Comments

@dchelimsky
Copy link

Given the following config/trinidad.yml:

---
port: 8092

extensions:
  daemon:
    pid_file: tmp/pids/trinidad.pid

web_apps:
  default:
    environment: development
    web_app_dir: .
    libs_dir: vendor/jars
    jruby_min_runtimes: 1
    jruby_max_runtimes: 1

When I run

$ trinidad

Then I get the following message (and no other output):

Unable to launch "-Dfile.encoding=UTF-8": 2

If I remove the daemon extension I can run trinidad with no problem.

I've looked through the source code for trinidad, trinidad_daemon_extension and can not figure out where this message is coming from or what is causing it.

@calavera
Copy link
Contributor

calavera commented Jul 2, 2011

David,

can you confirm that you are using the latest version of the extension?

My bet is that the jvm arguments are set in wrong order and the child process tries to start the encoding parameter as it was the final executable. This is where the arguments are processed:

https://github.com/trinidad/trinidad_daemon_extension/blob/master/src/main/java/org/jruby/trinidad/TrinidadDaemon.java#L91-111

@dchelimsky
Copy link
Author

Hey David - I'm using trinidad-1.2.1 and trinidad_daemon_extension-0.2.8.

Also, jruby-1.6.2 (in rvm) and java-1.6.0_24.

I don't have access to the machine I was working on when I filed this (until Tuesday), but my recollection is that the command generated when I ran trinidad (without the extension) started with /usr/bin/java -Dfile.encoding=UTF-8, so that might back up your bet. I'll confirm on Tuesday.

@btatnall
Copy link
Member

btatnall commented Jul 6, 2011

I ran the following and was able to launch trinidad successfully.

gem install rails
rails new foo
echo "gem 'trinidad'" >> Gemfile
echo "gem 'trinidad_daemon_extension'" >> Gemfile
bundle

Copy config/trinidad.yml from above

trinidad
ps auwxx | grep trinidad

-Dfile.encoding=UTF-8 -Dcom.sun.akuma.Daemon=daemonized -Djdk.home= -Djruby.home=/Users/bt/.rvm/rubies/jruby-1.6.2 -Djruby.script=jruby -Djruby.shell=/bin/bash -Djffi.boot.library.path=/Users/bt/.rvm/rubies/jruby-1.6.2/lib/native/Darwin -Xmx500m -Xss2048k -Djruby.memory.max=500m -Djruby.stack.max=2048k -Dsun.java.command=org.jruby.Main -Djava.class.path= -Xbootclasspath/a:/Users/bt/.rvm/rubies/jruby-1.6.2/lib/jruby.jar org/jruby/Main /Users/bt/.rvm/gems/jruby-1.6.2@daemon-error/bin/trinidad

jruby-1.6.2
java version "1.6.0_24"
trinidad (1.2.1)
trinidad_daemon_extension (0.2.8)

@dchelimsky
Copy link
Author

Looks like I won't be able to follow up until next week. I'll see what I can find then.

@dchelimsky
Copy link
Author

I followed the steps @btatnall described two comments up and got the same result as before:

Unable to launch "-Dfile.encoding=UTF-8": 2

I'm thinking this is something to do with my java/jruby environment. Even though the versions are the same, there might be other things at play. Will follow up here if I find anything.

@munkyboy
Copy link

I'm running into the same issue. My error message is:
Unable to launch "-Xmx500m": 2

running;
OS X 10.7.4
jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM) Client VM 1.6.0_31) [darwin-i386-java]
trinidad (1.3.5)
trinidad_daemon_extension (0.3.1)

@munkyboy
Copy link

solved it by using 1.6.x 64 bit java (via java preference pane). I was previously using 1.6.x 32 bit java.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants