-1

I have migrated one of my web applications from Weblogic 10.3.6 to JBoss 7.1. For some reason, none of my css-files packaged inside the war-file is working anymore. Take a look at the consol message:

enter image description here

This is the only message I get, and it is only a warning, not an error. Even with that warning, I would expect the CSS to work. I can also find all of the css files in the resources tab, in the Chrome debugger.

The exact same thing happens in other browsers as well.

CSS files downloaded through CDNs are evaluated however. Any ideas whatsoever how to debug this?

EDIT:

All CSS files are available in dev tools. Both in resources tab, and network tab. The full content of each file is available. They seem to all be there, but not be evaluated.

EDIT 2:

After further reading in the network tab, I can see a difference between my old deployment (weblogic) and the new (JBoss). Even though I specify type="text/css", the css files are retrieved with type="text/html" in the JBoss deployment. This question here offers a myriad of possible solutions, none of which I have been able to implement yet.

This answer states that:

"Then something else about your server is making that stylesheet come with the wrong content type"

Any ideas at all on what that "something else" can be?

jumps4fun
  • 3,994
  • 10
  • 50
  • 96
  • Please, [edit] your question and provide a [mcve]. In particular, post the code as text, not as images. – Sebastian Simon Nov 17 '17 at 11:27
  • The code is posted as an image instead of text, to display the warning message. I acknowledge that this question might not be suitable for the stackoverflow format, but your comment is really not helpful at all. How do you suppose I make a Minimal, Complete and verifiable example of this? – jumps4fun Nov 17 '17 at 11:52
  • The files are most likely not found and redirect to some `404.html` page. The dev tools provide a **Network** tab. If the resources are not found, which _actual URL_ is requested? – Sebastian Simon Nov 17 '17 at 11:56
  • Thanks for that. But the css-files are all there. Both in network tab and source tab. I can also see the full content of the files in the dev tools. – jumps4fun Nov 17 '17 at 11:59
  • It seems they are all there, but not being evaluated – jumps4fun Nov 17 '17 at 11:59

1 Answers1

0

I found it.

Because of special scandinavian characters, I had implemented a CharsetFilter class, which was intended to make sure that character encoding always was the same. However, I also set content type. It did not break the application while deployed on weblogic, but JBoss handled it differently. I simply removed the top line of these two:

    response.setContentType("text/html; charset=UTF-8");
    response.setCharacterEncoding("UTF-8");

And now it works.

jumps4fun
  • 3,994
  • 10
  • 50
  • 96