aspose file tools*
The moose likes BEA/Weblogic and the fly likes WebLogic 12.c does not serve static content from WAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "WebLogic 12.c does not serve static content from WAR" Watch "WebLogic 12.c does not serve static content from WAR" New topic
Author

WebLogic 12.c does not serve static content from WAR

Rob Isaacs
Greenhorn

Joined: Mar 12, 2014
Posts: 20
I have a WAR file that includes some JSP / HTML files in the WAR root. When I try to access these in my browser I get a 404 though, even though the paths are correct. This occurs if I deploy from within Eclipse, but also if I deploy the WAR file in the console application. The same WAR works just fine in JBoss. Am I missing something?

For a reference, my web.xml and weblogic.xml:
Rob Isaacs
Greenhorn

Joined: Mar 12, 2014
Posts: 20
Note that the /login.jsp doesn't work properly; I had to create a servlet to serve the content instead.
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 178

it should work fine.

can you give the tree structure of your war file ?


http://devwebcl.blogspot.com/
Rob Isaacs
Greenhorn

Joined: Mar 12, 2014
Posts: 20
/META-INF/maven/...
/META-INF/MANIFEST.MF
/WEB-INF/classes/...
/WEB-INF/lib/...
/WEB-INF/web.xml
/WEB-INF/weblogic.xml
/login.jsp
/test.html
Rob Isaacs
Greenhorn

Joined: Mar 12, 2014
Posts: 20
If I add a servlet + servlet mapping for login.jsp then that works:
Without these two blocks my login.jsp still does not work.

I have also checked all my servlets and filters, and they all have URL patterns that start with / so I don't think there are any conflicts because of those.
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 178

still it is awkward, I have done a very simple war file to access a JSP and I can access without any problem (12.1.2).
Rob Isaacs
Greenhorn

Joined: Mar 12, 2014
Posts: 20
Wow, I've found the problem. After your post I tried removing parts from my WAR file:
* First I cleared just about everything except the static content, and it worked.
* Next step: clear only the web.xml and weblogic.xml. It didn't work again.
* Next step: clear the classes. It worked!

So I went through all my classes, and found the cause. There was one sub class of javax.ws.rs.Application annotated with @ApplicationPath("/"). Apparently this application didn't break any of my servlets but it did break all static content and JSPs. After changing the annotation's value the static content and JSPs work again!

Thanks for your help, I don't think I would have found the cause without it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebLogic 12.c does not serve static content from WAR