sitaram


{ City }
< Country > india
* Profession *
User No # 72474
Total Questions Posted # 0
Total Answers Posted # 58

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 281
Users Marked my Answers as Wrong # 95
Answers / { sitaram }

Question { Subex, 13365 }

cant we call run() method directly instead of calling indirectly through the start()
method ? if we do so then what is the problem ?


Answer

Calling run() without calling start() will effectively
execute run() is a normal method.

Calling start() will kick off a separate thread,from your
current thread, which will then call run().

Is This Answer Correct ?    5 Yes 0 No

Question { 2616 }

Hi frnds Ima facing problm with tomcat configuration.kindly can
any one tell to me what is the mistake iam doing.i already
configured tomcat as fallowing
http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/
even though iam getting the PortNO .and changed with different
no of Ports but no working kindly can any one tell me what is the
mistake iam doing........?


Answer

Variable=CATALINA_HOME
Value=path../bin;.

Is This Answer Correct ?    2 Yes 0 No


Question { 5926 }

Hi frnds iam new to struts wen iam running helloworld
application using struts iam getting the error as belwo
kindly any one can solve it plzz .....thanks in
advance.........
Nov 18, 2009 9:27:46 PM
org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING:
[SetPropertiesRule]{Server/Service/Engine/Host/Context}
Setting property 'source' to
'org.eclipse.jst.jee.server:StrutsExample1' did not find a
matching property.
Nov 18, 2009 9:27:46 PM
org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING:
[SetPropertiesRule]{Server/Service/Engine/Host/Context}
Setting property 'source' to
'org.eclipse.jst.jee.server:Struts1' did not find a matching
property.
Nov 18, 2009 9:27:46 PM
org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which
allows optimal performance in production environments was
not found on the java.library.path: C:\Program
Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\sys
tem32;C:\WINDOWS;C:/Program
Files/Java/jre6/bin/client;C:/Program
Files/Java/jre6/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOW
S\System32\Wbem;C:\Program Files\Java\jdk1.5.0_18\bin;
Nov 18, 2009 9:27:46 PM
org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8081
Nov 18, 2009 9:27:46 PM org.apache.catalina.startup.Catalina
load
INFO: Initialization processed in 678 ms
Nov 18, 2009 9:27:46 PM
org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 18, 2009 9:27:46 PM
org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Nov 18, 2009 9:27:46 PM
org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Nov 18, 2009 9:27:46 PM
org.apache.catalina.core.ApplicationContext log
SEVERE: Error loading WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@ca2dce
org.apache.struts.action.ActionServlet
java.lang.ClassNotFoundException:
org.apache.struts.action.ActionServlet
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Webap
pClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Webap
pClassLoader.java:1233)
at
org.apache.catalina.core.StandardWrapper.loadServlet(Standar
dWrapper.java:1095)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrappe
r.java:993)
at
org.apache.catalina.core.StandardContext.loadOnStartup(Stand
ardContext.java:4149)
at
org.apache.catalina.core.StandardContext.start(StandardConte
xt.java:4458)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.j
ava:1045)
at
org.apache.catalina.core.StandardHost.start(StandardHost.jav
a:722)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.j
ava:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine
.java:443)
at
org.apache.catalina.core.StandardService.start(StandardServi
ce.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer
.java:710)
at
org.apache.catalina.startup.Catalina.start(Catalina.java:583
)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:2
88)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:41
3)
Nov 18, 2009 9:27:46 PM
org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /Struts1 threw load() exception
java.lang.ClassNotFoundException:
org.apache.struts.action.ActionServlet
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Webap
pClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Webap
pClassLoader.java:1233)
at
org.apache.catalina.core.StandardWrapper.loadServlet(Standar
dWrapper.java:1095)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrappe
r.java:993)
at
org.apache.catalina.core.StandardContext.loadOnStartup(Stand
ardContext.java:4149)
at
org.apache.catalina.core.StandardContext.start(StandardConte
xt.java:4458)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.j
ava:1045)
at
org.apache.catalina.core.StandardHost.start(StandardHost.jav
a:722)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.j
ava:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine
.java:443)
at
org.apache.catalina.core.StandardService.start(StandardServi
ce.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer
.java:710)
at
org.apache.catalina.startup.Catalina.start(Catalina.java:583
)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:2
88)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:41
3)
Nov 18, 2009 9:27:46 PM
org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8081
Nov 18, 2009 9:27:46 PM org.apache.jk.common.ChannelSocket
init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 18, 2009 9:27:46 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
Nov 18, 2009 9:27:46 PM org.apache.catalina.startup.Catalina
start
INFO: Server startup in 616 ms


Answer

Please check the proper appache configuration in computer
environment variables.

Is This Answer Correct ?    0 Yes 3 No

Question { CTS, 14180 }

What causes Out of Memory exception?


Answer

When ever Heap size is full at that time out of memory
exception. To avoid the this exception, we can increase the
Heap size.

