sarvesh dikonda

Ranch Hand
+ Follow
since Apr 08, 2012
sarvesh likes ...
Firefox Browser Windows XP Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
19
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sarvesh dikonda

Superb guys! I am happy! Thank you both T Mishra and Antriksh jain for your precious suggestions. Now i can move ahead happily! This is why i love this forum so much. Keep up the the good work guys! God bless!
8 years ago
Please someone reply ! Curiously, waiting for the help.
8 years ago
My HTML file is as follows-


Below is DD .xml file -



Below is servlet code -



I have followed the same instructions as in the book.



On running the above command on the command prompt i successfully got the CoffeeSelect.class file. But if someone can verify the above command and also help me understand the following part of the above command "C:\Tomcat 5.25\common\lib\servlet-api.jar";classes;. if it is right!

My Development Environment-

For HTML file is E:\MyProjects\coffeeV1\web\form.html
For DD file is E:\MyProjects\coffeeV1\etc\web.xml
For servlet file is E:\MyProjects\coffeeV1\src\com\example\web\CoffeeSelect.java
For servlet .class file is E:\MyProjects\coffeeV1\classes\com\example\web\CoffeeSelect.class

My Deployment Environment-

For HTML file is C:\Tomcat 5.25\webapps\Coffee-v1\form.html
For DD file is C:\Tomcat 5.25\webapps\Coffee-v1\WEB-INF\web.xml
For servlet .class file is C:\Tomcat 5.25\webapps\Coffee-v1\WEB-INF\classes\com\example\web\CoffeeSelect.class


On running the following URL on the Google Chrome browser -
http://localhost:8080/Coffee-v1/form.html
the form gets displayed but when i click the Submit button
i get the following error-

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class com.example.web.CoffeeSelect
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:619)
root cause

java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class com.example.web.CoffeeSelect with modifiers ""
sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
java.lang.Class.newInstance0(Class.java:349)
java.lang.Class.newInstance(Class.java:308)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:619)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.

Apache Tomcat/5.5.25



And if i reload the page i get -

HTTP Status 404 - Servlet Ch3 Coffee is not available

type Status report

message Servlet Ch3 Coffee is not available

description The requested resource (Servlet Ch3 Coffee is not available) is not available.

Apache Tomcat/5.5.25



One more thing guys do i have to download the javax package? But i did not find such reference in the book. I also tried doing that but still i cannot get he above error out of my sight!

Hey friends and all you knowledgeable people kindly help me out with my first servlet program and help me out from getting discouraged and loose interest over this as i have been doing various modifications but none seems to work out. Help me guys!
8 years ago
Check out this link for details about split() Java Docs
and for class pattern and regular expressions JavaDocs

Hope this helps!
Hello Rachel in Threads the output is never guaranteed to be the same way always. It is dependent upon the Thread Scheduler. And for the output r1 r2 m1 m2, the statement in point 4 that you made is not acceptable as, the thread 't' does not wait endlessly if that thread has completed executing run(). It simply proceeds further down the code causing no error.
Hello everyone, i am new to this group. i have created a small project using java script and HTML. I have included a Feedback page too. I want to know how to connect this feed back page to a database like MS-Access or MySQL? Kindly give me your expert advice and help me to complete my almost done project.
Hello Rachel. I guess you are right with your saying,that string "end concurrency" will NEVER be printed before mt1 and mt2 have each finished their run functions.
As you can see below i executed your code and found that Thread mt2 begins first and ends first followed by Thread mt1 followed by the string "end concurrency"

In thread mt2
In thread mt1
In thread mt1
In thread mt2
In thread mt1
In thread mt2
In thread mt1
In thread mt2
In thread mt1
In thread mt2
end concurrency)

But, as it is shown in the code that, it is thread mt2 that begins first, even though thread mt1 has a much higher priority in fact the highest priority in comparison with that of thread mt2.

Hope this helps!
Hello Rahel. I read your question and also simultaneously read the same example from KB book and i found that, the option 1 as per your given question is a valid answer along with option 3 provided, if the join() is placed inside a try/catch block which i guess you have already done on line 8. I would ask you go through the same code once again to clarify your doubt. But, one thing i couldn't figure out that, why is there a second t.join() on line 10? I feel it is unnecessary and neither could i spot the same in the example from KB book

Hope this helps!
Hello Archana. The answer to the question you asked is indeed option 'a'. Now, your doubt is also correct, but lets stick to the question asked in the given problem -

Question: Given the code below, which access modifiers(public,protected or private) can legally be placed before the myMethod() method on line 3, if no other changes are made to the code? If line 3 is left as it is, which keywords can legally be placed before the myMethod() method on line 8?



So, option 'a' correctly answers the given scenario. No need to worry about the OVERRIDING as in this case if line 3 is made private(with the rest of code intact) then, it won't be visible in the child class(As you already pointed out) and therefore, it won't be considered as an OVERRIDE nor an OVERLOAD.

Hope this helps!
can someone explain the Question 6 in detail-



The output is -

Answer Details:
(a) and (d) are correct.
(b) and (c) are incorrect.

Can someone explain why a and d are correct ?
Hello everyone, i am Sarvesh. I am new to this group.

1. I have created a small project in HTML. I have included a Feed back form in the project. I have used a input tags for text area, radio button. so i just want that, once the user/visitor fills up this feed back information, i want to save the data in a table via a database.

2. Also, i would be obliged if you could suggest me some nice books for creating small projects in HTML,CSS and Javascript,JSP. So that i can also learn and implement the above mentioned Languages. Currently i am concentrating on this small project which is basically using HTML & which would be completed on connecting to a database like MySql. Also, suggest which db is easier for connection.

P.S- I am currently using the HeadFirst HTML but i am not able to find the thing which i am looking for
8 years ago
JSP
Congratulations Sagar! How did you approach while answering the questions on the real exam?
Well done, congratulations! Thank you for sharing your experience. All the best for your future!
8 years ago
The below code is from the Threads chapter from SCJP 6 Study Guide-

Snippet 1:


And the question asked is:-
Which of the following pairs of method invocations could NEVER be executing at the same time?
A. x.a() in thread1, and x.a() in thread2 & there are other options too.

But, i just want to clarify the concept that is associated with the one given in option A.
In the book, the explanation given associated with option A is -

A is a right answer because when synchronized instance methods are called
on the same instance, they block each other.


So my doubt is that, from the above explanation, can i conclude that, each thread(i.e thread1 & thread2) are having same copy of object pointed by 'x' that are invoking the synchronized instance method a() ? I am asking this because i am getting confused with the code below.

Snippet 2:


From the above code, both the Threads are using the same or different instance(s) of Dudes as 'd' is marked static which is accessing the synchronized method from Dudes. I am thinking that, if the quoted statements(i.e

A is a right answer because when synchronized instance methods are called
on the same instance, they block each other.

) mentioned above from Snippet 1, is followed for this Snippet 2, then both the Threads here too must block each other, but it does not!

I know there is some difference between Snippet 1 & Snippet 2. But i want to clarify my doubt. So i need your guidance friends.
Thank you R Stokic for your help too!