# Tomcat displays blank pages (help please)

## halzen

hi guys,

I recently emerged tomcat, and it displays only blank pages :/

I have been fiddling around now for hours and have no idea why this may be. Im using this:

monoserv ~ # java-config-2 -L

The following VMs are available for generation-2:

1)      Sun JDK 1.5.0.16 [sun-jdk-1.5]

*)      Sun JDK 1.6.0.07 [sun-jdk-1.6]

monoserv ~ # 

Tomcat loads up with no errors in catalina.out, and when a page is requested, no errors are printed, but it only ever displays a blank page. 

This is a pretty urgent problem, and no-where can i find any conclusive reasoning.

Cheers,

h.

----------

## fschaller

Same problem here, is there a solution?

I just emerged tomcat in a hardened environment. Start-up was good, no problem, logs show no errors... has anyone an idea?

----------

## Azangod

Well, I'm no guru, I've a working environment with tomcat and it wasn't easy. 

I remember I've spilled blood, at least for the whole pack: tomcat vhost+apache+mod_jk.

I had to read a lot of manuals and remember little. Tomcat configuration is so flexible that is complexity is sincerelly too high. You can follow dozen of how-tos completely different and still have serious troubles.

That's my unlucky story.. but in the end it works   :Smile: 

Tomcat stand-alone (on port 8080 ) works?

Displays simple html pages? Write a full url 8080/index.html 'cause tomcat looks for index.jsp by default and, if I'm remembering well it doesn't autoload an index.html.

Have you already saw gentoo tomcat guide? http://www.gentoo.org/proj/en/java/tomcat-guide.xml

----------

## chilili

me too, blank page!

The ebuild of Tomcat 6 is too suck to use, just install Tomcat 5 for instead.

----------

## creepytennis

Hi chaps,

I just stumbled across this, and found a solution.

The ROOT webapp is present (you can see the files in /var/lib/tomcat-6/webapps), but not running. If you create a folder in /var/lib/tomcat-6/webapps and put an html file in it, the server will serve that. e.g. http://localhost:8080/foo/bar.html

The documentation is misleading. There is a bug about this:

https://bugs.gentoo.org/277688

I personally think that a note should be added to the Gentoo Tomcat Guide and the ebuild as soon as possible. This has the potential to seriously waste a lot of people's time.

----------

## chilili

I do not think Tomcat 6 really works.

I emerge tomcat-6 with examples, and /var/lib/tomcat-6/webapps/examples was installed.

When I access http://192.168.1.100:8080/examples/index.html  got the following error from firefox.

 *Quote:*   

> type Status report
> 
> message
> 
> description The requested resource () is not available.
> ...

 

my tomcat version is  (~) 6.0.20-r1, I have ever intalled 6.0.20 , same result.

BTW, tomcat-5 works well, and works well with mod_jk.

----------

## creepytennis

It's possible that the examples webapp is not running, even though it is installed and you can see the files. This is what caught me out with the ROOT webapp. Something should definitely be added to the documentation to clarify the situation.

If you create a new folder in /var/lib/tomcat-6/webapps and put an html file in it, does the server serve that? e.g. http://localhost:8080/foo/bar.html

The tomcat-6 ebuilds clearly need better documentation, but they do work. I'm now running it without a problem.

----------

## chilili

 *creepytennis wrote:*   

> It's possible that the examples webapp is not running, even though it is installed and you can see the files. This is what caught me out with the ROOT webapp. Something should definitely be added to the documentation to clarify the situation.
> 
> If you create a new folder in /var/lib/tomcat-6/webapps and put an html file in it, does the server serve that? e.g. http://localhost:8080/foo/bar.html
> 
> The tomcat-6 ebuilds clearly need better documentation, but they do work. I'm now running it without a problem.

 

Yes, you are RIGHT! thanks. I have two question still. 

(1)  how can I  set the about foo as the ROOT, then I can access by http://localhost:8080/bar.html but not http://localhost:8080/foo/bar.html?

(2)  how can I have multple instance Tomcat running in Gentoo? , multiple instance here I mean multi $CATALINA_BASE, so I can retstart any of the instance with effected others.

Thanks in advance.

----------

## chilili

 *chilili wrote:*   

>  *creepytennis wrote:*   It's possible that the examples webapp is not running, even though it is installed and you can see the files. This is what caught me out with the ROOT webapp. Something should definitely be added to the documentation to clarify the situation.
> 
> If you create a new folder in /var/lib/tomcat-6/webapps and put an html file in it, does the server serve that? e.g. http://localhost:8080/foo/bar.html
> 
> The tomcat-6 ebuilds clearly need better documentation, but they do work. I'm now running it without a problem. 
> ...

 

I solved both above questions.

(1) ROOT  set,  in etc/tomcat-6/server.xml

  <host>

   ....

      <Context path="" docBase="my_dir _under_webapps"

               debug="5" reloadable="true" crossContext="true"/> 

  ....

</host>

(2) Three independent instance

  According the output of "equery f tomcat" ,  DIY.

Advice, I do advice that in the ebuild of tomcat, add special flag to do this.

----------

## direwolf

This is a really bad build of tomcat.  I get they want to move directories like configurations around, etc.  But it's resulted in all the urls being broken.  The manager is in /manager/html ?? why?  That can't be standard.  No ROOT?  Or not "started" Root?  What's with that?  /docs doesn't work either, and examples doesn't even show up.  But of course they're in different places:

```

/var/lib/tomcat-6/webapps

/usr/share/tomcat-6/webapps

```

Some stuff in one place, some in another, and none of the links work.  I can't make examples work at all, I just get a 404 no matter where I put it or what I guess as a url (if it's documented somewhere how I'm supposed to figure out how the url mangling works, I can't find it).

Also, you can't deploy tomcat-dbcp.jar in your war app, it has to be in the tomcat library (/usr/share/tomcat-6/lib).

----------

## chilili

 *direwolf wrote:*   

> This is a really bad build of tomcat.  I get they want to move directories like configurations around, etc.  But it's resulted in all the urls being broken.  The manager is in /manager/html ?? why?  That can't be standard.  No ROOT?  Or not "started" Root?  What's with that?  /docs doesn't work either, and examples doesn't even show up.  But of course they're in different places:
> 
> ```
> 
> /var/lib/tomcat-6/webapps
> ...

 

You can search tomcat from bugs.gentoo.com, someone said examples was not compile infact.   :Cool: 

----------

## Bombe

 *chilili wrote:*   

> (1) ROOT  set,  in etc/tomcat-6/server.xml

 

As this still is an issue with tomcat-6.0.28, thank you very much for the solution. :)

----------

## dylanthomasfan

What kind of a build is this? This totally sucks! I have spent days on this, and I am hardly a Gentoo newbie!

----------

## dylanthomasfan

After an unnecessary amount of pain, I discovered that /usr/share/tomcat-6/webapps/ did not have a ROOT folder. I added the folder, and moved the /usr/share/tomcat-6/index.jsp/html and a few other files (mostly png and gif) from the same location into the /usr/share/tomcat-6/webapps/ROOT/ folder. And lo and behold, the test page is no longer blank. But--wait--I have other problems with the test page. Most of the localhost links don't work!

The index.jsp file--it points to incorrect places for the left hand navigation on localhost. For example, the link for "Release notes" and "changelog." But more importantly, the examples and docs and host-manager don't work. Now, I am trying to figure out if something else is broken in this build before I use this build for doing something actually useful.

Annoying.

----------

