This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!

Adinath Shirsath

Ranch Hand
+ Follow
since Dec 04, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adinath Shirsath

Try using scrollable resultset
Hi Martijn,
I am interested to work in "Ikasan - Enterprise Integration Platform". Can you send me some more information about it?

Thanks
10 years ago
eat more and more bananas
10 years ago
Hi
be ready for getting scolded
are you proxy server?
if yes try to set proxy in your code ....
10 years ago

Originally posted by prathamesh bandivadekar:
Hi all,

I have one serious question.

I have one proprietary framework which was written back in 2000.

Can it be compatible with the Ajax.

Bottom line is "What all we need to incorporate Ajax in any framework?"

Thanks in advance,
Romak !





What actually that framework does?
10 years ago

Originally posted by Shailesh S.:
I am facing one problem. I want only one instance of the class to be running on my OS. I have written one loader program and want to execute only one instance of loader at a time. If I execute the loader from one console and while the first loader is running I want to prevent execution of second loader from the another console.Is there any way to restrict the execution of same class from two different consoles.

[ September 05, 2008: Message edited by: Shailesh S. ]




May be Singleton pattern will help you
[ September 05, 2008: Message edited by: Adinath Shirsath ]
10 years ago
Thanks Tim and Bauke.
10 years ago
JSF
Classcast expection thrown when jvm cant cast one type to another
10 years ago
Hi,
I want to create jsf page that displays data from database in datatable with paging mechanism. I want to do it with use of Scrollable resultSet. So i have created jsf page in netbeans

check.jsp

<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : check
Created on : Aug 28, 2008, 11:44:06 AM
Author : ashirsa
-->
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<webuijsf:page id="page1">
<webuijsf:html id="html1">
<webuijsf:head id="head1">
<webuijsf:link id="link1" url="/resources/stylesheet.css"/>
</webuijsf:head>
<webuijsf:body id="body1" style="-rave-layout: grid">
<webuijsf:form id="form1">
<h:dataTable first="#{Employee.count}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd"
style="height: 216px; left: 120px; top: 96px; position: absolute" value="#{Employee.result}" rows="5" var="currentRow" width="264">
<h:column id="column1">
<h:outputText id="outputText1" value="#{currentRow.emp_id}"/>
<f:facet name="header">
<h:outputText id="outputText2" value="Employee Id"/>
</f:facet>
</h:column>
<h:column id="column2">
<h:outputText id="outputText3" value="#{currentRow.ename}"/>
<f:facet name="header">
<h:outputText id="outputText4" value="Employee Name"/>
</f:facet>
</h:column>
<h:column id="column3">
<h:outputText id="outputText5" value="#{currentRow.addr}"/>
<f:facet name="header">
<h:outputText id="outputText6" value="Address"/>
</f:facet>
</h:column>
</h:dataTable>

<h:commandLink id="nextLink" value="Next" actionListener="#{Employee.next}"/>
<h:commandLink id="previousLink" value="Previous" actionListener="#{Employee.previous}"/>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>
</webuijsf:page>
</f:view>
</jsp:root>



I also created banking bean as Employee.java

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.check.beans;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.faces.event.ActionEvent;

/**
*
* @author ashirsa
*/
public class Employee {

private ResultSet result;
private int count;

public int getCount() {
return count;
}

public void setCount(int count) {
this.count = count;
}

public void setResult(ResultSet result) {
this.result = result;
}

public ResultSet getResult() {
if (result == null) {
Connection cn = null;
Statement stmt = null;
String sql = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cn = DriverManager.getConnection("jdbc:odbc:test");
stmt = cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
sql = "select * from employee";
result = stmt.executeQuery(sql);

} catch (Exception ex) {
ex.printStackTrace();
}

}
return result;
}

public void next(ActionEvent ae){
count = count + 5;
}
public void previous(ActionEvent ae){
count = count - 5;
}

/** Creates a new instance of Employee */
public Employee() {
count = 0;
}
}


Now when i run my application. It is working fine when i click on Next link, that is it displays next records from the database. but whenever i click on previous link it gives me exception like

Sep 2, 2008 3:51:04 PM org.apache.catalina.core.ApplicationContext log
SEVERE: null
java.lang.IllegalArgumentException
at javax.faces.model.ResultSetDataModel.setRowIndex(ResultSetDataModel.java:244)
at javax.faces.component.UIData.setRowIndex(UIData.java:418)
at com.sun.faces.renderkit.html_basic.TableRenderer.encodeChildren(TableRenderer.java:270)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:245)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:320)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Sep 2, 2008 3:51:04 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.IllegalArgumentException
at javax.faces.model.ResultSetDataModel.setRowIndex(ResultSetDataModel.java:244)
at javax.faces.component.UIData.setRowIndex(UIData.java:418)
at com.sun.faces.renderkit.html_basic.TableRenderer.encodeChildren(TableRenderer.java:270)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:245)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:320)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)




help me on this.........
10 years ago
JSF