0

I am getting this error HTTP 500 java.lang.RunTimeException Can't find FacesContext.

I read about this problem and most people adviced: to change from

http://localhost:8080/GeneratingEmployeeReport/index.jsp

to

http://localhost:8080/GeneratingEmployeeReport/faces/index.jsp

I tried it but get the same error. Also, I have added all the recommended .jar files.

Error message:

enter image description here

When I chang the url at the end I get this error

enter image description here

Project setup:

enter image description here

web.xml file

enter image description here

faces-config.xml file

enter image description here

index.jsp file

enter image description here

employee.jsp file

enter image description here

user1282256
  • 183
  • 1
  • 6
  • 16
  • Did you look at this? http://stackoverflow.com/questions/4491703/javax-faces-facesexception-java-lang-runtimeexception-cannot-find-facescontext?rq=1 – A M Apr 09 '14 at 06:51
  • 1
    try this: http://localhost:8080/GeneratingEmployeeReport/index.faces – A M Apr 09 '14 at 06:52
  • AAyush. I looked on the link you posted but if you notice my url pattern is /faces/* not .faces. I tried: http://localhost:8080/GeneratingEmployeeReport/index.faces but I get the same error. – user1282256 Apr 09 '14 at 06:58
  • AAyush. When I use localhost:8080/GeneratingEmployeeReport/index.face I get HTTP 404 error. Posted picture above. – user1282256 Apr 09 '14 at 07:08
  • 1
    Look at BaluC's answer. It is something with your web.xml file (Sorry I am no expert but experienced with some JSP stuff). If I were you I would put index.jsf http://stackoverflow.com/questions/16354200/java-lang-runtimeexception-cannot-find-facescontext?rq=1 – A M Apr 09 '14 at 07:14
  • I read that post and BaluC's explained well but you see my url pattern is not *.jsf only /faces/* If I use his answer I would have to create index.jsf file that is empty. It seems for me kind of tricky way to solve the problem. – user1282256 Apr 09 '14 at 07:45

1 Answers1

0

The thing is if I remove everything that is in the index.jsp file between , including these tags, I am able to see the page. Otherwise I get the same error. One of the solutions was to use this url: localhost:8080/GeneratingEmployeeReport/faces/index.jsp I am not able to run the page directly. I am not sure why? I wish there is other solution

user1282256
  • 183
  • 1
  • 6
  • 16