File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes the requested source not available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "the requested source not available" Watch "the requested source not available" New topic
Author

the requested source not available

sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21

hello everyone im new to servlets..
i had executed many servlets.. only through notepads and hot deployments..
my programs folder is
E:\programs here all the java files,class files,web.xml,htmls.. i will create all these files here only.. and deploy these to the structure wat mentioned below..

it worked.. but.. if v delete the existing class files and deploy the same with some modifications.. it was not updating..
so i used to rename the class file compiling and deploying then it wrks..

my question is
1st :
while doing this y it was not updating wen i was not renaming the file..??

my path..

tomcat 5.5/webapps/examples/WEB-INF and (html files)/classes and (web.xml)/.class files

and

2nd : after doing this i had deleted my examples folder using lock hunter and again created examples folder and did the same thing.. but this tym the error is different..
it is saying that
the requested source is not available..


my path..

tomcat 5.5/webapps/examples/WEB-INF (no html files)/classes and (web.xml)/HelloWorld.class

web.xml:

<web-app>
<servlet>
<servlet-name>hw</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hw</servlet-name>
<url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>
</web-app>


path on browser:

http://localhost:8080/examples/Helloworld

while doing this im getting that error..

can anyone plzz help me..
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12787
    
    5



ALL classes used in servlets or jsp must be in a package to ensure that the JVM locates them correctly.

Bill

sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
thanks for responding.. but i didnt get you sir..

i had mentiond the directory where i keep the classes and so on..

and the class you mentioned

<servlet-class>HelloWorld</servlet-class>
is same as what i did in web.xml..

can you please explain me in detail.. if you understood the problem.. clearly..
Thanking you..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61220
    
  66

Do you understand the concept of Java packages? If not, then that's something you need to learn before tackling advanced concepts such as servlets.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
sir, i knew packages.. and all the paths given,folders structure,etc all are correct..i had already executed sir.. but y cant i access it more and more times by updating tha .java file and compiling and deploying the class files by deleting the existing class files..
i will use only notepads and command prompts..
i had clearly mentioned the problems that are emerging during repeated hot deployments..
please understand my problem.. and help me..
please dont give oneline answers.. scold me of being asking again and again.. but please explain me in a clear cut way..

thanking you..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61220
    
  66

<servlet-class>HelloWorld</servlet-class>

This class is not in a non-default package. Put it in one.

sandeep kumar thommandru wrote:please dont give oneline answers.. scold me of being asking again and again.. but please explain me in a clear cut way..


I cannot put it any clearer than that. Either you accept the help or not. The choice is yours.

P.S. Scolding people who are trying to help you is a good way to train people not to help you.
sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
Thank you very much... i will try to understand the concepts clearly.. then i will try all these.. william sir also explained the same..
i will surely receive your help sir..

you said scolding can be done in training not in helping..
cant you train me sir???
its a request..
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Forums aren't for training. They are for getting help with specific problems. You posted a specific problem, and you got an answer. So now it's your responsibility to take that answer and use it. Complaining that it's a short answer is absurd; it's a simple answer, what would be the point of expanding it into an essay? So take the answer and use it. If you run into more problems, then of course you can come back and ask about those here.

Just in case you didn't notice the answer, here it is one more time:

Put your servlet class into a package.
sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
k sorry and thank you sir..
sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
i got the answer sir its not all about packages and so on..

i am deploying while the Tomcat server is running.. and
i had learned that
we have to stop the tomcat server.. deploy.. and again start the server..

thank you for the respected sirs who had responded..

yours sincerely
sandeep kumar
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: the requested source not available