Servlet container/server for Linux

K

Ken

What's the simplest, most straightforward, servlet container for
testing and developing servlets on Linux? I'd prefer one that doesn't
require a lot of setup, and will run on older versions of Linux.

I just started myself. Tomcat (by it's self) is good but your
requirement is low setup... Why not download the latest version of
netbeans? It includes three web containers (tomcat and two versions
of glass fish)... The point is there is a web app project, which lets
you select which server you want to deploy on and when you hit the run
button everything just works. It's pretty mindless.
 
R

Ross

I don't know why some of my messages were duplicated, I certainly
didn't post duplicates intentionally.

Yes, I understand that I need a container. What I wanted was a
container for a particular set of circumstances. Winstone is it.

I'm pretty sure that there was something weird going on with tomcat on
my machine. It certainly thought it was running, and was listening to
the ports. I used telnet to send requests to both port 8080 and 80, I
got nothing from 80, and from 8080 the continued 400 errors. I was
typing the HTTP requests myself, and was doing it over and over while
double checking what I should be typing to make sure it was correct.
Certainly both Jetty and Winstone ran the servers properly first time,
and could be interacted with via konqueror, so it's unlikely to be the
browser sending a malformed request. It's not me who is going to be
setting up the server for the proper deployment, nor me managing it.
So a lot of time spent on learning tomcat management and issue
debugging would be of little benefit to me. I'm sure that on many
machines tomcat would just plug and play, but it didn't on mine.

That's why they pay me the big bucks? I wish! I'm in education.

I haven't used tomcat for quite a few years. Back then I had it all
set up on a dedicated machine and was all set up so that people could
sftp new servlets to to prepared directories and their classes would
be instantly available to run blah blah blah. But it's been some years
and the details of how to do these things have gone into the memory
bit bucket. When people talk about "blaming the tool" because I don't
know how to use it, the whole point of my first question was to find a
tool with minimum setup and get-go time. And, as computer tools get
more sophisticated, there is, on average, an increase in the number of
things that can go wrong and the amount of time that it takes to debug
these problems. If I was actually setting up a container/server for
proper use, I'd definitely go for tomcat and allocate a few days to
get properly up to speed. What I was hoping for earlier today was to
be installed and going in minutes. Didn't happen :(

Winstone has the ability to save sessions across runs, and can be crtl-
c'd to restart it. That's good enough for me right now!
 
L

Lars Enderin

Ross said:
I don't know why some of my messages were duplicated, I certainly
didn't post duplicates intentionally.
You have to be careful when you use Google Groups.
 
A

Arne Vajhøj

Ken said:
I just started myself. Tomcat (by it's self) is good but your
requirement is low setup... Why not download the latest version of
netbeans? It includes three web containers (tomcat and two versions
of glass fish)... The point is there is a web app project, which lets
you select which server you want to deploy on and when you hit the run
button everything just works. It's pretty mindless.

Until something goes wrong.

Separate IDE and server is often easier to troubleshoot
than an integrated bundle, because the integrated bundle
hides what is happening.

Arne
 
T

Tom Anderson

I've downloaded Jetty. It runs fine, java -jar start.jar, and you can
immediately see all the demonstration servlets. Good I think. So, how do
I add my own Servlet class to the engine,

You don't add classes, you add WARs. Servlets are meaningless outside a
WAR.

To put it another way, you need to write a little shell script which packs
your classes into a trivial WAR - it wouldn't be hard.
Can't I just put my bl**dy servlets in a directory and run them?

No.

tom
 
M

Mike Schilling

Tom said:
You don't add classes, you add WARs. Servlets are meaningless
outside
a WAR.

To put it another way, you need to write a little shell script which
packs your classes into a trivial WAR - it wouldn't be hard.

Ant works even better, since it can recompile everything, build the
WAR, and deploy it, simply by typing "ant deploy"..
 
S

Steve Sobol

You don't add classes, you add WARs. Servlets are meaningless outside a
WAR.

To put it another way, you need to write a little shell script which packs
your classes into a trivial WAR - it wouldn't be hard.


No.

Yes.

Can't say much about Tomcat since I don't use it, but with Jetty you can
deploy webapps to a directory as easily as deploying a WAR. The
directory just has to have the right structure (meaning, it must have
the WEB-INF directory and the proper files inside WEB-INF)...
 
L

Lew

Steve said:
Yes.

Can't say much about Tomcat since I don't use it, but with Jetty you can
deploy webapps to a directory as easily as deploying a WAR. The
directory just has to have the right structure (meaning, it must have
the WEB-INF directory and the proper files inside WEB-INF)...

No.

That doesn't constitute "just putting bloody servlets in a directory and
running them". That's putting servlets in a very specific directory and
running Jetty.
 
M

Mike Schilling

Steve said:
Can't say much about Tomcat since I don't use it, but with Jetty you
can deploy webapps to a directory as easily as deploying a WAR. The
directory just has to have the right structure (meaning, it must
have
the WEB-INF directory and the proper files inside WEB-INF)...

Tomcat too. That is, you can give it either a WAR or an
already-exploded WAR, which sounds exactly what you're saying about
Jetty.
 
A

Arne Vajhøj

Steve said:
Yes.

Can't say much about Tomcat since I don't use it, but with Jetty you can
deploy webapps to a directory as easily as deploying a WAR. The
directory just has to have the right structure (meaning, it must have
the WEB-INF directory and the proper files inside WEB-INF)...

And a web.xml referring to the servlets etc..

Arne
 
E

EricF

No.

That doesn't constitute "just putting bloody servlets in a directory and
running them". That's putting servlets in a very specific directory and
running Jetty.
Same for Tomcat. I'm looking at TC5.5, with servlets in
[tomcat_home]\webapps\servlets-examples\WEB-INF\classes

It strikes me that this is an exploded war structure. So yeah, you can't just
drop a servlet class anywhere, but if you drop it in the right place ...
 
R

Robert Klemme

And a web.xml referring to the servlets etc..

AFAIK recent servlet standards allow for web.xml less deployment if you
provide proper annotations. There may even be defaults so you could get
away without XML and annos.

Cheers

robert
 
T

Tom Anderson

Yes.

Can't say much about Tomcat since I don't use it, but with Jetty you can
deploy webapps to a directory as easily as deploying a WAR. The
directory just has to have the right structure (meaning, it must have
the WEB-INF directory and the proper files inside WEB-INF)...

Ah, i consider such directories to be WARs. They're just unarchived WARs -
i suppose i should call them Ws.

tom
 
A

Arved Sandstrom

Robert said:
AFAIK recent servlet standards allow for web.xml less deployment if you
provide proper annotations. There may even be defaults so you could get
away without XML and annos.

Cheers

robert
The current trend seems to be toward gutting web.xml, ejb-jar.xml,
faces-config.xml, etc., and favouring annotations. I'm provisionally in
favour of annotations, for one major reason - the configuration is right
there where you need it - but oddly enough I am starting to miss the
convenience of having the deployment descriptors as single-source
references. The large apps I work with at present have very little
information in the standard descriptors, and server admin consoles don't
cut it when it comes to displaying this info either. Typically you end
up consulting the app server generated proprietary deployment
descriptors. I may be the only one, but I find this somewhat ironic.

AHS
 
R

Robert Klemme

The current trend seems to be toward gutting web.xml, ejb-jar.xml,
faces-config.xml, etc., and favouring annotations. I'm provisionally in
favour of annotations, for one major reason - the configuration is right
there where you need it - but oddly enough I am starting to miss the
convenience of having the deployment descriptors as single-source
references. The large apps I work with at present have very little
information in the standard descriptors, and server admin consoles don't
cut it when it comes to displaying this info either. Typically you end
up consulting the app server generated proprietary deployment
descriptors. I may be the only one, but I find this somewhat ironic.

Funny that you should mention this. I am also not sure whether the
current trend is actually the right one. I believe for JPA it is
beneficial that you can do everything with annotations because often you
have independent parts in a persistence scheme. But with webapps having
to search through Servlet sources to find out which one serves a
particular URL seems a rather tedious thing to do.

I'm curios what the trend of next year will be. :)

Cheers

robert
 
M

Mike Schilling

Robert said:
Funny that you should mention this. I am also not sure whether the
current trend is actually the right one. I believe for JPA it is
beneficial that you can do everything with annotations because often
you have independent parts in a persistence scheme. But with
webapps
having to search through Servlet sources to find out which one
serves
a particular URL seems a rather tedious thing to do.

I've been playing with JAX-RS in Glassfish, and noticed a huge delay
the first time a service is accessed, while it does exactly that.
 
L

Lew

Mike said:
I've been playing with JAX-RS in Glassfish, and noticed a huge delay
the first time a service is accessed, while it does exactly that.

How do you distinguish that from first-time servlet instantiation delay that
would be present regardless?
 
M

Mike Schilling

Lew said:
How do you distinguish that from first-time servlet instantiation
delay that would be present regardless?

The debugger shows that it's inside a routine that's looking things up
in the ClassLoader..
 
A

Arne Vajhøj

Arved said:
The current trend seems to be toward gutting web.xml, ejb-jar.xml,
faces-config.xml, etc., and favouring annotations. I'm provisionally in
favour of annotations, for one major reason - the configuration is right
there where you need it - but oddly enough I am starting to miss the
convenience of having the deployment descriptors as single-source
references. The large apps I work with at present have very little
information in the standard descriptors, and server admin consoles don't
cut it when it comes to displaying this info either. Typically you end
up consulting the app server generated proprietary deployment
descriptors. I may be the only one, but I find this somewhat ironic.

I completely agree.

The "let us get rid of XML config files and use annotations" change
is great for hello world apps.

But for big real world apps it is actually beneficial to have
all this stuff centrally.

A bit surrealistic that a false claim of Java EE being complex
due to XML config files actually caused changes that increased
the complexity.

Arne
 
A

Arne Vajhøj

Robert said:
AFAIK recent servlet standards allow for web.xml less deployment if you
provide proper annotations. There may even be defaults so you could get
away without XML and annos.

I don't think the servlet 3.0 spec is final yet.

But if not "recent" then "just around the corner".

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top