Is This Answer Correct ?    8 Yes 1 No

Question { CTS, 42507 }

Can i have abstract class with no abstract methods?


Answer

yes,please find the below example.

abstract class AbstractClass1 {
public void method1(){
System.out.println("inside method1...");
}
}
class AbstractClass2 extends AbstractClass1{
public void method2(){
System.out.println("inside method2...");
}
}
public class AbstractDemo {
public static void main(String[] args) {
AbstractClass2 a = new AbstractClass2();
a.method1();
a.method2();
}
}

Is This Answer Correct ?    6 Yes 2 No

Question { 6136 }

how can we connect to db without using getConnection()
method


Answer

without getConnection(), we can't connect the DB.

Is This Answer Correct ?    7 Yes 2 No

Question { 10260 }

what is the purpose of load_on_startup entry in struts-
config.xml?


Answer

is used in web.xml.who is using
tag in the struts- config.xml. please
confirm.

Is This Answer Correct ?    5 Yes 0 No

Question { 4049 }

wat happen when the connection is nt closed in jdbc
n what vl happen when i interchange in executequery n
execute statements


Answer

when con.close() is executed the memory deallocated in the
server. if we don't use con.close(),connection will be
increased in the server. suppose the connections size are
reached to max connection, nobody access the database in the
site. This is performance issue.

Is This Answer Correct ?    4 Yes 0 No

Question { HCL, 9977 }

In method overloading ,if i change the return type to Long
instead of INT,is the program execute


Answer

class OverloadDemo {
int test(int x) {
return x*x;
}

int test(long a) {
long l = a*a*a;
return l;
}

double test(double a) {
return a*a;
}

}
public class Over extends OverloadDemo{
public static void main(String[] args) {
OverloadDemo od = new OverloadDemo();
int a = od.test(12.456); //error:Can't convert from
double to int.
}
}

Program not compiled . because Can't convert from double to int.

Is This Answer Correct ?    2 Yes 0 No

Question { Persistent, 21041 }

wat is class level lock and object level lock


Answer

class StringSample{
static void method1(){
System.out.println("classlevel...");
}
void method2(){
System.out.println("object level...");
}

}
public class StringDemo{
public static void main(String[] args) {
StringSample.method1(); // class level
// StringSample.method2(); //error
StringSample s2 = new StringSample();
s2.method2(); //object level

}
}

Is This Answer Correct ?    8 Yes 18 No

Question { 4770 }

What is type casting?


Answer

casting means one type of date to another type of data.
There are two types
1.Implicit Type Casting.
2.Explicit Type Casting.

public class One {
static short i=10;
int k =i; //implicit
byte b = (byte)i;//Explicit
public static void main(String[] args) {
System.out.println("integer i..."+i);
}
}

1.Implicit Casting :
===================
The small data type will be automatically covert to big data
type.
Example:
static short i=10;
int k =i; //implicit
2.Explicit Casting:
===================
The big data type will be convert to small data type by type
casting.
Example:
static short i=10;
byte b = (byte)i;//Explicit

Is This Answer Correct ?    6 Yes 0 No

Question { Syntel, 6585 }

How to carryout the validations in struts if the validator
frame work cant handle the validation


Answer

There are two types of validations in Struts.
1.by using validator method in form bean.
2.by using validator.XML file in the struts. that
vlalidators are declared in validator.XML.
The validator frame work handle the validation. he
validation are declaring in validator.xml.

Is This Answer Correct ?    2 Yes 1 No

Question { DELL, 8009 }

How to implement Singleton


Answer

Ensure a class has only one instance, and provide a global
point of access to it. Singletons maintain a static
reference to the sole singleton instance and return a
reference to that instance from a static instance() method.

Example:
========

public class MyClassSingleton {

private static MyClassSingleton instance;

//Constructor must be protected or private to perevent
creating new object
protected MyClassSingleton() {

}
//could be synchronized
public static MyClassSingletongetInstance() {
if (instance==null)
instance = new MyClassSingleton()
return instance;

}
public void method1(){
System.out.println("hello singleton");
}
}//end of class

Is This Answer Correct ?    1 Yes 1 No

Question { HCL, 6627 }

What compiler do not do if we create our own constructor?


Answer

JVM compiler check the java code. If you are not created
the constructor for the class. JVM is automatically created
with out parameters constrctor.

Is This Answer Correct ?    16 Yes 1 No

Question { TCS, 9369 }

Difference Between getRequest and PostRequest?


Answer

getrequest means before doing the work with request. This
is fully secure. PostRequest means after done the work take
the request. This is not secure.

For Example: suppose you are doing some updates in
production. first we need to managers approval. you are
doing work with managers approval. This is fully secure.
you aer done with out mangers approval. some times u can do
mistakes. This is not secure.

Is This Answer Correct ?    2 Yes 14 No

Prev    1    [2]   3   4    Next