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 What is the right development environment? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "What is the right development environment?" Watch "What is the right development environment?" New topic
Author

What is the right development environment?

Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
Hi everybody.
I thought that this would be the best place to get some advice on this, since I don't have anybody here at work who can tell me. This might be a little long, but I want to explain the whole thing clearly.
I would like to know what kind of environment is the best to work in. Here's my situation:
I was told here to use JBuilder 3.5, but my personal desktop doesn't have enough RAM to run it properly. They tried to install more, but it didn't work. So, to solve this problem, they created an account for me on one of our servers, which I don't think is used for anything in particular. There is a webserver installed on this particular machine (IPlanet), which is what I use to test my servlets. So basically I do most of my work in the server room (compiling, testing, etc).
Lately though I've been having problems. I thought it was the software (JBuilder) because I was using a version that I downloaded off the website, so I bugged people and got a full version. But that doesn't seem to be it.
Whenever I compile a file, I then put the produced .class file into a /servlet folder, which I can then call from a browser to test it. But for the past week or so, no matter what I changed, it always displays the same file. It's as if the new file doesn't copy over the old one. So I tried deleting the old one and re-saving the new one, but that didn't work. I tried completely emptying the folder and putting only the one I want to call in, but that didn't work either. It would always display an old copy of something that is long gone. The last thing I tried was completely renaming the file (and the class so that it would compile), but now when I try to run that it just says that it can't find the class.
So here's where my question comes in. A person I talked to thinks that it's insane that I have to work on a server. He says that developers don't put their work on servers directly, that they have ways of testing their applications on their own computers first. Is this how people work? This is my first job, and I work by myself. I've never developed anything before, and I knew nothing about java before I started. I would like to be able to go to people here and say "hey, look, this is not the right way to work. I need this, this, this and this". I would like to hear how other people are set up to work. If this is in the wrong forum, I apologize, but I am working with servlets and an oracle database, and need to know how people are set up to work with these.
Thank you very much,
Annette
Nitin Shivaram
Ranch Hand

Joined: Jan 17, 2001
Posts: 71
Hi Annette,
I wouldn't know which is the absolute correct way to do things, but what i do want to tell you is how i work at my office.
We at our office have two servers, one for development and testing and the other for production.
The m/c which is used for development and testing has two servers running on it, one being used for development and the other for testing.
I personally wouldn't recommend working on the local m/c because if you are working on a large application, then you need to recreate everything that is there on the server on your local m/c which is not good at all, agreed hard disk space is not a problem, but there would be dependencies such as packages, class files and other resources such as html files, images etc, you wouldn't want to waste your time copying all these resources to the local system from the server and vice-versa.
And when i say work on the server, i mean telnet'ing to the server, not physically sitting on the server !!
And btw, did you check whether it was a problem with caching(this is regarding the class file).
Hope this helps
cheerio
------------------
Nitin S


Nitin S<br />Sun Certified Java Programmer for the Java 2 platform.<br />Tekmetrics Certified Java Programmer For the Java 2 Platform.
Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
Hi Nitin!
Thanks so much for your reply. So if I understand correctly, you really do work on the server, but by telnet. I physically sit at the server (which I'm doing right now!). Wouldn't it be much slower to do all your coding and compiling over telnet or other similar method?
Anyway, I found someone to help me check out the caching issue, and we thought that had fixed it, which it probably did. However, I'm almost ready to conclude that it's either a problem with my software, or it's a problem with me not knowing how to use the software. I've read the manuals on how to compile, but it doesn't seem to work. Everytime I make one teeny tiny little change, I have to copy the code, start a new file and paste it there. Does that seem right to people? Shouldn't I just be able to recompile and have it overwrite the old file?
Nitin Shivaram
Ranch Hand

Joined: Jan 17, 2001
Posts: 71
Annette,
It'll definitely be faster to do the development over telnet rather than do it on the local m/c and copy files to the server.
Why don't you do the following checks.
1) when you compile the servlet source, check the destination of the class file. The default will be the current directory, this can be changed with the "-d" option.
2) if the class files are being overwritten, then check the webserver setting to see if automatic reloading of servlets has been activated.
cheerio

------------------
Nitin S
sr ke
Greenhorn

Joined: Jan 05, 2001
Posts: 4
Restart your server when ever you make changes to your class.
Check this out.
Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
check what out?
I use JBuilder to compile my files. It's an option in the menu. And the .class file goes into a class folder in the same directory as my file. If I check the date and time of the file, it's shows that it's been updated, but yet the changes don't take effect. I just can't understand why it used to work and now it doesn't!
Danny Mui
Ranch Hand

