EJPPG0003E: ServletContext lookup for /.CreditCounterPartyReviewLog returned the portal context. It has to be a different one.
I’m working on a Portlet project right now. It helps a group over at TransAlta keep their financial obligations and exposures in check. I like the application…it has great business value, terrific customer participation…a great project.
A second developer was introduced to the project recently. He brought the portlets down from CVS and tried running them on his workstation. The received the following error:
2006.08.23 13:37:49.064 E com.ibm.wps.pe.om.definition.impl.WebApplicationDefinitionImpl getServletContext
EJPPG0003E: ServletContext lookup for /.CreditCounterPartyReviewLog returned the portal context. It has to be a different one.
hmmm, what does that mean? He created an EAR file to associate the project with…ahh, but wait! When Rational Application Developer associates Web Modules with an EAR, it doesn’t give it a context root. It tries using the context root for the Portal itself (uh oh) and then throws the exception found above. Fixing it, as my good friend from IBM Thomas Young discovered, is quite simple. Open the EAR, find the module reference and click ‘Refesh’ located beside the Context Root field.
ReDeploy and run…

October 9, 2006 at 7:23 am
I created a simple portal application, i built the application using ANT scripts, and i deployed into the WebSphere Portal server. While running application i got the same error what u mentioned above :
” com.ibm.wps.pe.om.definition.impl.WebApplicationDefinitionImpl getServletContext
EJPPG0003E: ServletContext lookup for /wps/PA_1_0_1I1 returned the portal context. It has to be a different one. ”
But, u mentioned some solution, but i couldnt follow u, Pls tell me the proper solution.
Thanks in advance,
Prabhakar Mariyappan.
November 1, 2006 at 1:22 pm
Oh my God! Thanks for this tip! I was about to go insane trying to figure out what the hell was wrong with my Portal UTE.
Cheers!
November 17, 2006 at 8:42 am
Same here - just “portlet not available” and this logmessage. This tip saves my day, thanks!
@prabhakar: see the screenshot; to get here open the EAR project for your portlet, doubleclick application.xml (in META-INF) then under “modules” click on the .war file where your portlet lives. Look to the right to see the Context root and “Refresh” button.
November 17, 2006 at 8:56 am
@prabhakar 2: I see now that you deployed into a server. Check the application.xml in the META-INF directory and make sure the element has the correct value.
December 11, 2006 at 3:47 pm
Right problem, right symptoms, but this tip did not work for me. Still get the same error. Any other ideas?
March 14, 2007 at 4:55 am
@Jim: A little late, but maybe it helps someone else: Try to change the classloader settings of your server for that specific application. Switching between “parent first” and “parent last” helps some times.
March 21, 2007 at 9:43 am
Oh holy hay-zeus. Thank you. I know that WPS sometimes gets its knickers in a twist about new EARs, but I usually solved it (blindly) by recreating the EAR and rebuilding. This always worked for me until today - reading the “real” reason has saved me hours and a large loss of hair. J
May 14, 2007 at 5:28 am
i tried ur trick but it hasnt worked in my case. also one more thing i dont get the project text box below the context root.
May 22, 2007 at 11:30 am
Yes this Refresh module Context root in RAD solved this Servlet Context problem. Thanks.
September 19, 2007 at 3:51 am
I tried the ‘tricks’ the way they’re described above, but nothing happened. So I refreshed the EAR- and the Servers-Project in the RAD Project Explorer (rightclick on project - refresh).
ReDeploy and run…
November 23, 2007 at 7:52 pm
Thanks a lot!!!!! it worked for me also!!!!
May 6, 2008 at 8:09 pm
[...] by about a hundred different things. If the issue is actually a context issue, you can follow Jamie Mcllroy’s great instructions to try to resolve context root-type [...]