0

I'm trying to build a JSF app on a glassfish 4.1 server. I have a apache 2.4 in front of glassfish as a proxy server. The app is using the bootsfaces or the primefaces frameworks. The same happens to both of them.
What's my problem. When I run the app within my network, directly from the glassfish, everything are ok. It is also looking good when I run the app from web bypassing the apache proxy. But when I run it be calling it via apache, the css are not working. I have a look at the page source code and I found this: On the head part of my page, I have the

<link type="text/css" rel="stylesheet" href="/gk-1.0-SNAPSHOT/faces/javax.faces.resource/theme.css?ln=primefaces-aristo" />

link.
When I click on the href from the "glassfish" page, I can view the css contents.
But when I click on the href from the "apache" page, I got an 404 error page:

<h1>HTTP Status 404 - Not Found</h1><hr/><p><b>type</b> Status report</p><p><b>message</b>Not Found</p><p><b>description</b>The requested resource is not available.</p>

Both the jars are included to my war file.
Any help will be valueable
Thank you

  • At first sight, everything looks OK to me. Judging from what you write, the problem has something to do with Apache (or the load balancer, or your firewall, or any other component between your Glassfish and the internet). Did you already try to install a local Apache from scratch and test whether the bug occurs, too? – Stephan Rauh Feb 15 '17 at 21:00
  • You could also try to access a css file in your project. I.e. a css file that's access with an URL mapping the file system, instead of using the indirection "javax.faces.resource". Can you access this file through your Apache? – Stephan Rauh Feb 15 '17 at 21:03
  • @StephanRauh Thank you for your answer. I did a fresh apache install, and I create a laptop01.conf file in /etc/httpd/conf.d There I add the following: NameVirtualHost *:80 ServerName laptop01 ProxyPass / http://localhost:8080/gk-1.0-SNAPSHOT/ I restarted the httpd service. When I go to the http://localhost:8080/gk-1.0-SNAPSHOT/ everything are ok. But when I enter laptop01 to my firefox, then the css properties do not work. In my war, I also included a file (pdf) which is accessible from both urls – George Karavas Feb 16 '17 at 11:34
  • I also noticed something more. When I type http://localhost:8082/gk-1.0-SNAPSHOT/index.xhtml the css is not working. But when I type http://localhost:8082/gk-1.0-SNAPSHOT it's working! – George Karavas Feb 16 '17 at 12:29
  • 1
    Solved! My mistake. The problem was on apache .conf file. FYI I was using the application context in the ProxyPass directive :( – George Karavas Feb 16 '17 at 17:58
  • I'm glad you've found the error. Thank you very much for reporting back! – Stephan Rauh Feb 17 '17 at 22:41

1 Answers1

0

Just for the record (because I believe questions should have an answer): as it turned out, the problem was a configuration error in an apache configuration file. It doesn't have anything to do with JSF, BootsFaces, or JavaEE. Also see the comments below the question.

Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37