primefaces 3.4.1 partial response error

UI Components for JSF
Locked
User123dddd
Posts: 4
Joined: 09 Apr 2013, 15:11

09 Apr 2013, 15:34

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 ?.....

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

09 Apr 2013, 19:07

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. :)
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

User123dddd
Posts: 4
Joined: 09 Apr 2013, 15:11

10 Apr 2013, 07:47

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>

}

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

10 Apr 2013, 09:07

use a own ExceptionHandler or pe:ajaxExceptionHandler and anaylze your stacktrace.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

10 Apr 2013, 09:11

And please format your code;

viewtopic.php?f=3&t=1194

User123dddd
Posts: 4
Joined: 09 Apr 2013, 15:11

11 Apr 2013, 12:24

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>

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

11 Apr 2013, 12:36

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

Locked

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests