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

Running RemoteSwingLibrary with standalone JAR fails on invalid javaagent in JAVA_TOOL_OPTIONS #15

Closed
lindmik opened this issue Dec 3, 2014 · 4 comments

Comments

@lindmik
Copy link

lindmik commented Dec 3, 2014

When starting a local Java application with a Windows batch script using RemoteSwingLibrary, the java.exe process never starts up.

Robot Framework log.html shows on DEBUG level that it sets the JAVA_TOOL_OPTIONS to something invalid.

Set JAVA_TOOL_OPTIONS='-javaagent:"C:\SUT\__pyclasspath__"=127.0.0.1:57586'

By looking at the code, it seems like __file__ is resolved as __pyclasspath__, which suggests that this is a Jython issue.

Overriding the JAVA_TOOL_OPTIONS in the application's batch script will allow Java to start up, but of course then RemoteSwingLibrary won't be able to connect to it.

@jussimalinen
Copy link
Contributor

How do you add RemoteSwingLibrary jar to your path? Do you add it to PYTHONPATH, JYTHONPATH, or CLASSPATH?

And also, do you use environment variable or a commandline argument ---pythonpath?

@lindmik
Copy link
Author

lindmik commented Dec 3, 2014

Just on the CLASSPATH, like this:

set BASEDIR=%~dp0
set SUTDIR=C:\SUT
set APPDATA=%USERPROFILE%\Application Data

set LIBDIR=%BASEDIR%lib
set OUTPUTDIR=%BASEDIR%output
set TESTDIR=%BASEDIR%tests

pushd %SUTDIR%
set CLASSPATH=%LIBDIR%/;lib/
call java -cp %CLASSPATH% org.robotframework.RobotFramework run --loglevel debug -d %OUTPUTDIR% %TESTDIR%
popd

LIBDIR has remoteswinglibrary-2.0.0.jar and robotframework-2.8.6.jar.
lib under SUTDIR has the application's JARs.

@jussimalinen
Copy link
Contributor

Actually if you add remoteswinglibrary-2.0.0.jar to JYTHONPATH instead of CLASSPATH it works.

The logic for finding where the jar is doesnt work from CLASSPATH... It is a bug in RemoteSwingLibrary I think, but at least there is a workaround for now.

@ehhc
Copy link

ehhc commented Sep 28, 2017

See my comment here: #42

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

No branches or pull requests

3 participants