So I have tested it myself and it looks like capstan (or OSv cannot parse 
properly command line built by capstan) cannot properly handle arguments 
when passes through YAML args list.

It looks like you are using the "java" runtime that capstan advertises 
which aims to make it easier to deploy and run Java apps on OSv by 
automating process of constructing proper java command line and pull extra 
packages. But apparently it has bugs and in general it comes with another 
layer of abstraction which sometimes may make it more difficult to 
troubleshoot the problem.

You can always bypass this layer and use "native" runtime where you have 
full control of how your OSv command like looks. This is BTW how I use 
capstan.

Here is how your meta/run.yaml would look like:
runtime: native
config_set:
  *myconfig1*:
    bootcmd: "/java.so -jar /Uni.jar -lsim -nTc 10 -sp 50000 -kp ./keystore 
-tf ./config/topology.prop.xml -tIp 127.0.0.1 -d 60 -td ./traces/ -cfg 
./config/config.prop.xml"
config_set_default: *myconfig1*

Also you need to change meta/package.yaml. See this example:
name: java-example
title: Java Example
author: Anonymous
version: "1.0"
require:
#- openjdk8-zulu-full
- openjdk8-zulu-compact3-with-java-beans
- osv.run-java
created: "2018-06-13T18:09:24-04:00"

Please see you can use either full and slimmer version of Open JDK 8 JRE. 
Also please note extra package which needs to be the last one and you can 
download it from 
github 
https://github.com/cloudius-systems/osv/releases/download/v0.51.0/osv.run-java.mpm/yaml
 
and put it under $HOME/.capstan/packages/. Unfortunately the old 
Mikelangelo S3 repo has pretty old (2018) artifacts and I am not sure if 
anybody maintains it. You can always easily create your own S3 OSv packages 
repo if you want. 

I have tested it with my hello world class and Java app received arguments 
correctly:
Sv v0.53.0
eth0: 192.168.122.15
java.so: Starting JVM app using: io/osv/nonisolated/RunNonIsolatedJvmApp
java.so: Setting Java system classloader to NonIsolatingOsvSystemClassLoader
Hello from Java on OSv!
Arg: -lsim
Arg: -nTc
Arg: 10
Arg: -sp
Arg: 50000
Arg: -kp
Arg: ./keystore
Arg: -tf
Arg: ./config/topology.prop.xml
Arg: -tIp
Arg: 127.0.0.1
Arg: -d
Arg: 60
Arg: -td
Arg: ./traces/
Arg: -cfg
Arg: ./config/config.prop.xml

I hope this helps,
Waldek

On Wednesday, March 20, 2019 at 2:36:56 AM UTC-4, robertob wrote:
>
> Dear all, 
>
> I have a "run.yaml" to run a JAR file. We need to pass a lot of arguments 
> but something go wrong. This is the snippet of the run.yaml:
>
>  *myconfig1:*
> *      main: /Uni.jar*
> *      args:*
> *         - -lsim -nTc 10*
> *         - -sp 50000*
> *         - -kp ./keystore*
> *         - -tf ./config/topology.prop.xml*
> *         - -tIp 127.0.0.1*
> *         - -d 60*
> *         - -td ./traces/*
> *         - -cfg ./config/config.prop.xml*
>
> When I run the image the message I got is the following:
>
> *"unrecognised option '-nTc'"*
>
> It seems to consider only the first argument and not the others. 
>
> Any advice?
>
> Regards
>
> R
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to