Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!

Tom Sullivan

Ranch Hand
+ Follow
since Dec 20, 2005
Merit badge: grant badges
For More
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 Tom Sullivan

I am not starting from the premise that I am right and it is wrong. That's the point behind the post. And, yeah, I did ask for it, that's also the point behind posting.

Here's the steps I have taken:

Start the program: c:\rai\temp gets created on the laptop - like you would expect.
Copy the same XML file down from the network - the one I used on my local machine for testing - to the laptop and put it in the c:\rai\temp dir so now I have: c:\rai\temp\ImageProcessXML.xml in the directory. I'm looking at the damn thing and the system created the file paths so go figure.
Watch the system run and say the file is not there even though I can SEE it.

This has been tested now on several machines and not on all of them by me - my network admin has done the same.

Why would the system run and process the file on the laptop if I comment out the boolean if parameter. In other words, if I take out IN_XML = f.exists() and just set IN_XML = true, the system runs, parses the XML file and everyone is happy - except now it tries to run every time the timer�s run() method is invoked since there's no check to see if the file actually EXISTS! So, while you tell me that the file must not be there if the system says it�s not there, that�s not what I see happen when I don�t do a check for the file and just tell the system to parse it.

I�d be happy to send you the executable jar along with the XML docs if you like. And, I don�t care if it is simple or not. I just want to figure it out and fix it. But thanks.
16 years ago
Hello. Can anyone help?

When I run from Netbeans, everything works. I get expected results when I add documents to the folder the system creates. I copied everything, including the test XML document up to my network and transfered it all to my laptop. I run the Processor.jar and the folders get created. I then copy the same XML document that I am using on my local machine down from the network to the laptop and nothing happens. It just sits there reporting that File f = new File(xmlDocument).exists() = false! Has anyone ever had anything like this happen? The shutdown.txt doc also does not get seen even though it works as expected on the development system. This has to be something simple. Can anyone help?


16 years ago
I have a TimerTask object which polls a directory looking for documents which tell the system what to do. It acts properly on my development system but won't work in deployment.

The code is below.

In checkShutDown() you can see the dir the system looks at for instructions, "c:\\rai\\temp\\". The system makes this dir when it first starts so I know it works (plus I'm getting a console printout for testing right now as you can see). This part is consistent on both the dev and deployment testing systems.

The problem is under run():

File f = new File(xmlDoc);
IN_XML = f.exists();

IN_XML will return false no matter what is in the dir. checkShutDown() does not see the shutdown command either but I'm sure that's the same problem so I'll stick to the one issue for now.

The process document is an xml document. It is named ImageProcessXML.xml. It is put in the c:\rai\temp directory. So the string that is passed to the File object is "c:\\rai\\temp\\ImageProcessXML.xml". When I check to see if it exists, "IN_XML = f.exists()" I get false every time so the ImageProcessor never starts up. If I comment out that line, the system finds the doc and runs the XML parser. How can this be? The same problem is found in checkShutDown(), system returns false for exists on that document too - but works perfectly on the development box.

Thanks for your help.

16 years ago
LOL. Just figured it out. Did not see a space in the string so I fixed that. Duh...
16 years ago
Thanks Dan. The drive is mapped. I can browse it just fine from the same machine I'm running the test from (the drive is my personal drive on the network). Yet, the IO exception??? Could there be some other problem? I KNOW I have all the permissions I need.
16 years ago
Sorry for posting in the wrong forum from the start. Oops. Anyway, thanks for the help. I don't understand why I can't just say: "u:\\mydir" or, as I have here, "\\\\sweetums\\...". Can someone show me an example of what I need to do?
16 years ago
I need to write a file from my local machine to a network path. Here is how I am doing it:

When I do this, I get a I can browse to the directory just fine with Start ---> run ---> \\sweetums\users$...

What am I doing wrong?

Thanks for your help.

16 years ago
I'm interested in this from a learning perpsective. Why don't you create test methods that will test the string for type? Then you could return an enum. Why would something like this not work:

Then you can create methods for each type you desire and pass the string to it to get the value which you know is the value you need. It sort of sounds like you already know what type you need though so what is the reason you would not create methods that return the type you need and just call those methods when appropriate?
16 years ago
Thanks very much for the help. I'll go get the MS schema and see if that solves the problem.
I thought I did that. My parse() function looks like this:

I am getting unexpected values from an XML parse using DOM. Can someone tell me why this is happening?

Here is the XML node I'm parsing:

That is an MS Excel 2003 doc converted to XML. Here is the test code to parse just this node:

Here is the output:

ROOT: Workbook
NODE NAME: DocumentProperties
List size = 11
Node: 0 Name: #text
Node: 1 Name: LastAuthor
Node: 2 Name: #text
Node: 3 Name: LastPrinted
Node: 4 Name: #text
Node: 5 Name: Created
Node: 6 Name: #text
Node: 7 Name: LastSaved
Node: 8 Name: #text
Node: 9 Name: Version
Node: 10 Name: #text

First problem is that I expect 5 nodes not 10. Where is: "#text" coming from?

I also do not understand why I have to say:

Node nextNode = root.getFirstChild()
Element docNode = nextNode.getNextSibling()//docNode should be first child

"DocumentProperties" should be the first child. But if I rely on that, I again get a node name of: "#text" as well.


Thanks Masoud.

I wanted the project to have more heap size. I searched the help contents of NetBeans before posting and got no hits. But with your guidance, I was able to set the heap size and my project did not run out of memory when I ran it from within NetBeans so thanks!

I usually write it as follows:

[ July 12, 2006: Message edited by: Tom Sullivan ]
16 years ago
How about:

16 years ago
Here's one way but maybe not the best or only way.

16 years ago