Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebLogic 12.c does not serve static content from WAR

 
Rob Isaacs
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 265
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it should work fine.

can you give the tree structure of your war file ?

 
Rob Isaacs
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 265
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic