Ramaswamy Srinivasan

Ranch Hand
+ Follow
since Aug 31, 2004
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ramaswamy Srinivasan

There is this web application. I am currently working on setting up the development environment for the same.
I encounter the following problem.

1. At certain stage during the application start-up, the app reads some HTML template file.
2. To do this, it opens the "resource as a stream".
3. Directory path is being read from the configuration file.
4. File name is then appended to the path, after concatenating the "java.io.File.separator" character.
5. Once we do this, the returned value (path) ishaving the following problem

Should have been: \WEB-INF\pages\templates\en\file.html
Is now looking as : \WEB-INF\pages\templates\en/file.html -- value returned after appending the separator.

Obviously, this results in a NullPointerException. According to the Java API spec, java.io.File this is the value of a system property. However, System.setProperty() did not work.

Is there any way I can modify the system property to change the separator? Please let me know, if there's any other way to solve the problem. Thanks in advance!
14 years ago

Maya Pillai wrote:How to insert data into address book of Outlook Express from Java.


This might solve your problem


The twist is, it is just an evaluation version. The full version is priced, not a freeware.
14 years ago

Vivek Viswanathan wrote:I have been using spring for almost 2 years now. I am planning on taking the Certification (that if I do get a voucher from SpringSource based off the 'grandfathered' candidate) I am planning on using the book 'Spring in Action' rather than 'Pro Spring' since 'Spring in Action' is more current.
I havent used the following spring features at work AspectJ, Srping+Hibernate, Spring+iBATIS, Securing Spring, Spring+Webflow, Do you think that 'Spring in Action' is a good book to cover all these topics, in addition to the Spring online reference documentation.

@Vivek, I second the book "Spring in Action". At least, I feel I am comfortable with this book.
On another note, how are you planning to be eligible for "Grandfathered candidate"? Any pointers to kick-off with?
14 years ago

Akash Bhatt wrote:Hi All,

I'm preparing to take SpringSource Certified Professional.

Does anybody know where in India, can I get the required 4 day training ?

Thanks in Advance.

Akash, you may be interested in this link

14 years ago

Rob Prime wrote:In my Java 6 JDK it's rt.jar - the JAR file that basically contains the entire API. In my Java 1.4 JDK it's not present.

Perfect!! Thanks.
14 years ago

Can someone point me out the jar which contains com.sun.corba.se.impl.protocol.giopmsgheaders.Message?

Thanks much in advance.
14 years ago

Randi Randwa wrote:

It is a good idea never to install anything on the server for security reasons. But, you can access server log files (for reading).

To process a log file, you can use something similar to http://www.biterscripting.com/SS_WebLogParser.html . You can run this script directly on a remote file as follows. Enter the following command in biterscripting.


Thanks Randi, Looks like we've got something interesting here. However, is there any constraints for this to work? In terms of ports being open, or a VPN access or something like that? Why I ask this question is because, the remote computer is on a different Domain than mine!!

Thanks a lot
14 years ago
Figured out that it is a problem with the wait time for the session and client to close.
Rest of the code works fine, but after 4 minutes, in the last trial.
14 years ago
Dear All,

I have the following scenario

1. A main class

2. From a method in this class, I invoke a static method that downloads a file from a FTP location using the J2SSH API.

3. The file downloads fine, I can see it in the specified path.

4. Following the download call, I have the code to parse the file and pick up some information in the main class, from where I invoked the static method to get the file.

5. This does not work. Basically, the control does not return to the invoking point.

6. Same code works fine, if I remove the FTP part and test for a local server

Any idea, what could be the problem? Any help is much appreciated.

14 years ago

Kengkaj Sathianpantarit wrote:

Ramaswamy Srinivasan wrote:

Kengkaj Sathianpantarit wrote:Have you looked at java.util.Timer?


Thanks for the input. I will look at it for the scheduling part of it. Would you have any specific pointers to the core class design?

I'm not sure what you mean by core class design, you should have a look at java.util.Timer first. It provides the things you were thinking to implement out of the box.

Thanks again, for your reply.

True -- Timer and TimerTask can do it out of the box, but I am trying to write some code of my own here -- this is for learning purpose, and not for my business purpose. I have already tried Timer and TimerTask for some other purpose. This time, I want to try doing it on my own. I can even use windows scheduler for the time based scheduling part, but how best we can get the tasks automated was my question.

Kengkaj Sathianpantarit wrote:Have you looked at java.util.Timer?


Thanks for the input. I will look at it for the scheduling part of it. Would you have any specific pointers to the core class design?

David Newton wrote:You're re-implementing Quartz?

Thanks for your reply.

I am actually not implementing Quartz. I was considering using Quartz for the "scheduling" part of my mini-mini app.
However, I first wanted to get my design proper, that's why I posted here.

James Clarks wrote:To start, start to shift your mind into thinking about "objects" not classes. You want to design a system of objects.

You might want to study the source code for Apache Ant build tool, e.g. org.apache.tools.ant.Task

Thanks James -- however, could you kindly explain, in what way this perspective shift will help me?

I have got a query in the design I am currently working on.

Scenario in brief

1. To automate set of tasks, performed at different times of the day.
2. Things we need to consider -- A core system to perform the tasks, and a scheduler to invoke them appropriately.
3. Tasks vary in type, like parsing a log file, invoking a batch file etc.

When I try to design the core set of classes that would perform the underlying tasks, I can think of the following approach.
I very much want to fine-tune my designing experience, as I am just starting with it.

1. The tasks are different in nature. However, to represent all tasks as entities, we can have a common base class.
2. The base class can be an "abstract" Task.
3. All the tasks will be derived from this. It would mean "ParseLogFile IS-A Task", for an instance.
4. We can have an interface "Performable" and a method "performTask()" which can be implemented by the "concrete" tasks.

Kindly validate this, and help me fine-tune it. Also, to extend this, I want to include the following features

1. A TaskFactory -- that instantiates a type of task, depending on the input (which could be time here)
2. A scheduler to trigger the instantiated task.

Kindly throw light on how we can go about, achieving a good design. I know, the question may sound little abstract, but I solicit your inputs. Thanks in advance.