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 ?.....
primefaces 3.4.1 partial response error
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
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.User123dddd wrote:Xhtml looks like following .Use this xhtml to notify the user when reach any condition given.But I got the following exception..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>
Can you please exactly tell me what cud be the reason for this error ?.....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>
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
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
-
- Posts: 4
- Joined: 09 Apr 2013, 15:11
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>
}
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>
}
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
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
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
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
-
- Posts: 4
- Joined: 09 Apr 2013, 15:11
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>
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>
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
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
Next time please read forum rules to avoid moderation;
viewtopic.php?f=3&t=1194
-
- Information
-
Who is online
Users browsing this forum: No registered users and 31 guests