The image size limit has been raised to 1mb! Anything larger than that should be linked to. This is a HARD limit, please do not abuse it.
Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

Apache Tomcat is being an asshole, help!

Jimmy KingJimmy King Registered User regular
I have a web app I developed some time ago using Java that runs on Tomcat. It used to work just fine. A couple of months back I had to move to a new server and am just now setting Tomcat back up. It doesn't work anymore. The previous server was Debian 4 using Sun's Java since Tomcat hated gcj. This server is Debian 5 and is using gcj rather than Sun's implementation since Tomcat starts up with no issues using gcj this time. Both servers had Tomcat 5.5.

My app, of course, is exactly the same. I just copied the .war file and let her rip. Tomcat sees it, extracts it with no issues, etc. So I know everything is ok there. The server configuration is also the same. I had just backed up the old config files, so all I had to do was copy and paste the relevent bits of configuration. In case I missed something, I also tried just dropping the entire old server.xml in place.

Unfortunately, when I try to actually access the site, Tomcat is being a dick and says that it can't find my classes no matter what I do. Tomcat does not tell me any sort of local path where it's looking for my classes, just that it can't find the class. Is there any way I can make it tell me where it thinks my classes should be?

First load of a page I get an error like so as the root cause:
java.lang.ClassNotFoundException: games.Archive.WebEngine.Home

After that, I get the standard Tomcat 404 error stating that the servlet is unavailable.

Server config stuff is as follows:

In my server.xml:
<Host name="" appBase="/home/justin/public_html/" unpackWARs="true">
              <Valve className="org.apache.catalina.valves.AccessLogValve" directory="/var/log/tomcat5.5" prefix="games_access_log." suffix=".log" pattern="common" resolveHosts="false"/>
              <Context path="" docBase="WebEngine" debug="0" reloadable="true">
                  <Resource name="jdbc/database" auth="Container" type="javax.sql.DataSource" maxActive="50" maxIdle="5" maxWait="10000" username="REMOVED" password="REMOVED" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/justin_games_beta?autoReconnect=true"/>

As I said previously, Tomcat find the .war file in /home/justin/public_html/ and unpacks it properly to /home/justin/public_html/ All of the classes are there, the app's web.xml is there, etc. That's all in place and is exactly what worked on the old server with the same config.

Any ideas on what I may have missed? Is there a way I can tell Tomcat to tell me what local file path it's looking for my classes in?

Jimmy King on


  • Jimmy KingJimmy King Registered User regular
    edited February 2010
    Issue resolved. This can be locked.

    Here's the deal, in case anyone else goes through this.

    1) Debian tries to use gcj with Tomcat. It seems it still doesn't fucking work. It's just less broken since Tomcat will actually start up. Use the real Sun Java stuff.

    2) Once it's up and running, most Java libraries get stuck in /usr/share/java. Unfortunately, Tomcat can't find them there. You need to create symlinks to them in /usr/share/tomcat5.5

    Jimmy King on
Sign In or Register to comment.