• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

the requested source not available

 
sandeep kumar thommandru
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sandeep kumar thommandru
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20719
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k sorry and thank you sir..
 
sandeep kumar thommandru
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic