Re: Exception occured “java.lang.IllegalStateException: Context is already active”

Splash Forums PrettyFaces Users Exception occured "java.lang.IllegalStateException: Context is already active" Re: Exception occured “java.lang.IllegalStateException: Context is already active”

#21314

My guess is that it is connected to Mojarra. Which of the two Exceptions (NullPointerException vs. “Context already active”) is the first one in the log file?

BTW: I saw you posted the wrong URL in your first post. You wrote you are trying to access:

http://localhost:8080/WebApplication1/faces/testAdmin?testid=90

with this PrettyFaces mapping:

<url-mapping id="viewCategory">
<pattern value="/electAdmin" />
<query-param name="testid"> #{candidate_handler.testid} </query-param>
<view-id>/faces/manager/electionBuild.xhtml</view-id>
</url-mapping>

The correct URL to test this mapping is:

http://localhost:8080/WebApplication1/electAdmin?testid=90

Please note that you don’t have to add the /faces/ suffix when using PrettyFaces.

You could also test if you are getting the same exception if don’t use the mapping at all and access the JSF view directly (bypassing PrettyFaces):

http://localhost:8080/WebApplication1/faces/manager/electionBuild.xhtml

But if you test this your query parameter won’t work, so you could hard code the ID somewhere in the code just to see if the page rendering works.