I have weblogic in localhost. My web application save some rdf:
String name = UUID.randomUUID().toString();
FileOutputStream fop = null;
try {
fop = new FileOutputStream(name);
} catch (FileNotFoundException e) {
}
model.write(fop);
When I go to the url where is this file saved I got this error:
XML Parsing Error: no element found
Location: http://url/0260fcff-b53d-4d18-8fb0-fb31f6a6ff1a.rdf
Line Number 1, Column 1:
Where I can find this file in my computer ?
PS I try to save this file with just java application and it works so rdf should be OK.
When you save a file without specifying the path, the file is saved at a location from where your JVM is invoked. For web applications this is typically the bin folder. So please check that location (e.g. for tomcat it would be {TOMCAT_HOME}/bin)
The way you are accessing the file (
http://url/0260fcff-b53d-4d18-8fb0-fb31f6a6ff1a.rdf)you are expecting it in the root of your web application.For example, if you have a tomcat based application say myapp.war the root of your web app would be
{TOMCAT_HOME}/webapp/myappThis is the reason the generated file is not found when accessed via a URL.
To make it work, specify a path (absolute path) to the file input stream (create a File object with desired path location, in this case it would be
{TOMCAT_HOME}/webapp/myapp)