Rohit Bajaj
asked on
java spring ClassPathResource
Hi,
I am getting the following exception :
java.io.FileNotFoundExcept ion: class path resource [xsl/ExtremeSearchRQ.xsl] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/data/ytxdist/SCH EDULER/Ext remeSearch /libs/yatr a_extremes earch.jar! /xsl/Extre meSearchRQ .xsl
The following code throws this exception :
The exception is thrown by the resource.getFile() line.
I am running my project with the following line :
java -cp "libs/*:conf" com.yatra.extremesearch.ap p.ExtremeS earchApp
Here the libs folder contains the yatra_extremesearch.jar file
when i unzip the jar i also see the file xsl/ExtremeSearchRQ.xsl
Still its giving an exception saying fileNot Found
What could be reason for this.
Thanks
I am getting the following exception :
java.io.FileNotFoundExcept
The following code throws this exception :
String xslSourceFile = "xsl/ExtremeSearchRQ.xsl";
String xmlSource = "ExtremeSearchRQ.xml";
Writer paramWriter = new StringWriter();
Transformer transformer=null;
ClassPathResource resource = new ClassPathResource(xslSourceFile);
StreamSource streamSrcFile;
streamSrcFile = new StreamSource(resource.getFile());
The exception is thrown by the resource.getFile() line.
I am running my project with the following line :
java -cp "libs/*:conf" com.yatra.extremesearch.ap
Here the libs folder contains the yatra_extremesearch.jar file
when i unzip the jar i also see the file xsl/ExtremeSearchRQ.xsl
Still its giving an exception saying fileNot Found
What could be reason for this.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.