KonaKart Community Forum

Installation / Configuration => Using KonaKart as a Portlet => Topic started by: dnavarro on March 25, 2010, 11:16:36 am

Title: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: dnavarro on March 25, 2010, 11:16:36 am
Hello,

  I have working Konakart (4.2.0.0) as a Portlet in Liferay (5.2.3) and works quite well, but always always always in the his/her first visit reads
"javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope".

  If they press refresh everythings works fine.

  Any idea?.


  Thanks.

      David.



 
Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: trevor on March 25, 2010, 11:25:19 am
Can you supply a link to the application ?
Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: dnavarro on March 25, 2010, 11:53:07 am
Hi trevor,

   Not yet, I'm sorry.


   Could be the problem related to cookies?.


   Thanks,

     David.


   
Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: trevor on March 25, 2010, 11:58:08 am
No, I don't think so.
Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: dnavarro on March 25, 2010, 12:23:27 pm

Have you ever seen this error before in Konakart as portlet?.

I have been looking for informatation related to the problem and the most frecuent reply is about "automatic versus manual instalation", but that is not my case. I installed Konakart with next steps:





  David.


Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: trevor on March 25, 2010, 01:07:30 pm
No I haven't.
Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: dnavarro on March 25, 2010, 02:18:33 pm

Did you check Konakart  (KonaKart-4.2.0.1-Linux-Install) as portlet with "liferay-portal-tomcat-6.0-5.2.3". I'm working with MySQL-server-community-5.4.1-0 ?.

Do you know how "konakartKey" is used?, or can you point me to some documentation about it?.


Thanks again.

  David.
Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: trevor on March 25, 2010, 06:24:35 pm
In the JSPs you can see:

<bean:define id="kkEng" name="konakartKey" type="com.konakart.al.KKAppEng"/>

It expects to find a KonaKart client engine in the session using the key "konakartKey". As you can see in the BaseAction class, this will be created whenever a struts action is called. In your case it looks as if it doesn't exist and so the JSP is complaining.
Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: dnavarro on March 28, 2010, 09:13:17 am

Thank you Trevor, the problem is fixed.

I have not working with one Konakart portlet, I have "portletized" each Konakart functionality one by one, and to do it I created new Actions (void actions) for some funtionalities, for example BestSellers or the Tree Categories but I forgot to call "MyNewAction.getKKAppEng(request, response);" to initialize the "konakartKey" property.


Please, be sure I will send a public link to the aplication, and some contributions about "making Konakart portletized" and "working with Liferay and Konakart Contexts".

Thank you for Konakart, good job.

Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: trevor on March 29, 2010, 08:49:28 am
QuotePlease, be sure I will send a public link to the aplication, and some contributions about "making Konakart portletized" and "working with Liferay and Konakart Contexts".


I'm sure that the KonaKart Community would appreciate that  :)
Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: Sony George on June 05, 2010, 01:47:10 pm
This happens because either robots or a direct hit to the following URL

http://www.konakart.com/konakart/ForgotPassword.do

the ForgotPassword.do does not have action class, instead tiles are used......
so the BaseAction's getKKAppEng() method is never called
and "konakartKey" is never stored in the session

a simple work around is just create a simple action class
and edit the struts-config.xml file

ForgotPasswordAction.java is attached

and instead of config in struts-config.xml

<action path="/ForgotPassword" forward="/CatalogForgotPasswordPage.do">
<forward name="Login" path="/LogIn.do"/>
</action>



use this


                <action path="/ForgotPassword" type="com.konakart.actions.ForgotPasswordAction">
<forward name="Login" path="/CatalogForgotPasswordPage.do"/>
</action>




Title: Re: javax.servlet.jsp.JspException: Cannot find bean konakartKey in any scope
Post by: dnavarro on June 14, 2010, 04:02:16 pm

Thanks Sony!.