Gangi koirala

Greenhorn
+ Follow
since Jul 22, 2001
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 Gangi koirala

When I compile the following java bean,no copile error ocuurs
but the compiled class has nothing and when the JSP page loading it gives java.lang.InstantiationException: `Final.Nearest_consumer' has no
public zero-arg constructor
(The error is obvious since nothing in the class)
please find me the error
Thank you
Gangi
package Final;
import java.sql.*;
import java.io.*;
import java.util.*;
import Main.*;
public class Nearest_consumer{
public Connection conn;
public DBConnectionManager connMgr;
public String NEAREST_WALKPATH_NO="";
public int WALKPATH_NO;
public String ConNo="";
public String ValidateResult ;
//*************************Constructor******************************************
public Nearest_consumer(){
try{
connMgr = DBConnectionManager.getInstance();
conn = connMgr.getConnection("oracleNew");
conn.setAutoCommit(true);
InitVar();
}//End Try
catch (Exception e){
ValidateResult +="ClassNotFoundException: "+e.getMessage();
e.printStackTrace();
}//End Catch
}//End Constructor
public Nearest_consumer(String ConNo){
try{
//Using connectionpool
connMgr = DBConnectionManager.getInstance();
conn = connMgr.getConnection("oracleNew");
conn.setAutoCommit(true);
InitVar();
getNEAREST_WALKPATH_NO(ConNo);
}//End Try
catch (Exception e){
ValidateResult +="ClassNotFoundException: "+e.getMessage();
e.printStackTrace();
//System.out.println(ValidateResult);
}//End Catch
}//End Constructor

//**************** Initialise****************
public void InitVar(){
ACCOUNT_BALENCE="";
ADDRESS1="";
//*******************Get Nearest Consumer No*****************************
public String getNEAREST_WALKPATH_NO(String ConNo){
//Statement stmt ;
NEAREST_WALKPATH_NO=""; WALKPATH_NO=0; long TEMP_WALKPATH_NO=0;
try{
PreparedStatement stmt;
String ssql= "Select WALKPATH_NO from B_CONSUMER_HD_TAB where CONSUMER_NO= '" + ConNo + "'";

stmt= conn.prepareStatement(ssql);
ResultSet rs = stmt.executeQuery();
while(rs.next ()){
NEAREST_WALKPATH_NO=rs.getString("WALKPATH_NO");
}//End while}
System.out.println("NEAREST_WALKPATH_NO"+NEAREST_WALKPATH_NO);
rs.close();
stmt.close();
if (NEAREST_WALKPATH_NO !="" | | NEAREST_WALKPATH_NO.length() !=0 ){
PreparedStatement stmt1 = conn.prepareStatement("Select WALKPATH_NO from B_CONSUMER_HD_TAB where WALKPATH_NO BETWEEN " + NEAREST_WALKPATH_NO + " AND " + (Long.parseLong(NEAREST_WALKPATH_NO)*1 +100) + " ORDER BY WALKPATH_NO");
ResultSet rs1 = stmt1.executeQuery();
WALKPATH_NO=Integer.parseInt(NEAREST_WALKPATH_NO);
TEMP_WALKPATH_NO=0;
while(rs1.next ())
{
TEMP_WALKPATH_NO=rs1.getLong("WALKPATH_NO");
if(WALKPATH_NO<=TEMP_WALKPATH_NO){WALKPATH_NO=WALKPATH_NO+1;}
else {break;}
}//End while}
rs1.close();
stmt1.close();
} else
{ WALKPATH_NO=0; TEMP_WALKPATH_NO=0; NEAREST_WALKPATH_NO="";
}
conn.commit();

}catch (Exception e){
ValidateResult +="SQLException in getNEAREST_WALKPATH_NO Method: "+e.getMessage();
e.printStackTrace();
}//End Catch
connMgr.freeConnection("oracleNew", conn);
return NEAREST_WALKPATH_NO;

}//End getNEAREST_WALKPATH_NO
public void InitVar(){
NEAREST_WALKPATH_NO="";
WALKPATH_NO=0;
}
}
17 years ago
When I compile the following java bean,no copile error ocuurs
but the compiled class has nothing and when the JSP page loading it gives java.lang.InstantiationException: `Final.Nearest_consumer' has no
public zero-arg constructor
(The error is obvious since nothing in the class)
please find me the error
Thank you
Gangi
package Final;
import java.sql.*;
import java.io.*;
import java.util.*;
import Main.*;
public class Nearest_consumer{
public Connection conn;
public DBConnectionManager connMgr;
public String NEAREST_WALKPATH_NO="";
public int WALKPATH_NO;
public String ConNo="";
public String ValidateResult ;
//*************************Constructor******************************************
public Nearest_consumer(){
try{
connMgr = DBConnectionManager.getInstance();
conn = connMgr.getConnection("oracleNew");
conn.setAutoCommit(true);
InitVar();
}//End Try
catch (Exception e){
ValidateResult +="ClassNotFoundException: "+e.getMessage();
e.printStackTrace();
}//End Catch
}//End Constructor
public Nearest_consumer(String ConNo){
try{
//Using connectionpool
connMgr = DBConnectionManager.getInstance();
conn = connMgr.getConnection("oracleNew");
conn.setAutoCommit(true);
InitVar();
getNEAREST_WALKPATH_NO(ConNo);
}//End Try
catch (Exception e){
ValidateResult +="ClassNotFoundException: "+e.getMessage();
e.printStackTrace();
//System.out.println(ValidateResult);
}//End Catch
}//End Constructor

//**************** Initialise****************
public void InitVar(){
ACCOUNT_BALENCE="";
ADDRESS1="";


//*******************Get Nearest Consumer No*****************************
public String getNEAREST_WALKPATH_NO(String ConNo){
//Statement stmt ;
NEAREST_WALKPATH_NO=""; WALKPATH_NO=0; long TEMP_WALKPATH_NO=0;
try{
PreparedStatement stmt;
String ssql= "Select WALKPATH_NO from B_CONSUMER_HD_TAB where CONSUMER_NO= '" + ConNo + "'";

stmt= conn.prepareStatement(ssql);
ResultSet rs = stmt.executeQuery();
while(rs.next ()){
NEAREST_WALKPATH_NO=rs.getString("WALKPATH_NO");
}//End while}
System.out.println("NEAREST_WALKPATH_NO"+NEAREST_WALKPATH_NO);
rs.close();
stmt.close();
if (NEAREST_WALKPATH_NO !="" | | NEAREST_WALKPATH_NO.length() !=0 ){
PreparedStatement stmt1 = conn.prepareStatement("Select WALKPATH_NO from B_CONSUMER_HD_TAB where WALKPATH_NO BETWEEN " + NEAREST_WALKPATH_NO + " AND " + (Long.parseLong(NEAREST_WALKPATH_NO)*1 +100) + " ORDER BY WALKPATH_NO");
ResultSet rs1 = stmt1.executeQuery();
WALKPATH_NO=Integer.parseInt(NEAREST_WALKPATH_NO);
TEMP_WALKPATH_NO=0;
while(rs1.next ())
{
TEMP_WALKPATH_NO=rs1.getLong("WALKPATH_NO");
if(WALKPATH_NO<=TEMP_WALKPATH_NO){WALKPATH_NO=WALKPATH_NO+1;}
else {break;}
}//End while}
rs1.close();
stmt1.close();

} else
{ WALKPATH_NO=0; TEMP_WALKPATH_NO=0; NEAREST_WALKPATH_NO="";
}
conn.commit();

}catch (Exception e){
ValidateResult +="SQLException in getNEAREST_WALKPATH_NO Method: "+e.getMessage();
e.printStackTrace();
}//End Catch
connMgr.freeConnection("oracleNew", conn);
return NEAREST_WALKPATH_NO;

}//End getNEAREST_WALKPATH_NO

public void InitVar(){
NEAREST_WALKPATH_NO="";
WALKPATH_NO=0;
}
}
[This message has been edited by Gangi koirala (edited August 17, 2001).]
[This message has been edited by Gangi koirala (edited August 17, 2001).]
17 years ago
My program has 1 Html page, 2 jsps and a bean.
This perfectly works in resin 1.2 which I'm using as the development server.But when Loading it into the webspere 3.5
1 jsp does not load and it gives the following error
Error 500
An error has occured while processing request: http://n1laxapana/webapp/examples/B_CONSUMER_HD_TAB_JS.jsp
Message: Server caught unhandled exception from servlet [jsp10]
StackTrace: com.sun.jsp.JspWithNoErrorPageException: Server caught unhandled exception from JSP [B_CONSUMER_HD_TAB_JS.jsp] at u_00030_00032.WebSphere.AppServer.hosts.d_00025fault_0005fhost.examples.web.B_CONSUMER_HD_TAB_JS_jsp_1._jspService(B_CONSUMER_HD_TAB_JS_jsp_1.java:1634) at com.sun.jsp.runtime.HttpJspBase.service(HttpJspBase.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:627) at com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:131) at com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:481) at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:564) at javax.servlet.http.HttpServlet.service(HttpServlet.java:627) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:575) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:149) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:104) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:327) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:728) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:654) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:1137) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1048) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:1008) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:614) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:60) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:44) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:286) at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerImp.java:198) at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.java:67) at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.java:191) at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyService(SQWrapperEventSource.java:329) at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQWrapperEventSource.java:216) at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(OutOfProcThread.java:234) at java.lang.Thread.run(Thread.java:481)
Stack Dump
u_00030_00032.WebSphere.AppServer.hosts.d_00025fault_0005fhost.examples.web.B_CONSUMER_HD_TAB_JS_jsp_1._jspService() B_CONSUMER_HD_TAB_JS_jsp_1.java:1634
com.sun.jsp.runtime.HttpJspBase.service() HttpJspBase.java:133
javax.servlet.http.HttpServlet.service() HttpServlet.java:627
com.sun.jsp.runtime.JspServlet$JspServletWrapper.service() JspServlet.java:131
com.sun.jsp.runtime.JspServlet.serviceJspFile() JspServlet.java:481
com.sun.jsp.runtime.JspServlet.service() JspServlet.java:564
javax.servlet.http.HttpServlet.service() HttpServlet.java:627
com.ibm.servlet.engine.webapp.StrictServletInstance.doService() ServletManager.java:575
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service() StrictLifecycleServlet.java:149
com.ibm.servlet.engine.webapp.IdleServletState.service() StrictLifecycleServlet.java:286
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service() StrictLifecycleServlet.java:104
com.ibm.servlet.engine.webapp.ServletInstance.service() ServletManager.java:327
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch() ServletManager.java:728
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch() ServletManager.java:654
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch() WebApp.java:1137
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch() WebApp.java:1048
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward() WebApp.java:1008
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook() WebGroup.java:614
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation() CachedInvocation.java:60
com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke() CacheableInvocationContext.java:106
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI() ServletRequestProcessor.java:44
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service() OSEListener.java:286
com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run() SQEventListenerImp.java:198
com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent() SQEventListenerImp.java:67
com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent() SQEventSource.java:191
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyService() SQWrapperEventSource.java:329
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run() SQWrapperEventSource.java:216
com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run() OutOfProcThread.java:234
java.lang.Thread.run()

