[ grinder-Bugs-3133650 ] Relative classpath issues when using the console
SourceForge.net <[email protected]> Tue, 18 Sep 2012 14:56:10 -0700
| Newsgroups | gmane.comp.java.grinder.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #3133650, was opened at 2010-12-09 08:51
Message generated for change (Settings changed) made by philipa
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3133650&group_id=18598
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
>Status: Closed
Resolution: Fixed
Priority: 3
Private: No
Submitted By: Jared C (concealed)
Assigned to: Philip Aston (philipa)
Summary: Relative classpath issues when using the console
Initial Comment:
I think the relative path issues in previous versions may have resurfaced in 3.4. This only happens when I am using the console. I have a startup script like this:
set GRINDERPATH=..\lib
set LIBPATH=lib
set GRINDERPROPERTIES=mytest.properties
set JYTHON_HOME=..\..\jython252
java -cp "%GRINDERPATH%\grinder.jar;%LIBPATH%\somelib.jar;%JYTHON_HOME%\jython.jar;" -Dgrinder.jvm.arguments=-Dpython.home=%JYTHON_HOME% net.grinder.Grinder %GRINDERPROPERTIES%
It connects to the console just fine but when I click start, I get the following error while working the worker process because it can't find the Grinder libraries:
java.lang.NoClassDefFoundError: net/grinder/engine/process/WorkerProcessEntryPoint
Same goes for the jython libraries. If I change the two to an absolute path (such as C:\path\to\jython225), it works just fine. The LIBPATH doesn't have any issues (maybe because it doesn't reverse back any directories). The worker process will startup just fine if I do not use the console.
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2011-12-18 04:37
Message:
Fixed for 3.7.
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2010-12-12 06:24
Message:
Your folder structure will work with this if you have GRINDER_PATH should
be as you defined it (",,\lib"),
Or you could say "-Dgrinder.jvm.classpath=..\..\..\lib\grinder.jar". The
point is that the worker process runs two directories further down from the
agent process, so must traverse back up.
----------------------------------------------------------------------
Comment By: Jared C (concealed)
Date: 2010-12-10 08:42
Message:
Sorry I'm a bit confused. What should the GRINDER_PATH be? Can you show
your folder structure for the whole thing?
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2010-12-10 02:42
Message:
The problem is that when the process runs under the console, it does so in
the "blah-filestore/current" directory. This is advantageous for reading
jython modules, property files, and other distributed artefacts, but means
that the relative paths the worker process requires are different.
Your JYTHON_HOME should be "..\..\..\lib\jython252". You can fix up the
classpath by adding
-Dgrinder.jvm.classpath=..\..\%GRINDER_PATH%\grinder.jar
to the command line.
I don't propose to "fix" this, because there's no way of knowing what
properties should be adjusted before passing them to the worker process.
Instead, I'll add a note to the documentation.
Thanks for the report.
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2010-12-10 02:30
Message:
Wow - I've reproduced this :-)
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2010-12-10 02:29
Message:
1. The javaagent part of the command line is calculated by the agent
process - if the agent jar is found, it will always be expanded to a full
path.
2. The file store update has nothing to do with being able to find jython.
It is handled purely by the agent (which doesn't load jython).
----------------------------------------------------------------------
Comment By: Jared C (concealed)
Date: 2010-12-09 10:40
Message:
I changed everything to forward paths, but for some reason the command
always comes out like this:
'-javaagent:C:\tools\grinders\grinder-3.4\pdfgen\..\lib\grinder-agent.jar'
....... However that is a non-issue. I tried with an absolute grinder path
and left the jython path relative, the grinder jar was found and the script
started until it tried to import string from jython and died. Still
couldn't find jython even with forward slashes.
../jython252/jython.jar;
Whats weird is it finds jython just find when it updates the file store
just before launching the worker process:
12/9/10 12:34:56 PM (agent): Updating file store:
"jython252\cachedir\packages\xmltooling-1.1.0.pkc" (10787 bytes)
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2010-12-09 10:26
Message:
Please can you try with forward paths throughout. That is, in the command
line as well.
----------------------------------------------------------------------
Comment By: Jared C (concealed)
Date: 2010-12-09 09:29
Message:
I tried a forward slash, and it still didn't work.
12/9/10 11:12:45 AM (agent): Worker process command line: java
'-javaagent:C:\tools\grinders\grinder-3.4\pdfgen\..\lib\grinder-agent.jar'
'-Dpython.home=C:\tools\grinders\jython252' -classpath
'lib/somelib.jar;;../lib\grinder.jar;C:\tools\grinders\jython252\jython.jar;'
net.grinder.engine.process.WorkerProcessEntryPoint
This command is the same if I am using the console or not.
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2010-12-09 09:01
Message:
Not sure this is related to previous issues - they were due to how The
Grinder resolves script files.
If the agent can start, but the worker can't, there's something funny in
the creation of the worker process command line. Please:
1. Try using forward slashes.
2. Copy the worker process command line that the agent writes out to this
bug report.
Thanks,
- Phil
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3133650&group_id=18598
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/