Commons Digester: FileNotFound Exception
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hello there,
I am using the Apache Commons Digester as a way to load up and marshal XML config files. Am using Tomcat 5.5.9 and JDK 1.5.
I have an init servlet which loads an xml file config file (holding information to two more XML config files). I get the following exception at runtime:
My XMLConfigServlet:
ConfigHelper (This is where the exception actually occurs, look for my comment, in order, to pinpoint the actual line of code):
Here's the affiliates-rules file:
AffiliateBean:
The actual affiliates-config file itself:
Here's my web.xml file:
Why is it failing inside ConfigHelper? For some odd reason, it can't seem to find the contractor-config.xml file's location from the affiliates-config.xml file.
Sincerely,
James
[ January 26, 2007: Message edited by: James Dekker ]
I am using the Apache Commons Digester as a way to load up and marshal XML config files. Am using Tomcat 5.5.9 and JDK 1.5.
I have an init servlet which loads an xml file config file (holding information to two more XML config files). I get the following exception at runtime:
My XMLConfigServlet:
ConfigHelper (This is where the exception actually occurs, look for my comment, in order, to pinpoint the actual line of code):
Here's the affiliates-rules file:
AffiliateBean:
The actual affiliates-config file itself:
Here's my web.xml file:
Why is it failing inside ConfigHelper? For some odd reason, it can't seem to find the contractor-config.xml file's location from the affiliates-config.xml file.
Sincerely,
James
[ January 26, 2007: Message edited by: James Dekker ]
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Does the account that is used to run the servlet contgainer have access privileges to "/temp"? Is it possibly run with a security manager that doesn't allow access?
[ January 26, 2007: Message edited by: Ulf Dittmer ]
[ January 26, 2007: Message edited by: Ulf Dittmer ]
James Dekker
Ranch Hand
Posts: 231
1
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf,
If it didn't have access privileges then why would it return the correct element under the <name> tag in affiliates-config.xml?
For some odd reason, it seems as the marshalling conducted by Apache Commons Digester doesn't like File type objects?
Cheers,
James
[ January 27, 2007: Message edited by: James Dekker ]
If it didn't have access privileges then why would it return the correct element under the <name> tag in affiliates-config.xml?
For some odd reason, it seems as the marshalling conducted by Apache Commons Digester doesn't like File type objects?
Cheers,
James
[ January 27, 2007: Message edited by: James Dekker ]
Ulf Dittmer
Rancher
Posts: 43081
77
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ah, I hadn't realized that it actually started to digest that file.
On closer inspection, I'm fairly certain that problem is that in AffiliateBean you're treating fileName as File, when it should be String. File can't be (de)serialized.
On closer inspection, I'm fairly certain that problem is that in AffiliateBean you're treating fileName as File, when it should be String. File can't be (de)serialized.
James Dekker
Ranch Hand
Posts: 231
1
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf,
If that's the case, than my objective has failed... I need to tell it how to marshal the location...
Should I being using JAXB instead?
Thanks for your support,
James
If that's the case, than my objective has failed... I need to tell it how to marshal the location...
Should I being using JAXB instead?
Thanks for your support,
James
Ulf Dittmer
Rancher
Posts: 43081
77
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
JAXB is just a different way of binding XML to Java. It doesn't change the fact that File can't be (de)serialized.
What is the problem with binding the file name to a String (from which you can get a File object very easily)?
What is the problem with binding the file name to a String (from which you can get a File object very easily)?
James Dekker
Ranch Hand
Posts: 231
1
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf,
Do you mean using a cast for pulling the File object from the String?
Can you elaborate?
Thanks,
James
Do you mean using a cast for pulling the File object from the String?
Can you elaborate?
Thanks,
James
Ulf Dittmer
Rancher
Posts: 43081
77
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
No, a File object can't be somehow saved as a string. I'm talking about "File f = new File(String)". It's the standard way of constructing a File object from a file name.
James Dekker
Ranch Hand
Posts: 231
1
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf,
You were right! It had to do with changing the in AffiliateBean from File to String. Guess the Commons Digester doesn't take File properties.
Thank you,
James
You were right! It had to do with changing the in AffiliateBean from File to String. Guess the Commons Digester doesn't take File properties.
Thank you,
James
| He baked a muffin that stole my car! And this tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |






