angsarf / remotedroid

Automatically exported from code.google.com/p/remotedroid
0 stars 0 forks source link

Missing config.xml error #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Lanch RemoteDroid server

What is the expected output? What do you see instead?
Expected output would not include a stack trace. Instead a more friendly 
message could appear perhaps.

What version of the product are you using? On what operating system?
Latest SVN, Linux.

Please provide any additional information below.
Suggested patch attached.

Original issue reported on code.google.com by rich.mid...@gmail.com on 8 May 2010 at 9:32

Attachments:

GoogleCodeExporter commented 9 years ago
My guess is this problem can happens because of the OS. I just checked out the 
source
and try to launch the application and I realized that directory separator 
character
is "\" no matter what the OS is. 

Line 76 in AppFrame.java:
                basePath = System.getProperty("user.dir") + "\\res\\";
The "\\" should not hardcoded and instead there should be something like:
if("\\".equals(System.getProperty("file.separator")) {
   basePath = System.getProperty("user.dir") + "\\res\\";
} else {
   basePath = System.getProperty("user.dir") + "/res/";
}

Without this patch, I have the following exception when I launch the 
application:
java.io.FileNotFoundException: /home/deeeed/workspaces/Eclipse 3.5
Java/RemoteDroidServer\res\config.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
    at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.jav
a:161)
    at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLE
ntityManager.java:653)
    at
com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(X
MLVersionDetector.java:186)
....

Original comment by dee...@gmail.com on 30 May 2010 at 4:10

GoogleCodeExporter commented 9 years ago
I've written a patch based on deeeed's logic. 

I think gall.bladder said that once the code is packaged in a jar, there is no 
problem finding the config.xml, however I guess the fix just makes it look 
nicer :)

Alex Deriziotis

Original comment by derizio...@gmail.com on 10 Jul 2010 at 8:57

Attachments:

GoogleCodeExporter commented 9 years ago
This should be resolved with svn version 31, R2
I replaced all path seperators with '/' as all os's that care seem to use '/'

Original comment by onecs...@gmail.com on 6 Sep 2010 at 7:20