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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Auto reloading of any edited class/servlet

 
Greenhorn
Posts: 14
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I am developing an Java Web Application. We all know we have to do several changes in the class/servlet at times.
Everytime i make any change to my Class/Servlet, i have to restart my Tomcat server.
So, is there any way i can reload the class automatically on every SAVED change?


PS:In Netbeans IDE, i would never face such problem, but I don't use that anymore.

Thanks..
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is a reload option in the container. you can reload the container or tomcat by using it.

you can open it with writing url of http://localhost:8080/ and than on "Manager App"

you will be asked for the usename and password give it and you can see you application name deployed on the server and on the right side you will see reload button don't ever press undeploy button...
 
Ashish Kataria
Greenhorn
Posts: 14
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear prashant chindhade,

thank you for your kind advice..
I tried the the Tomcat Manager, it asked me for my username and password.
As mentioned in the tomcat-users.xml, I tried both the users, but it showed this error

HTTP Status 403 - Access to the requested resource has been denied

--------------------------------------------------------------------------------

type Status report

message Access to the requested resource has been denied

description Access to the specified resource (Access to the requested resource has been denied) has been forbidden.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.33




Please help me out..
 
Prashant Chindhade
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check that this code is in your tomcat-useer.xml file

-->
- <tomcat-users>
- <!-- NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.

-->
- <!-- NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.

-->
- <!-- <role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>

-->
<user name="admin" password="admin" roles="admin-gui,manager-gui,manager-script,admin" />
</tomcat-users>

if not than re install tomcat and properly give usename and password..

regs

Prashant
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thnaks prashant,

I have always wondered how to enter the administration section, but hadn't time to check further. Who will expect that everything is explained in great details in the right place next to the role definitions in a comment
I added the admin user with manager-gui role and now I can access the manager section. Thanks again!
 
Ashish Kataria
Greenhorn
Posts: 14
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear prashant chindhade,

Thank you again for your feedback..
My code was already un-commented but this part was missing..

<user name="admin" password="admin" roles="admin-gui,manager-gui,manager-script,admin" />

You have saved me a ton of work..thank you again!
 
Seriously Rick? Seriously? You might as well just read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic