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

Execution fails if running fitnesse.jar from another directory #862

Closed
magmax opened this Issue Jan 20, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@magmax

magmax commented Jan 20, 2016

Problem happening with version 20150814 and 20151230 on Windows.

When running fitnesse from a directory different from where the jar is placed, it cannot run the slim server.

Here you have an example accessing to the fitnesse-standalone.jar in current path:

C:\tmp\fitnesse\jar>java -jar fitnesse.jar -c "/FitNesse.UserGuide.TwoMinuteExample?test&format=text"
ene 20, 2016 2:08:06 PM fitnesse.ConfigurationParameter loadProperties
INFO: No configuration file found (C:\tmp\fitnesse\jar\plugins.properties)
Bootstrapping FitNesse, the fully integrated standalone wiki and acceptance testing framework.
root page: fitnesse.wiki.fs.FileSystemPage at .\FitNesseRoot#latest
logger: none
authenticator: fitnesse.authentication.PromiscuousAuthenticator
page factory: fitnesse.html.template.PageFactory
page theme: bootstrap
Unpacking new version of FitNesse resources. Please be patient...
**********************************************************
Files have been updated to a new version.
Please read the release notes on
http://localhost:9123/FitNesse.ReleaseNotes
to find out about the new features and fixes.
**********************************************************
Executing command: /FitNesse.UserGuide.TwoMinuteExample?test&format=text

Starting Test System: slim:fitnesse.slim.SlimService.
F 14:08:15 R:5    W:1    I:0    E:0    TwoMinuteExample (FitNesse.UserGuide.TwoMinuteExample)   0,51
6 seconds
--------
1 Tests,        1 Failures      1,303 seconds.

and here accessing from the parent path:

C:\tmp\fitnesse>java -jar jar\fitnesse.jar -c "/FitNesse.UserGuide.TwoMinuteExample?test&format=text"
ene 20, 2016 2:09:06 PM fitnesse.ConfigurationParameter loadProperties
INFO: No configuration file found (C:\tmp\fitnesse\plugins.properties)
Bootstrapping FitNesse, the fully integrated standalone wiki and acceptance testing framework.
root page: fitnesse.wiki.fs.FileSystemPage at .\FitNesseRoot#latest
logger: none
authenticator: fitnesse.authentication.PromiscuousAuthenticator
page factory: fitnesse.html.template.PageFactory
page theme: bootstrap
Unpacking new version of FitNesse resources. Please be patient...
**********************************************************
Files have been updated to a new version.
Please read the release notes on
http://localhost:9123/FitNesse.ReleaseNotes
to find out about the new features and fixes.
**********************************************************
Executing command: /FitNesse.UserGuide.TwoMinuteExample?test&format=text
--------
0 Tests,        0 Failures      1,345 seconds.

As you can appreciate, both examples are equal, but the second one doesn't work. By executing them from the web interface, the result is a message showing:

Testing was interrupted and results are incomplete. Test Pages: 0 right, 0 wrong, 0 ignored, 0 exceptions     Assertions: 0 right, 0 wrong, 0 ignored, 0 exceptions (1,511 seconds)
Could not complete testing: fitnesse.slim.SlimError: Error SLiM server died before a connection could be established. Error: Could not find or load main class fitnesse.slim.SlimService

I initially thought it was related to #418 but it is still happening with version 20151230.

Maybe I'm doing something wrong?

@amolenaar

This comment has been minimized.

Show comment
Hide comment
@amolenaar

amolenaar Jan 30, 2016

Collaborator

Hi,

FitNesse launches the Slim server in a second process. For that it builds a class path for the to be executed (Java) process. It does a best guess for the fitnesse.jar file name, and if none found, defaults to fitnesse.jar.

Your problem can be resolved in a couple of ways:

  1. Add the &debug parameter to the execution command, this will launch the server in-memory (hence no classpath hassle).
  2. Define the location to your fitnesse explicitly in the wiki in a !path statement.

I'm not sure if FitNesse can be smarter in determining the fitnesse jar file. It should find the jar file containing the Slim server and add that to the class path automatically.

Collaborator

amolenaar commented Jan 30, 2016

Hi,

FitNesse launches the Slim server in a second process. For that it builds a class path for the to be executed (Java) process. It does a best guess for the fitnesse.jar file name, and if none found, defaults to fitnesse.jar.

Your problem can be resolved in a couple of ways:

  1. Add the &debug parameter to the execution command, this will launch the server in-memory (hence no classpath hassle).
  2. Define the location to your fitnesse explicitly in the wiki in a !path statement.

I'm not sure if FitNesse can be smarter in determining the fitnesse jar file. It should find the jar file containing the Slim server and add that to the class path automatically.

@magmax

This comment has been minimized.

Show comment
Hide comment
@magmax

magmax Jan 30, 2016

Hi,

The &debug argument may require more resources, what is not my intention. So it is not a solution for me.

To define the fitnesse location explicitly is a bad idea, because it requires to have the same installation in all the machines that are going to run it. But this opens a new option: what about adding a new command line argument to set the path where fitnesse is located?

Anyway, I will study to install fitnesse in a known path in order to use the !path statement.

Thank you!

magmax commented Jan 30, 2016

Hi,

The &debug argument may require more resources, what is not my intention. So it is not a solution for me.

To define the fitnesse location explicitly is a bad idea, because it requires to have the same installation in all the machines that are going to run it. But this opens a new option: what about adding a new command line argument to set the path where fitnesse is located?

Anyway, I will study to install fitnesse in a known path in order to use the !path statement.

Thank you!

@magmax magmax closed this Jan 30, 2016

@amolenaar

This comment has been minimized.

Show comment
Hide comment
@amolenaar

amolenaar Jan 31, 2016

Collaborator

The &debug parameter loads the SUT in the same FitNesse process. Hence it's not spawning another JVM. So I would expect the overall resource usage to be less.

Explicitly defining the fitnesse.jar is not charming. I agree. Maybe the algorithm to determine the fitnesse.jar location can be made smarter. I have some idea: look up the test runner class name as a resource and obtain the jar file location from there.

Collaborator

amolenaar commented Jan 31, 2016

The &debug parameter loads the SUT in the same FitNesse process. Hence it's not spawning another JVM. So I would expect the overall resource usage to be less.

Explicitly defining the fitnesse.jar is not charming. I agree. Maybe the algorithm to determine the fitnesse.jar location can be made smarter. I have some idea: look up the test runner class name as a resource and obtain the jar file location from there.

@amolenaar

This comment has been minimized.

Show comment
Hide comment
@amolenaar

amolenaar Jan 31, 2016

Collaborator

I created PR #866 in order to let FitNesse find the right location of its jar file. That way you should be able to execute fitnesse in the way you explained.

Collaborator

amolenaar commented Jan 31, 2016

I created PR #866 in order to let FitNesse find the right location of its jar file. That way you should be able to execute fitnesse in the way you explained.

@amolenaar amolenaar reopened this Jan 31, 2016

@amolenaar amolenaar added this to the Next release milestone Feb 3, 2016

@amolenaar

This comment has been minimized.

Show comment
Hide comment
@amolenaar

amolenaar Feb 15, 2016

Collaborator

Fixed by #866.

Collaborator

amolenaar commented Feb 15, 2016

Fixed by #866.

@amolenaar amolenaar closed this Feb 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment