Tomcat application is not working under www: 404 Not Found

Created:

2016-12-18 06:53:14 UTC

Modified:

2017-08-16 16:51:25 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Tomcat application is not working under www: 404 Not Found

Applicable to:

  • Plesk Onyx for Linux

Symptoms

Java application is not working under 'www', for example, http://www.example.com/sample , however, it is working without - http://example.com/sample .

Switching in Plesk > Subscriptions > example.com > Hosting Settings > Preferred domain > www did not help, page is not loading using 'www'.

The following error occurs on an attempt to open a Tomcat web-site:

Error 404:
FATAL: com.sun.faces.context.FacesFileNotFoundException: /hexserver/app/overview.xhtml Not Found in ExternalContext as a Resource
javax.faces.FacesException: com.sun.faces.context.FacesFileNotFoundException: /hexserver/app/overview.xhtml Not Found in ExternalContext as a Resource
 at com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:117)
 at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:241)
 at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

Tomcat application is using www prefix.

Cause

This is Plesk bug with ID #PPPM-5325 , the fix will be included in the next Plesk updates.

Resolution

As a workaround:

  1. Connect to the server using SSH .
  2. Enable 'www' using Plesk CLI:
    # plesk bin domain_pref -u example.com -www false
    # plesk bin domain_pref -u example.com -www true
  3. Or manually add the host into /usr/share/tomcat/conf/server.xml
    <Host deployXML="true" name="www.example.com" appBase="psa-webapps/example.com" unpackWARs="false" autoDeploy="true" liveDeploy="true">
    <Realm className="org.apache.catalina.realm.MemoryRealm" pathname="psa-users/example.com.xml" validate="true"/>
Have more questions? Submit a request
Please sign in to leave a comment.