Page 1 of 1

primefaces 3.4.1 partial response error

Posted: 09 Apr 2013, 15:34
by User123dddd
Xhtml looks like following .Use this xhtml to notify the user when reach any condition given.
<h:body>
<link rel="stylesheet" href="../css/alertnm.css" type="text/css"/>
<script type="text/javascript" src="../js/alertnm.js"/>

<f:view>
<h:form>
<h:outputText value="#{notificationBean.strMessg}" id="outText" escape="false" styleClass="msgCls"/>
<p:poll interval="20" listener="#{notificationBean.browserNotified}" update="outText" id="notificationPoll" partialSubmit="true">
</p:poll>
<audio id="audio1" src="../img/new_notification.wav" preload="auto"></audio>
</h:form>
</f:view>
</h:body>
But I got the following exception..
<?xml version='1.0' encoding='UTF-8'?> <partial-response><error><error-name>class java.lang.IndexOutOfBoundsException</error-name><error-message><![CDATA[Index: 0, Size: 0]]></error-message></error></partial-response>
Can you please exactly tell me what cud be the reason for this error ?.....

Re: primefaces 3.4.1 partial response error

Posted: 09 Apr 2013, 19:07
by smithh032772
User123dddd wrote:Xhtml looks like following .Use this xhtml to notify the user when reach any condition given.

Code: Select all

	 <h:body>   
        <link rel="stylesheet" href="../css/alertnm.css" type="text/css"/>
        <script type="text/javascript" src="../js/alertnm.js"/>
        
        <f:view>
            <h:form>
                <h:outputText value="#{notificationBean.strMessg}" id="outText" escape="false" styleClass="msgCls"/>
                <p:poll interval="20"  listener="#{notificationBean.browserNotified}" update="outText"  id="notificationPoll" partialSubmit="true">
                </p:poll>
                <audio id="audio1" src="../img/new_notification.wav"  preload="auto"></audio>
            </h:form>
        </f:view>
    </h:body>
But I got the following exception..

Code: Select all

<?xml version='1.0' encoding='UTF-8'?> <partial-response><error><error-name>class java.lang.IndexOutOfBoundsException</error-name><error-message><![CDATA[Index: 0, Size: 0]]></error-message></error></partial-response>
Can you please exactly tell me what cud be the reason for this error ?.....
wow, i'm sure people may be willing to respond to this, since i added the 'code' tags by clicking 'Code' button above the editor when responding to this topic/question.

BUT, you should share your entire xhtml AND bean. Also, you can search google for 'java.lang.IndexOutOfBoundsException'. Evidently, you have some array/list in your code, right?

oh, there are forum-posting rules, too. i hope you read them, or others may send you a (friendly) reminder to do so. :)

Re: primefaces 3.4.1 partial response error

Posted: 10 Apr 2013, 07:47
by User123dddd
Below is the code of bean class used and xhtml.
I have to integrate with different modules.This is working properly with some other module..
but with 2 modules it shows me error even after removing the list used.If u can see I have accessed a simple test method after your reply.but still getting the same error as before.That means In this class nothing is wrong.If it causes due to the array or list then nothing is there in the class now.And while calling this xhtml it should not load any other module .Is it so I mean is it possible one module reloads the other.I guess no.
Please help if any thing I missed or I don't know...
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package co.za.inet.alert.notification;

import java.io.Serializable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Resource;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
import org.primefaces.context.RequestContext;

/**
*
* @author Rekha
*/
@ManagedBean
@RequestScoped
public class NotificationBean implements Serializable {

private static Logger logger;
private String userId = "0";
private String strMessg = "";
private int soundCount = 0;


public String getStrMessg() {
return strMessg;
}

public void setStrMessg(String strMessg) {
this.strMessg = strMessg;
}


public String getUserId() {
return userId;
}

public void setUserId(String userId) {
this.userId = userId;
}

/**
* Creates a new instance of NotificationBean
*/
public NotificationBean() {
HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
userId = session.getAttribute("UserID") != null ? (String) session.getAttribute("UserID") : "47";
getLogger().log(Level.INFO, ":userId {0} created in NotificationBean::",userId);
}


public void test(){
getLogger().log(Level.INFO, "------Test method called");
this.strMessg="testtttttttttttt";
}
private Logger getLogger() {
if (logger == null) {
logger = Logger.getLogger(this.getClass().getName());
}
return logger;
}
---
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<link rel="stylesheet" href="css/alertnm.css" type="text/css"/>
<script type="text/javascript" src="js/alertnm.js"/>
</h:head>
<h:body>


<f:view>
<h:form>
<h:outputText value="#{notificationBean.strMessg}" id="outText" escape="false" styleClass="msgCls"/>
<p:poll interval="20" listener="#{notificationBean.test}" update="outText" id="notificationPoll" partialSubmit="true">
</p:poll>
<audio id="audio1" src="./img/new_notification.wav" preload="auto"></audio>
</h:form>
</f:view>
</h:body>
</html>

}

Re: primefaces 3.4.1 partial response error

Posted: 10 Apr 2013, 09:07
by tandraschko
use a own ExceptionHandler or pe:ajaxExceptionHandler and anaylze your stacktrace.

Re: primefaces 3.4.1 partial response error

Posted: 10 Apr 2013, 09:11
by cagatay.civici
And please format your code;

viewtopic.php?f=3&t=1194

Re: primefaces 3.4.1 partial response error

Posted: 11 Apr 2013, 12:24
by User123dddd
Am using primefaces 3.4.1, jsf-api-2.1.1-b04 and jsf-impl-2.1.1-b04 jar files...
and the Server is Galssfish 3.1
It conflicting with another module I guess.B'cz when I removed that one my current code works ...
Am not able to run primefaces extension.Added the primefaces-extensions-0.6.3.jar file to the project path still no luck to run and get the stacktrace.
Even without calling the bean in xhtml also gives the same error :(
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>

</h:head>
<h:body>
<link rel="stylesheet" href="../css/alertnm.css" type="text/css"/>
<script type="text/javascript" src="../js/alertnm.js"/>

<f:view>
<h:form>
<h:outputText value="Test" id="outText"/>
<p:poll interval="20" update="outText" async="true">
</p:poll>
</h:form>
</f:view>

</h:body>
</html>

Re: primefaces 3.4.1 partial response error

Posted: 11 Apr 2013, 12:36
by cagatay.civici
Locking topic as code format rule was brought up twice and your posts along with the new one still ignores it.

Next time please read forum rules to avoid moderation;

viewtopic.php?f=3&t=1194