Tag Archives: Tomcat

From Java Source to Bare Metal, Part Two: The Desolation of Bytecode

Episode 50

In the previous episode, we started a journey through layers of abstraction of modern back-end web application. As a response to unexpected request, a Hobbit object is going to an adventure, and must travel safely across the technology stack. We seek an answer to the question what happens between Java code and the physical machine. Perhaps, even further.

Our Hobbit leaves the, yet familiar, plain of web framework and goes deep down under the Misty Server Mountains.

Riddles in the Dark: The Server

The code sits atop of web framework, and web framework sits atop of web server. That was mostly true until recently. Now, with Spring Boot, it is common that instead of deploying packed application to the server, there is a fat jar that contains embedded server inside an application. No configuration, no deployment, just running a single jar. Simple solution for simple problems, but of course it’s no silver bullet and might not fit everywhere. How does the server and the application fit together?


There are different tiers of servers, as I wrote some time ago. The largest that we care about are application servers, like Read the rest of this entry »


Posted by on December 29, 2016 in Technology


Tags: , , , ,

Into the Wild

Entry 10, Day 20

Time to talk a little environment. Go green, plant a tree, that kind of stuff. Kidding. We are going to talk about the server and the data source for the application. First, what is actually a server?

Server in general is something (hardware + software) that provides responses for requests across the network (or even locally). We are mainly interested in web servers, so we have a http request and http response. This doesn’t actually narrow down to www. They are WebServices carried over http via SOAP. You know, machine talking to another machine, skipping the unreliable protein-based components. Since I’m a programmer, not a sysadmin, by the term server I will understand the software part.

There are basically 3 tiers of server, we would be interested in:

HTTP Server. This is basically just to serve static resources, including client side scripting languages. You can build quite a big piece of an application in GWT, and as long as it does not require any server side dynamic behaviour (say database access), you are good. But who doesn’t require database access those times? The unbeatable king of http servers is the Apache HTTP server. The piece of software that gave name to the entire organisation later. Before Java settled in the web, we would just take Perl or PHP, put it somewhere around Apache, lay hands on database, or whatever is needed and be happy. But now we have…

Web Container. It is more than http server, since it implements a tiny but important part of Java Enterprise Edition api. Namely Servlet and JSP. Those seem to be a bit outdated technologies, but they are a basis for every new and fancy stuff in Java web world. For example, Spring is actually a big servlet underneath. Again, there is a clear leader in this field, Apache Tomcat. But what, if you need more?

Application Server. The monstrosity that implements entire JEE specification. So, besides what web container offers, we have JSF, persistence, transactions, messaging, batch api and other stuff, but perhaps most notably: the Enterprise Java Beans. There quite a few application servers out in the field. I’ve worked with Weblogic and Glassfish. If you don’t like Oracle, there is also JBoss (it is called WildFly now, as I’ve just learned). Or Apache Geronimo for anarchists.

So, what do I actually need? Since I’m going to use Spring, and Spring has many features that replaces JEE standard (Actually many apis in modern JEE were inspired by Spring.), I’m not going to need full application server. Web Container is enough for Spring, so it should be enough for me. Since picking up a popular server simplifies hosting and development in general (lots of people have the same problem as you) I’ll go with Tomcat 8.0.9. If there would be a need for an application server in the future, we are going to have a migration. Shouldn’t be tough, should it?

And what about database? I have serious time issues recently, so in order not to keep this post too long in the draft state, we will talk this through in the next episode. Stay tuned.

Project-wise, I’ve set up Tomcat, created a project draft, installed MySQL and did some smoke test displaying stuff from the database via simple servlet. Nothing fancy, just hellowording. Now I’m looking for some nice MySQL client besides command line :) Any suggestions?


1 Comment

Posted by on August 21, 2014 in BookSentry, Technology


Tags: , , ,