I am using com.oreilly.servlet.MultipartRequest for uploading files in servlets. But when my application is moved to a weblogic server...file upload doesnt work, it gives a error: "Not a directory" in weblogic, but works just fine in servlets. Do I need to change something for it to work while on weblogic server ?
So your locating the folder by looking in folders relative to the current working directory from where the JVM was invoked? Is this directory inside the webapp? Can you post the code that locates the directory?
ford Darcy Jr
Ranch Hand
Joined: Jan 26, 2005
Posts: 76
posted
0
Hi Ben,
Thanks for the immediate reply. This directory is in my web app.
Heres the code in servlets: MultipartRequest multi = new MultipartRequest(request, "../folder1/folder2", 10 * 1024 * 1024, new com.oreilly.servlet.multipart. DefaultFileRenamePolicy());
This works perfectly in servlets. But when I move it to the weblogic server...its not working. The path on the weblogic server where the program is running with an error "Not a directory" is: http://folderone/foldertwo/folderthree/folder1/folderfive/folder6 wherein folder6 is the java program name and folder1 corresponds to the foldername (folder1) listed in my java program.
Try using an absolute path for the directory. While your at it, make it a directory that isn't inside the web app -- at least initially.
Finding files on the local system with relative paths is always risky. You're counting on the current working directory of the JVM always being the same.
Also, if your app server is configured to run the app as a packed war file (without unpacking to an exploded file system), you will not be able to write to directories within the app.
Your best bet is to always use an absolute path that is configured as a servlet or context init param, with the directory being outside of the webapp. Write a servlet that streams the files if you need to access them again for downloading.
Try with an absolute path and let us know if it helps.
-Ben
ford Darcy Jr
Ranch Hand
Joined: Jan 26, 2005
Posts: 76
posted
0
Hi Ben,
Thanks a lot for the detailed explanation. I will try to use an absolute path.
Thanks.
ford Darcy Jr
Ranch Hand
Joined: Jan 26, 2005
Posts: 76
posted
0
Hi,
When I am using an absolute path on the weblogic server, I am getting this error: "Error 500--Internal Server Error From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: The server encountered an unexpected condition which prevented it from fulfilling the request". What does this mean...does it have to do anything with weblogic configuration or got to do with my java file upload application. The same program works just fine on my Java server.
Is your absolute path pointing to a directory within your webapp?
ford Darcy Jr
Ranch Hand
Joined: Jan 26, 2005
Posts: 76
posted
0
Hi Ben,
Thanks for the response. Yes, the absolute path is pointing to a directory in my web application. Please let me know where I am going wrong.
Thanks for all the help.
ford Darcy Jr
Ranch Hand
Joined: Jan 26, 2005
Posts: 76
posted
0
Hi,
I would like to know if Multipart Request file upload is not compatible on weblogic servers. My upload application works fine on Java platform but not when migrated to weblogic server. Any suggesstions ?