Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

deepashree deval

Greenhorn
+ Follow
since Oct 20, 2008
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 deepashree deval

Can anybody please give me a resl life scenarion where actually the use of inner classes is made and is absolutely necessary......
13 years ago
Why is java a case sensitive language ?
13 years ago
RMI
I got the client class server class and Hello interface compiled after that i have started the rmiregistry and when i try to start the server by giving the command :

start java -classpath classDir package.Server

After I execute this command i get the following exception :

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: packrmi.Hello
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at packrmi.Server.main(Server.java:24)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: packrmi.Hello
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: packrmi.Hello
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:707)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1499)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1462)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1698)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)

Can anybody give me a solution for this

Thanks!!!1
I want to check at runtime which is the object , if it is of either UseT1 or UseT2 only then i want it to add to the collection else , i want to throw an exception
13 years ago
I have written the following code , to check what is the incoming object and add it in the collection but, i get an error given below

class Employee{
}
class BankAcount{
}
class GenericClass<UseT1,UseT2>{
UseT1 t1; UseT2 t2; ArrayList al;

GenericClass(UseT1 t1,UseT2 t2){
this.t1 = t1;
this.t2 = t2;
}
public UseT1 getT1() {
return t1;
}
public void setT1(UseT1 t1) {
this.t1 = t1;
}
public UseT2 getT2() {
return t2;
}
public void setT2(UseT2 t2) {
this.t2 = t2;
}
public void addObject(Object o){
if(o instanceof UseT1)
al.add(o);
}
}
public class GenericTwoTypes {
public static void main(String[] args) {
GenericClass gc = new GenericClass<Employee, String>(new Employee(),new String());
gc.addObject(new Employee());
}
}

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Cannot perform instanceof check against type parameter UseT1. Use instead its erasure Object since generic type information will be erased at runtime

at Generics.GenericClass.addObject(GenericTwoTypes.java:39)
at Generics.GenericTwoTypes.main(GenericTwoTypes.java:49)
Can anybody please tell me how to resolve it.....

Thanks and regards
13 years ago
Can anybody give me a real time scenario where can i use forward() method and in which situation i should go for the include()method for redirection
13 years ago
Hello ,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@page isELIgnored='false' %>
<%@ taglib uri="/core" prefix="c" %>
<HTML>
<BODY>
<b> List of Locations : </b>
<br><br>
<table>
<c:forEach var="location" items="${location}">
<tr>
<td> ${location"}</td>
</tr>
</c:forEach>

HEllo

</table>
</BODY>
</HTML>

I am dispatching my request from a servlet to the jsp page shown above , but while executing this page , it gives me an error stating :
org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:281)
org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:662)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:247)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:163)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

java.lang.ClassNotFoundException: org.apache.taglibs.standard.tlv.JstlCoreTLV
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:658)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:247)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:163)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

I have added c.tld , c-rt.tld ,fmt.tld ,fmt-rt.tld ,sql.tld ,sql-rt.tld ,
x.tld ,x-rt.tld into my web-inf and also made an entry into web.xml . please can anybody give me a solution for this problem.
I am using tomcat 5.5 , jsp 2.0
13 years ago
JSP
Why does the GenericServlet class implement the serializable interface
13 years ago
Can anyboby tell me is there any difference between static and context variables? In the sense like : static variables are shared among objects, and context variables are shared among the servlets objects.


THANKS !!!
13 years ago
since we have expressions which automatically places thye variables in output stream, why is the neccessity for the server to maintain an whole 'out' object implicitly, while it will be used very rarely
13 years ago
JSP
I want to work on JDBC with MYSQL , can anybody tell me what should I download first to star with MYSQL and how to connect to it through JDBC
Can anybody tell me when shall I use the method execute() , executeQuery() what is the difference

[Updated Topic - Dave]
[ October 21, 2008: Message edited by: David O'Meara ]