Joined: Dec 14, 2000
Posts: 42
I'm not too sure of IPlanet's directory structure, but in tomcat and resin's structures for web applications, the servlets need to be in a WEB-INF/classes directory with a structure that matches the package hierarchy.
One thing i'd try,
1) do a search on your computer/server for the .class that represents your servlet.
2)Assuming the output is not cached by the browser, delete/rename the class file that is not in the Jbuilder output directory (ie any instances that are old).
3) fire up the servlet, it shouldn't work hehe.
4) copy it back to the directory. What I do when writing stuff (im not recommending this, only telling you what I do) is to compile directly to the servlet runner's web application class directly.
if that don't work...
1) restart the stupid server
2) check the servlet refresh settings..

if that don't work...
have a beer.
hehe
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
To eliminate if the server does automatic loading of new .class fiels or not, just stop the server and start it again and now try to call the servlet from browser.
Also make sure your JBuilder puts the compiled .class servlet files to the web application's deployment directly. For example .../WEB-INF/classes directory.
regds
maha anna
Mirko Froehlich
Ranch Hand

Joined: Aug 21, 2000
Posts: 114
I quite like the way we have worked in my current and my previous jobs in the last few years, which was to do all development on your own workstation. With a decent Pentium-3 class computer with 256MB RAM (128 is not enough), it is no problem at all to run a webserver, a database, and an application server, along with a fairly complex JSP and Servlet-based application. Currently, I am running IIS, SQL Server, and JRun 3.0. In my previous job, I used IBM HTTP Server (an Apache derivative) and Bluestone Total-E-Business (which comes with its own app server), but pointed to an external Oracle database. I found it very convenient to do development on a personal machine, where you can do whatever you need (crash the server, restart it every few minutes if necessary, etc.). For integration and QA testing, we had a development and a QA server.
-Mirko
Originally posted by Nitin Shivaram:
Hi Annette,
I wouldn't know which is the absolute correct way to do things, but what i do want to tell you is how i work at my office.
We at our office have two servers, one for development and testing and the other for production.
The m/c which is used for development and testing has two servers running on it, one being used for development and the other for testing.
I personally wouldn't recommend working on the local m/c because if you are working on a large application, then you need to recreate everything that is there on the server on your local m/c which is not good at all, agreed hard disk space is not a problem, but there would be dependencies such as packages, class files and other resources such as html files, images etc, you wouldn't want to waste your time copying all these resources to the local system from the server and vice-versa.
And when i say work on the server, i mean telnet'ing to the server, not physically sitting on the server !!
And btw, did you check whether it was a problem with caching(this is regarding the class file).
Hope this helps
cheerio

Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
Thanks everybody. I finally got administrative rights to the web server yesterday. Before that I couldn't get in to start or stop it. We'll see how that goes. I just wonder why it used to work fine, and now it doesn't. I played around some more yesterday, and it seems that everytime I make 1 little change and recompile, the changes don't take effect. For example, to test this out, I changed the color (my servlet outputs the tag to change the background color). Yet when I recompile the file, I still get the old one. I'm going to try stopping and starting the server to see if I can get the new one to show.
I going to get very frustrated if I have to copy and paste the code into a brand new file everytime I make a change.
Thanks again!
Annette
P.S. I would very much like to work on my own workstation. I just wanted to see if it was done in the "real" world. My desktop only has 64Mb RAM which is why I can't even run JBuilder.
I think I'm going to have to go for that beer!!
Bhupinder Dhillon
Ranch Hand

Joined: Oct 12, 2000
Posts: 124
I was browsing through this thread and noticed that none of the solutions presented to you were any better than the one you have. Anyway, here is how I work.
This is what's on my workstation:
OS: NT4 sp6a
SERVER: iPlanet Enterprise Server 4.1
SDK: 1.2.2
RAM: 128mb
PC: Compaq Deskpro PII 400
We use MERANT PVCS Version Manager to manage source code and we have Oracle test databases sitting somewhere on another server. We use TYPE 4 JDBC driver from Oracle for our servlet/jsp apps.
The main reason for using the server on my own machine is that no one else gets bothered by me restarting the server whenever I need to. Especially when I am compiling/debugging helper classes , which server doesn't reload automatically.
BTW, here are the lines you need to insert in <server-root>/config/contexts.properties file:
context.global.isModifiedCheckAggressive=true
context.global.reloadInterval=5
Hope it helps.
Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
Hi Bhupinder!
Thanks so much. I see how your set-up would be best. I played around this morning and the only way I can get things to work is by stopping and restarting the webserver everytime I recompile. It's kind of time consumming, but I have no choice. I just hope I'm not affecting anybody by doing this. I don't think it's used by other people, but you never know! I guess I might just have to ask that they set me up with appropriate equipment! It sounds like you would have almost the exact setup that I would need.
Thanks again,
annette
Bhupinder Dhillon
Ranch Hand

Joined: Oct 12, 2000
Posts: 124
Did you load the configuration files and then applied changes after editing the file? If not, edit the file and then go to admin UI | manage server and then "Apply" link on the top right corner. You should see two buttons "Load Configuration Files" and "Apply Changes". Click on the load button and then "apply" button again, this time click on apply changes. If the servlet is not a registered servlet then it should reload the new servlet after compiling.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the right development environment?