Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javaagent is not recognized in jvmopts #481

Closed
behrad opened this issue Feb 6, 2015 · 3 comments
Closed

javaagent is not recognized in jvmopts #481

behrad opened this issue Feb 6, 2015 · 3 comments
Labels
universal Zip, tar.gz, tgz and bash issues

Comments

@behrad
Copy link

behrad commented Feb 6, 2015

I should add aspectj weaver and jolokia JVM agents to my JVM, and this is my jvmopts:

-Djava.library.path=/usr/share/sigar
-javaagent:/media/data/workspace/adp-endpoint-pardis/target/universal/adp-pardis-1.0/lib/org.jolokia.jolokia-jvm-1.2.2-agent.jar=port=8182
-javaagent:/media/data/workspace/adp-endpoint-pardis/target/universal/adp-pardis-1.0/lib/org.aspectj.aspectjweaver-1.8.2.jar

when running universal run script via -d I found that -javaagent is placed after $mainclass so it is collected by app_commands or residual_args

  # run sbt
  execRunner "$java_cmd" \
    $(get_mem_opts $app_mem) \
    ${java_opts[@]} \
    "${java_args[@]}" \
    -cp "$(fix_classpath "$app_classpath")" \
    $mainclass \
    "${app_commands[@]}" \
    "${residual_args[@]}"
@behrad
Copy link
Author

behrad commented Feb 6, 2015

by reading source I found converting -J-javaagent solved the above, however how can I use some app_path parameter in jvmopts so that I avoid using absolute path of lib jars :(
-J-javaagent:???/lib/xyz.jar

Is the same issue happening with etc-default in non universal packages?

@muuki88
Copy link
Contributor

muuki88 commented Feb 7, 2015

There was a pull request for this (#265). I think there was a pull request for adding a separator between java and application args. If I recall correctly it was --. Maybe this helps.

@muuki88 muuki88 added the universal Zip, tar.gz, tgz and bash issues label Feb 7, 2015
@muuki88
Copy link
Contributor

muuki88 commented Apr 17, 2015

From gitter chat room (with version 1.0.0)

javaOptions in Universal ++= Seq(
    "-J-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9000"
)

@muuki88 muuki88 closed this as completed Apr 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
universal Zip, tar.gz, tgz and bash issues
Projects
None yet
Development

No branches or pull requests

2 participants