• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The webpage cannot be found HTTP 404

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm new Java developer, I'm trying to learn JEE, but I can't run the application page. It is showing error page. Somebody can help me?

The webpage cannot be found HTTP 404



index.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head></h:head>
<body>
<h:outputLabel value="Teste JSF 2.1 c/ JBoss Tools" /> <br/>
<h:button value="OK" />
</body>
</html>

The webpage cannot be found HTTP 404
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Paulo!

A "404" doesn't mean that there's something wrong with the page. It means that the URL that you submitted cannot be resolved. No suitable resources could be found to construct a webpage.

In order to fix this, you need to check your web.xml. It needs to have a servlet-mapping element that provides your model URL pattern (for example, "*.jsf") and maps that pattern to a resource (the faces-servlet). Then you need to have the View Template (your xhtml file) in the proper location in the WAR.

 
Paulo Pedrosa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim Holloway,

Thanks for help me.

The application already got information. Below follows the information over it.



Reards,
Paulo
 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What URL are you submitting?
 
Paulo Pedrosa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Follows the URL:

http://localhost:8080/testejsf/index.jsf

Best Regards,
Paulo
 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Verify that the webapp is in fact deployed under the context name "testejsf". Most webapp servers have a console app that will verify that, or check the server logs.

For Tomcat, look for a TOMCAT_HOME/webapps/testjsf directory (assuming you use the default deployment mechanism). There should be a TOMCAT_HOME/webapps/testjsf/index.html file readable by the userid that Tomcat is executing under.

Also, remember, that even under Windows, Java is case sensitive. So make sure that all Java filenames and their references match on all upper/lower case letters. Windows won't complain, but Java won't work.
 
Paulo Pedrosa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,

I'm working with JBoss, to run the URL need I install Tomcat? Even considering my deployment just JBoss.

Regards once more,
Paulo de Tarso
 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, my instructions are for anyone running Tomcat. Deploying to JBoss is different. Even though JBoss contains a modified Tomcat within itself, it has its own deployment directory structure and deployment descriptor files, documented at their website.
 
Paulo Pedrosa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay! but, How am I resolve my problem?
 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Ensure that your webapp is packaged in the form of a WAR

2. Ensure that the WAR is deployed to your JBoss server under the context ID "testejsf". Refer to the JBoss/Wildfly documentation for the version of JBoss that you are using.

3. If, having attempted both of the above, you still have problems, ask again in our JBoss forum where you'll find people who are more familiar with JBoss-specific problems.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic