fitnesse icon indicating copy to clipboard operation
fitnesse copied to clipboard

Got error exception when trying to run FitNesse server from Eclipse IDE localhost

Open nguyentuanviet77 opened this issue 4 years ago • 5 comments

Describe the bug I followed the GUIDE in the https://github.com/unclebob/fitnesse#import-fitnesse-in-eclipse at below

Import FitNesse in Eclipse

  1. Clone the FitNesse Git repository from https://github.com/unclebob/fitnesse.
  2. Import FitNesse via File -> Import... -> Gradle Project.
  3. Select the just cloned project folder. Follow the wizard.
  4. Ensure the project properties have a Java 7 compiler or newer set.

When everything is done and I tried to run FitNesse form Eclipse IDE following below step, but it got error exception

To Reproduce Steps to reproduce the behavior:

  1. Go to /fitnesse/src/fitnesseMain/FitNesseMain.java
  2. Right click on public static void main(String[] args) and select Run As -> Java Application
  3. See error : SEVERE: Error while starting the FitNesse [source] java.lang.NullPointerException: source

Expected behavior FitNesse server should be start successful.

Screenshots image

Sample Wiki Structure/content If the problem has to do with how a file handled in the wiki or how it is parsed, please add a zip file containing files that demonstrate the problem.

Stack Trace Loaded custom comparator inverse: fitnesse.slim.test.InverseComparator 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... SEVERE: Error while starting the FitNesse [source] java.lang.NullPointerException: source at java.util.Objects.requireNonNull(Unknown Source) at java.util.Scanner.(Unknown Source) at util.FileUtil.toString(FileUtil.java:112) at fitnesse.updates.WikiContentUpdater.parseResource(WikiContentUpdater.java:150) at fitnesse.updates.WikiContentUpdater.addAllFilesToBeUpdated(WikiContentUpdater.java:126) at fitnesse.updates.WikiContentUpdater.makeAllUpdates(WikiContentUpdater.java:108) at fitnesse.updates.WikiContentUpdater.performAllupdates(WikiContentUpdater.java:89) at fitnesse.updates.WikiContentUpdater.update(WikiContentUpdater.java:39) at fitnesseMain.FitNesseMain.update(FitNesseMain.java:119) at fitnesseMain.FitNesseMain.launchFitNesse(FitNesseMain.java:83) at fitnesseMain.FitNesseMain.launchFitNesse(FitNesseMain.java:59) at fitnesseMain.FitNesseMain.main(FitNesseMain.java:39)

Configuration:

  • OS: Windows 10 x64bit
  • Browser [e.g. chrome, safari]
  • Version [e.g. 20200501] of FitNesse
  • Test System:
  • Plugins in use:

Additional context

nguyentuanviet77 avatar Oct 17 '20 10:10 nguyentuanviet77

Some questions:

  • Are you able to run using Gradle (run)?
  • What Java version are you using?
  • Are you running as a limited user account by any chance?

tcnh avatar Oct 21 '20 06:10 tcnh

From the screenshot I gather Java 8 is used. I'll update the README to indicate this is indeed required.

@nguyentuanviet77

  • Did you execute ./gradlew copyRuntimeLibs before trying to start the main?
  • Which directory did you clone the project in? Any chance its name contains a space or non-ASCII character (I've seen that cause problems in the past).

fhoeben avatar Oct 21 '20 06:10 fhoeben

Did Eclipse execute the gradle task createUpdateList for you?

I don't use Eclipse (I use IntelliJ community edition) when I try to start the main I see IntelliJ perform a gradle build first (ensuring all required work is done). Does Eclipse also do that also?

The output I get before starting main:

08:40:40: Executing task 'FitNesseMain.main()'...

> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy UP-TO-DATE
> Task :buildSrc:processResources NO-SOURCE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy UP-TO-DATE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
> Task :buildSrc:test UP-TO-DATE
> Task :buildSrc:check UP-TO-DATE
> Task :buildSrc:build UP-TO-DATE

> Configure project :
Building FitNesse v20201021...

> Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :compileGroovy NO-SOURCE
> Task :compileBootstrap
> Task :createUpdateLists
> Task :fitNesseVersion UP-TO-DATE
> Task :processResources
> Task :classes

> Task :FitNesseMain.main()
Bootstrapping FitNesse, the fully integrated standalone wiki and acceptance testing framework.

Having said that, I never start FitNesse this way. I use the gradle task specific for that task (like @tcnh suggested): gradlew run

Does that work for you?

Like I said I don't use Eclipse. If you get this to work, and it turns out extra steps are needed to run: can you maybe create a PR to update the README with better instructions for Eclipse?

fhoeben avatar Oct 21 '20 06:10 fhoeben

Hi @fhoeben ,

regarding your question i like to update some info below:

  • Java: Java 8
  • project directory: E:\Working\Fitnesse_20200501\fitnesse
  • and I ran below gradle commands but it still didn't work, please see the screenshot. image

nguyentuanviet77 avatar Oct 21 '20 13:10 nguyentuanviet77

Your screenshot suggests you are using Gradle 6.7. I haven't tested that version. Could you try using Gradle 6.3? That's the version you should get using gradlew, don't know why you are getting a different one.

fhoeben avatar Oct 27 '20 12:10 fhoeben