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

Windows XP - C:\Documents File Not Found #98

Open
romario89 opened this issue Feb 19, 2020 · 3 comments
Open

Windows XP - C:\Documents File Not Found #98

romario89 opened this issue Feb 19, 2020 · 3 comments

Comments

@romario89
Copy link

On Windows XP Emacs-25.2 meghanada-1.2.0.jar and meghanada-20190526.548 I open a sample Java file to check meghanada. Meghanada starts and displays Please wait. Meghanada indexing ... But it doesn't diplay Meghanada ready
When I edit the file classnames and method names come as dropdown, i.e. meghanada works at least partially. But on the messages I see

WARN not match type
Error:File . Please check *meghanada-server-log*

and

Error:c:/Documents . Please check *meghanada-server-log*

On the meghanada-server-log there chunks of code like:

java.io.FileNotFoundException: File 'C:\Documents' does not exist
	at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299) ~[meghanada-1.2.0.jar:?]
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711) ~[meghanada-1.2.0.jar:?]
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1748) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.CommandHandler.diagnostics(CommandHandler.java:115) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.emacs.EmacsServer.lambda$dispatch$8(EmacsServer.java:148) ~[meghanada-1.2.0.jar:?]
	at com.leacox.motif.matching.Matching1.lambda$get$15(Matching1.java:45) ~[meghanada-1.2.0.jar:?]
	at com.leacox.motif.matching.Pattern$1.apply(Pattern.java:40) ~[meghanada-1.2.0.jar:?]
	at com.leacox.motif.matching.FluentMatchingR.getMatch(FluentMatchingR.java:118) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.emacs.EmacsServer.dispatch(EmacsServer.java:350) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.emacs.EmacsServer.lambda$acceptConnection$35(EmacsServer.java:436) ~[meghanada-1.2.0.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_153]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_153]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_153]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_153]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_153]
[INFO ][EmacsServe: 352] receive [dl, C:\programs\java\sample\src\MySample.java, C:\Documents, and, Settings\IBMR61\Local, Settings\Temp\meghanada488kTN.java]. elapsed:1.675 ms

and

[INFO ][EmacsServe: 352] receive [dl, C:\programs\java\sample\src\MySample.java, C:\Documents, and, Settings\IBMR61\Local, Settings\Temp\meghanada488kTN.java]...

What should I do?

@romario89
Copy link
Author

I guess it's got something to do with the Windows XP's path names with spaces on it like C:\Documents and Settings\IBMR61 and when Meghanada tries to read from it, it results in pathnames like these (taken from the code above)

C:\Documents, and, Settings\IBMR61\Local, Settings\Temp\meghanada488kTN.java

You see commas after the names with space: 'Documents, ' That must be causing trouble.

@romario89
Copy link
Author

romario89 commented May 27, 2020

I think I've found the cause of the problem:

The tmpfile in meghanada--write-tmpfile function and the log file in meghanada--start-server-process function, at meghanada.el were using the C:/Documents and Settings/... path. I've harcoded those variables so that they will use the path like: C:/temp i.e. no spaces in path.

After this change, the aforementioned Error:c:/Documents problem disappeared and meghanada server started to print the member functions , the variables and the class objects as a dropdown box. That's good but one more problem occurs which I think is related to the same Windows XP Documents and Settings path. When I enter code in a java file the mini buffer says:

Error while checking syntax automatically...

because in the server log it says:

[ERROR][CommandHan:  49] Catching
java.lang.NumberFormatException: For input string: "**and**"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_153]
	at java.lang.Integer.parseInt(Integer.java:580) ~[?:1.8.0_153]

I guess the and in the log is the and at the Documents and Settings

@romario89 romario89 changed the title Windows XP Error:c:/Documents Windows XP java.io.FileNotFoundException: File **C:\Documents** does not exist Jun 14, 2020
@romario89 romario89 changed the title Windows XP java.io.FileNotFoundException: File **C:\Documents** does not exist Windows XP - C:\Documents File Not Found Exception Jun 14, 2020
@romario89 romario89 changed the title Windows XP - C:\Documents File Not Found Exception Windows XP - C:\Documents File Not Found Jun 14, 2020
@romario89
Copy link
Author

romario89 commented Jun 14, 2020

When I open a simple project named Permutasyon and type this simple Java code

System.out.println("OK");

Meghanada Server says in the mini buffer: WARN not match type
And I get this from the meghanada-server-log

