This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Not able to read XML file from dependent project Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "Not able to read XML file from dependent project" Watch "Not able to read XML file from dependent project" New topic
Author

Not able to read XML file from dependent project

sanjey asok
Ranch Hand

Joined: Jul 11, 2009
Posts: 36
I have two projects in eclipse ,one is Web application and other is standalone.web application has deoendency with standalone ie I want to read some XML file which are placed in standalone application.I configured the as follows
In web application 's-build path i have added the standalone application and in dependency I also selected the standalone project.
When i deploy the application on Tomcat ,under the web application I can see standalone application.

When I run the code the XML file are not read from the standalone. so I extracted JAR from standalone and placed in the LIB of the web application ,now I read the XML files .

Can you please explain why it is not working if I added the standalone directly to web application in Eclipse
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
What does "the files are not read" mean? Are they found at all? Are there any exception?


Android appsImageJ pluginsJava web charts
sanjey asok
Ranch Hand

Joined: Jul 11, 2009
Posts: 36
yes I got an exception saying file not found
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
If you want us to help you, then you need to TellTheDetails. Is the file located where the code expects it?

You're aware that web apps don't have a default directory, and that you need to absolute paths, right?
sanjey asok
Ranch Hand

Joined: Jul 11, 2009
Posts: 36
I have a Project “A” (Standalone) which has a XML file called a.XML and have a web application “B” which has a dependency with Project A.SO in eclipse I add the Project “A” in project B using
Project Properties-> bulid Path ->Project

Now Project B has Project A in it.
In Project “B” web .xml ,I have the below code



Exception I got is


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
So where *is* the file a.xml?
sanjey asok
Ranch Hand

Joined: Jul 11, 2009
Posts: 36
a.xml is in jar File is in Project A
sanjey asok
Ranch Hand

Joined: Jul 11, 2009
Posts: 36
please address this
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Not able to read XML file from dependent project
 
Similar Threads
Reading external XML file from an Axis Web Service
Error : class not found exception : com.mysql.jdbc.driver in eclipse Tool
how do i solve this error caused due to problem in spring initiation on tomcat
FileNotFoundException -- Spring Context.xml
Question for Eclipse/Tomcat