Re: Issue with JxtaSocket example
Bruce Rosenthal <[email protected]>
| Newsgroups | gmane.comp.java.jxta.user |
|---|---|
| Message-ID | <[email protected]> |
You want PlatformConfig.master in the classpath?
Why? It's an XML document.
FYI, I have added a call to File cfgFilePath = new
File(System.getProperty("user.dir")); and made the call to
getResourceInputStream as:
public static void createConfig(File home, String name, boolean server) {
try {
String fname = null;
File cfgFilePath = new File(System.getProperty("user.dir"));
System.out.println("Config File Path is: " + cfgFilePath);
if (server) {
fname = "ServerPlatformConfig.master";
} else {
fname = cfgFilePath + "\\PlatformConfig.master";
}
System.out.println("Config file is: " + fname);
InputStream is = getResourceInputStream(fname);
home.mkdirs();
PlatformConfig platformConfig = (PlatformConfig)
AdvertisementFactory.newAdvertisement(MimeMediaType.XMLUTF8, is);
is.close();
Here is what I get in the stdout at this time:
init:
deps-jar:
Compiling 1 source file to C:\jxtaApps\PipeService\build\classes
compile-single:
Starting JXTA
Config File Path is: C:\jxtaApps\PipeService
Config file is: C:\jxtaApps\PipeService\PlatformConfig.master
Where do we drive now?
Mohamed Abdelaziz wrote:
> I don't know why I overlooked the obvious (still in vacation mode),
> Since it is being loaded as resource, ensure it exists in the classpath.
>
> Mohamed
>
>
> Martin Gainty wrote:
>
>> Agreed - $CWD will change
>> Following the principle of aliases in httpd.conf
>> I would suggest setting up a property or predefined environment
>> variable and use the property or env variable for your relative path
>> Martin-
>> ----- Original Message ----- From: "Mohamed Abdelaziz"
>> <[email protected]>
>> To: <[email protected]>
>> Sent: Monday, August 22, 2005 4:31 PM
>> Subject: Re: [JXTA user] Issue with JxtaSocket example
>>
>>
>>> I suggest you specify the full canonical path of the file instead.
>>> IDE's usually alter the $CWD, which would result in the behavior
>>> you're seeing.
>>>
>>> Mohamed
>>>
>>> Bruce Rosenthal wrote:
>>>
>>>> Unfortuneatly, I have it in $CWD, $CWD/.jxta, $CWD/client (just to
>>>> cover my bases).
>>>>
>>>> I also tried forcing the issue by invoking InputStream is as follows:
>>>>
>>>> InputStream is =
>>>> getResourceInputStream(System.getProperty("user.dir") + "\\" + fname);
>>>>
>>>> and that also doesn't work.
>>>>
>>>> I can show you vai a WebEx if you want.
>>>>
>>>> Mohamed Abdelaziz wrote:
>>>>
>>>>> sounds like "PlatformConfig.master" does not exist in $CWD
>>>>
>>>>
>>>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]