Foren

Error while checking Captcha

thumbnail
Abhimanyu Saraswat, geändert vor 10 Jahren.

Error while checking Captcha

Junior Member Beiträge: 62 Beitrittsdatum: 26.02.13 Neueste Beiträge
HI,

I am trying to implement Captcha in my custom portlet. I am able to get the image but when I submit I get an error which says :


08:51:51,790 ERROR [http-bio-8080-exec-229][IncludeTag:253] Current URL /web/propcowebdemo/generic-portlet?captchaText=7095 generates exception: null
08:51:51,793 ERROR [http-bio-8080-exec-229][IncludeTag:154] java.lang.NullPointerException
at com.liferay.taglib.aui.InputTag.updateFormValidators(InputTag.java:270)
at com.liferay.taglib.aui.InputTag.doEndTag(InputTag.java:45)
at org.apache.jsp.html.taglib.ui.captcha.simplecaptcha_jsp._jspx_meth_aui_005finput_005f0(simplecaptcha_jsp.java:535)
at org.apache.jsp.html.taglib.ui.captcha.simplecaptcha_jsp._jspService(simplecaptcha_jsp.java:467)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)
at org.apache.jsp.html.taglib.ui.captcha.page_jsp._jspService(page_jsp.java:428)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245)



Can anyone help? Thanks in advance.

Thanks & Regards
Abhimanyu Saraswat
Gouse Basha, geändert vor 10 Jahren.

RE: Error while checking Captcha

New Member Beiträge: 10 Beitrittsdatum: 01.12.12 Neueste Beiträge
You tried this captcha code

<portlet:resourceURL var="captchaURL" />
<liferay-ui:captcha url="<%= captchaURL %>"/>
Parikshit Sharma, geändert vor 10 Jahren.

RE: Error while checking Captcha

New Member Beiträge: 21 Beitrittsdatum: 16.01.13 Neueste Beiträge
Rahul Saraswat:
HI,

I am trying to implement Captcha in my custom portlet. I am able to get the image but when I submit I get an error which says :


08:51:51,790 ERROR [http-bio-8080-exec-229][IncludeTag:253] Current URL /web/propcowebdemo/generic-portlet?captchaText=7095 generates exception: null
08:51:51,793 ERROR [http-bio-8080-exec-229][IncludeTag:154] java.lang.NullPointerException
at com.liferay.taglib.aui.InputTag.updateFormValidators(InputTag.java:270)
at com.liferay.taglib.aui.InputTag.doEndTag(InputTag.java:45)
at org.apache.jsp.html.taglib.ui.captcha.simplecaptcha_jsp._jspx_meth_aui_005finput_005f0(simplecaptcha_jsp.java:535)
at org.apache.jsp.html.taglib.ui.captcha.simplecaptcha_jsp._jspService(simplecaptcha_jsp.java:467)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)
at org.apache.jsp.html.taglib.ui.captcha.page_jsp._jspService(page_jsp.java:428)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245)



Can anyone help? Thanks in advance.

Thanks & Regards
Abhimanyu Saraswat


Seems that you are using the code in jsp without form, only the 2 lines given in above comment,use captcha in the form eg:-


<portlet:actionurl var="createAccoutURL">
	<portlet:param name="saveLastPath" value="0" />
	<portlet:param name="struts_action" value="/login/create_account" />
</portlet:actionurl>

<aui:form action="<%= createAccoutURL %>" method="post" name="fm">

 <portlet:resourceurl var="captchaURL" />

<liferay-ui:captcha url="<%= captchaURL %>" />

</aui:form>

It's just an example from create_account.jsp it will resolve you error.
thumbnail
Rahul Saraswat, geändert vor 10 Jahren.

RE: Error while checking Captcha

Junior Member Beiträge: 62 Beitrittsdatum: 26.02.13 Neueste Beiträge
Hi everyone,

Captcha is working fine now. I used below code :

<div class="personaldetail-single-sec">
<%
if (enableCaptcha) {
%>
<liferay-ui:captcha url="<%= captchaURL %>"/>
<%
}
%>
</div>


I used below url for captcha :

<liferay-portlet:resourceURL var="captchaURL" id="showCaptcha">
<liferay-portlet:param name="time" value="<%=String.valueOf(System.nanoTime())%>"/>
</liferay-portlet:resourceURL>

I used time parameter to differentiate every request for captcha.

Thanks & Regards
Rahul Saraswat