pls help me on this
thanks

17 years ago
My program has 1 Html page, 2 jsps and a bean.
This perfectly works in resin 1.2 which I'm using as the development server.But when Loading it into the webspere 3.5
1 jsp does not load and it gives the following error
Error 500
An error has occured while processing request: http://n1laxapana/webapp/examples/B_CONSUMER_HD_TAB_JS.jsp
Message: Server caught unhandled exception from servlet [jsp10]
StackTrace: com.sun.jsp.JspWithNoErrorPageException: Server caught unhandled exception from JSP [B_CONSUMER_HD_TAB_JS.jsp] at u_00030_00032.WebSphere.AppServer.hosts.d_00025fault_0005fhost.examples.web.B_CONSUMER_HD_TAB_JS_jsp_1._jspService(B_CONSUMER_HD_TAB_JS_jsp_1.java:1634) at com.sun.jsp.runtime.HttpJspBase.service(HttpJspBase.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:627) at com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:131) at com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:481) at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:564) at javax.servlet.http.HttpServlet.service(HttpServlet.java:627) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:575) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:149) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:104) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:327) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:728) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:654) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:1137) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1048) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:1008) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:614) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:60) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:44) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:286) at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerImp.java:198) at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.java:67) at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.java:191) at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyService(SQWrapperEventSource.java:329) at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQWrapperEventSource.java:216) at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(OutOfProcThread.java:234) at java.lang.Thread.run(Thread.java:481)
Stack Dump
u_00030_00032.WebSphere.AppServer.hosts.d_00025fault_0005fhost.examples.web.B_CONSUMER_HD_TAB_JS_jsp_1._jspService() B_CONSUMER_HD_TAB_JS_jsp_1.java:1634
com.sun.jsp.runtime.HttpJspBase.service() HttpJspBase.java:133
javax.servlet.http.HttpServlet.service() HttpServlet.java:627
com.sun.jsp.runtime.JspServlet$JspServletWrapper.service() JspServlet.java:131
com.sun.jsp.runtime.JspServlet.serviceJspFile() JspServlet.java:481
com.sun.jsp.runtime.JspServlet.service() JspServlet.java:564
javax.servlet.http.HttpServlet.service() HttpServlet.java:627
com.ibm.servlet.engine.webapp.StrictServletInstance.doService() ServletManager.java:575
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service() StrictLifecycleServlet.java:149
com.ibm.servlet.engine.webapp.IdleServletState.service() StrictLifecycleServlet.java:286
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service() StrictLifecycleServlet.java:104
com.ibm.servlet.engine.webapp.ServletInstance.service() ServletManager.java:327
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch() ServletManager.java:728
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch() ServletManager.java:654
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch() WebApp.java:1137
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch() WebApp.java:1048
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward() WebApp.java:1008
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook() WebGroup.java:614
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation() CachedInvocation.java:60
com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke() CacheableInvocationContext.java:106
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI() ServletRequestProcessor.java:44
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service() OSEListener.java:286
com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run() SQEventListenerImp.java:198
com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent() SQEventListenerImp.java:67
com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent() SQEventSource.java:191
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyService() SQWrapperEventSource.java:329
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run() SQWrapperEventSource.java:216
com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run() OutOfProcThread.java:234
java.lang.Thread.run()

pls help me on this
thanks


[This message has been edited by Gangi koirala (edited August 09, 2001).]
17 years ago

I understand the errror ,what we wanted to know is when Ssub is a sub class of Ssuper what is the case,
So the program changes as below
public class Ssupper{
private void setAge(int sAge){
if(sAge >= 100){
System.out.println("You have a long life"+sAge );
}
}
}
class Ssub extends Ssupper{
public static void main(String argv[]){
Ssupper b = new Ssupper();
b.setAge(101);

}//End of main
}

17 years ago
How to use more than one bean to increase the performance
17 years ago