contents of the text file is null

Added by kkangsar ts 904 days ago

Hi Karl,

      I want to see the contents of the text file. But it show the contents = null.

      Anything I have missed up. Please advice. Thanks.

      C:\supose-0.6.1-385\bin>supose.bat search --index mySVN.test --query +filename:pom.xml --fields contents
      Query: ' +filename:pom.xml
      Field[0]=contents Total Hits: 2
        1: CONTENTS:null
        2: CONTENTS:null

Replies

RE: contents of the text file is null - Added by Karl Heinz Marbaise 903 days ago

Hi,

could you please test the following nightly build:

Windows:
http://mvn.repository.soebes.de/com/soebes/supose/0.6.2-SNAPSHOT/supose-0.6.2-20090819.001944-21-bin.zip

Unix:
http://mvn.repository.soebes.de/com/soebes/supose/0.6.2-SNAPSHOT/supose-0.6.2-20090819.001944-21-bin-unix.tar.gz

Just please do a full rescan of the repository and try the same query...

Thanks in advance...
Kind regards
Karl Heinz Marbaise

RE: contents of the text file is null - Added by kkangsar ts 903 days ago

Hi Karl,

The result still the same.
Forgot to tell you, the file which I am going to see is in xml format.

Seem like the scan engine don't recognize the xml filetype. Because it do show when I saved it as txt format. Please advice. Thanks.

EDIT: Removed pre tag. (Karl Heinz Marbaise)

RE: contents of the text file is null - Added by kkangsar ts 903 days ago

Hi Karl,

It is working now. This is because the xml syntax is not defined correctly.
Anyway, Thanks for your help.

EDIT: Removed pre tag. (Karl Heinz Marbaise)

RE: contents of the text file is null - Added by kkangsar ts 868 days ago

Hi Karl,

The content of the java file didn't show. 
private String id;
private String firstName;
private String lastName;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
myJava.java
public class myJava {
Step to reproduce
C:\supose-0.6.2-SNAPSHOT-414\bin>supose.bat scan --create --url file:///D:/myProjectRepo/project --index SVNIndex.idx
C:\supose-0.6.2-SNAPSHOT-414\bin>supose.bat search --index SVNIndex.idx --query +filename:*.java --fields revision contents 
Query: ' +filename:*.java'
Field[0]=revision Field[1]=contents Total Hits: 1
1: REVISION:11 CONTENTS:null
I have checked the java index, it is valid. Do you have any clue why the content of java file didn't show.
Note: The file content can show if I changed the file extension from *.java to *.txt

RE: contents of the text file is null - Added by Karl Heinz Marbaise 865 days ago

Hi, sorry for the delay...but this can only happen if the Java has an incorrect syntax..means during the scanning phase it will be parsed and that might fail..and this can explain why contents is NULL...

Kind regards
Karl Heinz

RE: contents of the text file is null - Added by kkangsar ts 862 days ago

Hi Karl,

How do I know the parsed is failed during the scanning. Because the java file can execute without an error.
Thanks.

RE: contents of the text file is null - Added by kkangsar ts 841 days ago

Can we bypass the parse process during the scanning?

I have no idea how to solve it, appreciate if you can give me some hint on that.

Thanks in advanced.

RE: contents of the text file is null - Added by kkangsar ts 841 days ago

Hi Karl,

The parsing process in ScanJavaDocument.java is not working correctly
That's why the contents is always null.

RE: contents of the text file is null - Added by Karl Heinz Marbaise 831 days ago

Hi,

just change the configuration file fileextension.properties:
Just use
java = com.soebes.supose.scan.document.ScanDefaultDocument

instead of the following:
java = com.soebes.supose.scan.document.ScanJavaDocument

Kind regards
Karl Heinz

RE: contents of the text file is null - Added by kkangsar ts 784 days ago

Hi Karl,

Thanks for your help. It is working now.
I suggest to create class something like "ScanNothing", so that, user can skip some document which they do not what to scan.

Best Regards