\nWhen I access the HTML file, 'http://localhost:7002/wl_test/index.html', it loads perfectly fine.
\n\nHowever when I attempt to load either of the following two URLs, they both fail with a HTTP 404 error. And yes, both of those files, one.ini and asdf.txt exist in the H:\\Backup directory.
\n\nWhat could be wrong with this trivial setup?
\n\nI'm beginning to think I don't understand how this is supposed to work.
\n","author":{"@type":"Person","name":"Randy Stegbauer"},"upvoteCount":4,"answerCount":3,"acceptedAnswer":{"@type":"Answer","text":"I think I understand what has changed and how to fix everything.
\n\nThere were two problems with the virtual directory mapping.
\n\nFirst, the local-path cannot be a MS-DOS SUBSTed drive. I don't understand why, but WebLogic doesn't like it.
\n\nSecond, when the url-pattern contains a folder, like /files/*, that folder must exist in the local-path directory.
\n\nBoth of these are allowed in the JRun server that this is being ported from.
\n\nSigh,\nRandy Stegbauer
\n","author":{"@type":"Person","name":"Randy Stegbauer"},"upvoteCount":4}}}Reputation: 1094
I am having a frustrating problem with virtual directory mapping in my very simple WebLogic 11g application. I installed WebLogic 11g OEPE, which installs WebLogic Server 10.35. I believe that this is installed correctly, because I am able to deploy a much more complicated application that is working fine...except for my issue with virtual directory mapping.
I want to access files from a directory outside of the web application, H:\Backup.
Here is my entire application, and these are my exact files.
wl_test/index.html
<html>
<head><title>WebLogic Test</title></head>
<body>
<h1>This is another new test<br>
</body>
</html>
wl_test/WEB-INF/web.xml
<web-app>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
wl_test/WEB-INF/weblogic.xml
<weblogic-web-app>
<virtual-directory-mapping>
<local-path>H:/Backup/</local-path>
<url-pattern>/files/*</url-pattern>
<url-pattern>*.txt</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>
When I access the HTML file, 'http://localhost:7002/wl_test/index.html', it loads perfectly fine.
However when I attempt to load either of the following two URLs, they both fail with a HTTP 404 error. And yes, both of those files, one.ini and asdf.txt exist in the H:\Backup directory.
What could be wrong with this trivial setup?
I'm beginning to think I don't understand how this is supposed to work.
Upvotes: 4
Views: 16016
Reputation: 1
The generatedReports and /app/reports are local folders in the file system. This way, you can put any type of files inside the generated Reports folder:
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
<weblogic-web-app>
<container-descriptor>
<index-directory-enabled>true</index-directory-enabled>
</container-descriptor>
<virtual-directory-mapping>
<local-path>/app/reports</local-path>
<url-pattern>/generatedReports/*</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>
Upvotes: 0
Reputation: 1094
I think I understand what has changed and how to fix everything.
There were two problems with the virtual directory mapping.
First, the local-path cannot be a MS-DOS SUBSTed drive. I don't understand why, but WebLogic doesn't like it.
Second, when the url-pattern contains a folder, like /files/*, that folder must exist in the local-path directory.
Both of these are allowed in the JRun server that this is being ported from.
Sigh, Randy Stegbauer
Upvotes: 4
Reputation: 316
I think there is something a little goofy about the combination of multiple url-pattern elements. Here's a sample showing the shared 404 file from my archives.
Part of the NotFoundWeb.war/WEB-INF/web.xml looks like this:
<error-page>
<error-code>404</error-code>
<location>/error/404.html</location>
</error-page>
Part of the NotFoundWeb.war/WEB-INF/weblogic.xml looks like this:
<wls:virtual-directory-mapping>
<wls:local-path>d:\temp\notfound</wls:local-path>
<wls:url-pattern>*.html</wls:url-pattern>
</wls:virtual-directory-mapping>
I have a file on the file system: d:\temp\notfound\error\404.html
So at runtime when I type something like: http://localhost:7001/NotFoundWeb/somebadurl
I get the error page from the file system.
Upvotes: 0