# Tomcat problem

## log

Hello all, I recently emerged tomcat. The service seems to start fine BUT when i visit http://localhost:8008/ it comes up with a blank page (but it does "work").

Also, when I look at /var/log/tomcat-5/default/catalina.out, it has the following:

log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Embedded).

log4j:WARN Please initialize the log4j system properly.

Ive searched the forums but couldnt find anything on it. Any help would be appreciated.

----------

## FalseNeutral

what happens when you visit http://localhost:8080 instead of port 8008?

----------

## log

hahaha, that was a typo, I really was visiting 8080 and its a blank page.

I tried downgrading log4j to a stable version but that didnt do much  :Sad: 

----------

## rex123

The log4j warning is probably a red herring. Tomcat works fine with a dud log4j config - it just logs to catalina.out instead of wherever log4j wanted to log to.

The most likely reason for the blank page (in my experience) is that you have no host configured for the URL you are using. Tomcat seems to like to send nothing if it can't find a relevant virtual host. This is just a guess - I don't know anything about your configuration.

----------

## dasalvagg

I'm having the same problems.  I dont think the ebuilds for tomcat and log4j set everything up correctly.  I have the appropriate log4j.properties and tomcat config files and I still get this error.  My guess right now is that the paths are wrong and therefore not finding the files.  Has anyone had success with this?

----------

## bfrackie

which version of tomcat? also post your server.xml.

IMHO a standard tomcat5.0.x use Logger instead of common-logging (i.e. log4j)

----------

## Sabishii-ookami

Hi, I had the very same problem with Tomcat 5.0.28 and I managed to fix it. Here is what I did :

I downloaded a newer copy (version 1.2.1 binary) from  http://java.sun.com/products/JavaManagement/download.html and copied the new jmxri.jar file to /usr/share/jmx/lib/jmxri.jar, and now Tomcat starts up perfectly every time.  

Hope it helps you out  :Smile:  it worked for me!

----------

## dasalvagg

I already have jmx 1.2.1 installed from portage.  I tried installing the new copy anyhow. I still get the same error.

----------

## ArsDangor

I have the same problem. It happens on 5.0.28, but not on 5.0.27.

Ethereal shows there is a response from tomcat, when you get the blank page. It's an HTTP 401 error, which says "no hay Máquina que coincida con nombre de servidor localhost\r\n", in English *Quote:*   

> No machine matching server name localhost

 

It has to be server.xml, but it is identical (diff shows no output) on both versions. My server.xml is the default one.

----------

## bfrackie

same here for tomcat-5.0.28:

(from lynx) Alert!: HTTP/1.1 400 No Host matches server name localhost 

really anoying. 5.0.27 won't let me connect to JDBC via JNDI and 5.0.28 is not running properly.

----------

## ArsDangor

I've just submitted a bug report to bugzilla.

----------

## ArsDangor

OK. I have it.

A new (and undocumented) USE flag needs to be set: "examples". Set it and Tomcat will behave properly.

----------

## tizzyd

I love you, man.

----------

## dasalvagg

Has anyone solved the original problem with the log4j warning?  I would really like to get this working.

----------

## Riekr

that worked for me: (i don't remember if .orig file was created by me)

```
root@pegasus /usr/share/tomcat-5/bin # diff catalina.sh catalina.sh.orig

111c111

< CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:`java-config -p commons-logging`:`java-config -p log4j`

---

> CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:"$CATALINA_HOME"/bin/commons-logging-api.jar
```

moving catalina.sh.orig to catalina.sh worked for me.

----------

