Raj S Kumar

Ranch Hand
+ Follow
since Aug 06, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Raj S Kumar

If you use it like that Java will try to access the file located in the same directory, that the .class or .jar file is.



The log4j.xml is in the same directory as the .jar file. Yet, I am getting the exception when I call the .jar file from PHP.

If I place the log4j.xml in the same directory as the PHP page, Its working fine.
14 years ago
Hi Martin,
Thanks for the Reply.

My problem is not with accessing the jar files. But, the related xml files. I have placed the required library files in the \lib directory where the Application.jar file is.

In my application, I am referring to the xml file in this way. Should I change it in some way that, it would look for it in some specific location?

14 years ago
Hi,
My application has a command line interface and it is packaged into a .jar file. In my application, I use Log4J for logging. I have placed the log4j.xml at the same directory where the .jar file is kept and it works fine.
D:\Development\Filehandler\dist\...


But, when I call the .jar file from some other directory, for ex: C:\, it throws error as FileNotFound for the log4j.xml file. The reason for calling from some other location is, this jar file will be used by PHP. The PHP script will call the .jar file from some other location.

Please guide me in solving this issue....
14 years ago
Apologies. I had my analysis done wrong.
It is working fine, So changing the state to resolved.
14 years ago
The command is working. The problem is not with the commands, but with different streams. Raised a separate question in the Java forum
14 years ago
PHP
Hi,
I have a .jar file of my application. I am calling this jar file from a PHP script. The problem here is I am able to capture the output (System.out.println()) from the main function.
But, I am not able to get the output from other classes.

I am using the following PHP script.


Does this mean, even if its in a same Jar file and part of the same call stack, the output goes to different streams???
If so, how to make this work?

Your suggestions please....
14 years ago
Hi,
I have a jar file which does some process and print the output to the console. This file needs to be called from PHP and the output in the Console also to be captured.

When tried directly in the command line, the Jar file works fine and prints the output to the console.

I have tried with the exec, but its not working.



The output to this is just '0 0'

Should something else be done to call the jar file??

Posted in Stackoverflow.com also. will post here once I get an answer.
Thanks in Advance.....
14 years ago
PHP
Hi Praveen,

The problem here is in the logic. You are checking whether a File object is a directory or not. If its not, it deletes the file. If its a directory, it empties the directory by calling it recursively. But, the directory is not deleted.

Modified code:


Please note that, I didn't check this code.

Hope this solves the issue.
14 years ago
Yes Sarah, it works sometimes.

The reason is to save memory String objects are stored in a pool like structure. In some cases, if the content is same, they might refer to the same object. In such cases, '==' operator would work. But, this can't be relied upon.

Its always better to use the equals().

Hope this helps.
14 years ago
Hi Bill,
I want to find an alternative way instead of using the numbering of NodeList items. Is there an alternative?

I am getting the "Files" because, there might be some other tags with the same name "file". I want to collect only the "file" elements in the "Files" tag.
I have the following XML file listing and it needs to be parsed.




To parse this, I am using DOMParser with the following code.



I want to read the tag <tempName> and doing this @ line no. 11.

Is there any other way to retrieve the tag by Tagname rather than its position?
Hi,
I have a Jar file(an application) which works with some other third party applications(exe files) in the machine.
Now, I have to call the Jar file from a web application, which in turn should work with the Third party applications.

How this could be solved?

Please Help me on this.

Thanks in Advance
14 years ago
No editors available, it seems. I have started using Eclipse.
[ UD: Let's keep this topic to one subject. ]
Hi Ulf,
Thanks for the fast reply.

Could you please outline a way in which I could get Directory as input from the user?

Thanks in Advance