[INFO ][Main      :  54] use java home: C:\ProgramFiles\zulu8.25.0.3-jdk8.0.153-win_i686\jre
[INFO ][Main      :  55] use java runtime: OpenJDK Runtime Environment 1.8.0_153-b01
[INFO ][Main      :  59] use java vm: OpenJDK Client VM 25.153-b01
[INFO ][ClassPathU:  26] add tools.jar path:C:\ProgramFiles\zulu8.25.0.3-jdk8.0.153-win_i686\lib\tools.jar
[WARN ][PerfDataUt: 228] Failed to add PDH Counter: \Memory\Pages Input/sec, Error code: 0xC0000BB8
[INFO ][Session   : 193] load project from cache. projectRoot:C:\java\Permutasyon
[INFO ][EmacsServe: 364] zpage tracez handler http://localhost:1062/tracez
[INFO ][EmacsServe: 370] Start server Listen localhost port:1065
[INFO ][EmacsServe: 391] client connected
[INFO ][CacheEvent:  71] start analyze sources ...
[INFO ][Project   : 318] project Permutasyon compile and analyze (java) 0 files. force:false problem:0 elapsed:36.55 ms
[INFO ][CacheEvent:  97] class index size:4665 total elapsed:1.046 s
[INFO ][CacheEvent: 102] Ready
[WARN ][JavaSource:  75] source cache miss C:\java\Permutasyon\src\.#Permutation.java
[ERROR][CommandHan:  49] Catching
java.io.FileNotFoundException: File 'C:\Documents' does not exist
	at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299) ~[meghanada-1.2.0.jar:?]
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711) ~[meghanada-1.2.0.jar:?]
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1748) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.CommandHandler.diagnostics(CommandHandler.java:115) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.emacs.EmacsServer.lambda$dispatch$8(EmacsServer.java:148) ~[meghanada-1.2.0.jar:?]
	at com.leacox.motif.matching.Matching1.lambda$get$15(Matching1.java:45) ~[meghanada-1.2.0.jar:?]
	at com.leacox.motif.matching.Pattern$1.apply(Pattern.java:40) ~[meghanada-1.2.0.jar:?]
	at com.leacox.motif.matching.FluentMatchingR.getMatch(FluentMatchingR.java:118) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.emacs.EmacsServer.dispatch(EmacsServer.java:350) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.emacs.EmacsServer.lambda$acceptConnection$35(EmacsServer.java:436) ~[meghanada-1.2.0.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_153]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_153]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_153]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_153]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_153]
[INFO ][EmacsServe: 352] receive [dl, C:\java\Permutasyon\src\Permutation.java, C:\Documents, and, Settings\use\Local, Settings\Temp\meghanada632eXl.java]. elapsed:155.9 ms
[ERROR][CommandHan:  49] Catching
java.io.FileNotFoundException: File 'C:\Documents' does not exist
	at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299) ~[meghanada-1.2.0.jar:?]
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711) ~[meghanada-1.2.0.jar:?]
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1748) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.CommandHandler.diagnostics(CommandHandler.java:115) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.emacs.EmacsServer.lambda$dispatch$8(EmacsServer.java:148) ~[meghanada-1.2.0.jar:?]
	at com.leacox.motif.matching.Matching1.lambda$get$15(Matching1.java:45) ~[meghanada-1.2.0.jar:?]
	at com.leacox.motif.matching.Pattern$1.apply(Pattern.java:40) ~[meghanada-1.2.0.jar:?]
	at com.leacox.motif.matching.FluentMatchingR.getMatch(FluentMatchingR.java:118) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.emacs.EmacsServer.dispatch(EmacsServer.java:350) ~[meghanada-1.2.0.jar:?]
	at meghanada.server.emacs.EmacsServer.lambda$acceptConnection$35(EmacsServer.java:436) ~[meghanada-1.2.0.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_153]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_153]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_153]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_153]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_153]
[INFO ][EmacsServe: 352] receive [dl, C:\java\Permutasyon\src\Permutation.java, C:\Documents, and, Settings\use\Local, Settings\Temp\meghanada632rhr.java]. elapsed:3.495 ms
[INFO ][EmacsServe: 352] receive [ap, C:\java\Permutasyon\src\Permutation.java, 12, 14, *System*println#]. elapsed:742.4 ms

Thats very likely to be caused by the Windows XP's default-directory i.e. C:\Documents and Settings\<username> spaces cause the Meghanada to interpret the line incorrectly.

@romario89 romario89 reopened this Jun 14, 2020
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

1 participant