Open SreyasSultan opened 4 years ago
You are saying that Git project is searched however the NPE happens in AccuRev repository. Do you use AccuRev at all ?
Could you post the contents of your configuration.xml
file ? Could you try upgrading to the most recent OpenGrok version and see if the problem persists ?
For the record the NPE happens here (using ~1.1-rc21 source code):
453 public String getDepotRelativePath(File file) {
454
455 String path = depotRoot;
456 try {
457 // This should turn any symbolically linked paths into the real thing...
458 Path realPath = Paths.get(file.toString()).toRealPath();
459 // ... so that removing the workspace root will give the depot relative path
460 // (Note realPath should always be starting with wsRoot.)
461 String relativePath = realPath.toString().substring(wsRoot.length());
462
463 if (relativePath.length() > 0) {
464 path = Paths.get(depotRoot, relativePath).toString();
465 }
466
I think the NPE is most likely caused by wsRoot
to be null
as it is its default value. Anyhow, if the repository is not Accurev the code should not have been executed in the first place.
The code has not changed since so likely the issue exists in the current code base.
Describe the bug
java.lang.NullPointerException happens when I do a code search after my project got indexed. at
OS - Fedora 20 Tomcat - Apache Tomcat/8.5.33 JDK - java version "1.8.0_131" OpenGrok - opengrok-1.1-rc21 Source type - GIT source
To Reproduce After indexing my GIT source, if I search a file "CVT.cc". It shows "java.lang.NullPointerException" as above snippets
Expected behavior Should be able to search those source after indexing.
Screenshots Couldn't share the screen shots
Additional context Add any other context about the problem here.