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

error loading jMockit agent from path with whitespaces #519

Closed
ickzon opened this issue May 9, 2018 · 0 comments
Closed

error loading jMockit agent from path with whitespaces #519

ickzon opened this issue May 9, 2018 · 0 comments
Labels
bug

Comments

@ickzon
Copy link

@ickzon ickzon commented May 9, 2018

The problem has been introduced in one of the latest versions, jMockit 1.30 still worked.

With jMockit 1.39 loading the jMockit agent automatically via AgentLoader fails with an error:
"com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute"

The problematic code is line 36 of class AgentLoader.java:
...getCodeSource().getLocation().getPath() -> returns an URL-encoded value (e.g. %20 for space)
You could easily change it to
....getCodeSource().getLocation().toURI().getPath()
to get a valid file name.

@rliesenfeld rliesenfeld added the bug label May 9, 2018
@jmockit jmockit locked and limited conversation to collaborators Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.