Error HTTP 503 in Tomcat

1,076 views
Skip to first unread message

jamer

unread,
Feb 4, 2009, 3:30:57 PM2/4/09
to Google Web Toolkit
Hello
I developed an application using the library 1.4, but I have adapted
to the 1.5 library, and in the hosted mode it is ok, the compile and
there is no problem using the code above.
The problem is that when deployed in apache tomcat I get the HTTP 503
ruling, saying that the application is not available. The bug appears
when entering the web.xml configuration file. If I delete the web.xml
I load the application and it is ok, but the call to server failed, it
is logical.

What happened?

It is the web.xml file

<web-app>
<servlet>
<servlet-name>FrontEndService</servlet-name>
<servlet-class>proyect.server.FrontEndServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FrontEndService</servlet-name>
<url-pattern>/FrontEndService</url-pattern>
</servlet-mapping>
</web-app>

elliot

unread,
Feb 4, 2009, 6:25:01 PM2/4/09
to Google Web Toolkit
a couple shots in the dark from the limited info-

1) web.xml vs module.gwt.xml
perhaps you have made a typo in the web.xml file. looks well formed
from here.
gwt.xml presumably looks like
<module>
<servlet
path ="/FrontEndService"
class ="proyect.server.FrontEndServiceImpl"
/>
</module>


2) what jvm tomcat is running under could cause your problem. if you
are running exclusively Java 1.5 on your server, then its not this.

if tomcat is running under Java 1.4, and the java components of your
webapp {in urWEBAPP/classes} are compiled under java 1.5,
it will fail with a major.minor version error.

if this odd circumstance fits you, you will need to upgrade jvm or
explicitly compile your servlet code under java 1.4.

Lothar Kimmeringer

unread,
Feb 5, 2009, 3:23:59 AM2/5/09
to Google-We...@googlegroups.com
jamer schrieb:

> It is the web.xml file
>
> <web-app>

Does it start that way? If yes, the xml- and doctype-declaration
misses and you should add

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

> <servlet>
> <servlet-name>FrontEndService</servlet-name>
> <servlet-class>proyect.server.FrontEndServiceImpl</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>FrontEndService</servlet-name>
> <url-pattern>/FrontEndService</url-pattern>
> </servlet-mapping>

There also misses the welcome-file-list, otherwise the server
looks for (most likely) "index.html". You should add

<welcome-file-list>
<welcome-file>FrontEndService.html</welcome-file>
</welcome-file-list>

In addition to that you should have a look into the logfiles
of the server. A 500-error means that something bad happened
on the server side. Maybe the message in the browser is
not the full truth and there is some problem reading resources
of the web-application the server is only writing into the log
and not telling the client.


Regards, Lothar

jamer

unread,
Feb 5, 2009, 6:13:50 AM2/5/09
to Google Web Toolkit
It is the gwt.xml

<module>

<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.xml.XML'/>
<inherits name='com.google.gwt.i18n.I18N'/>
<inherits name='org.hanson.gwt.widgets.WidgetLibrary'/>
<inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/>

<entry-point class='proyect.client.Main'/>
<servlet path="/FrontEndService"
class="proyect.server.FrontEndServiceImpl"/>

</module>
In apache tomcat i use java 1.5 and i compile with java 1.6, because
apache tomcat not running with java 1.6, and i don't understand it.

Thank you

Lothar Kimmeringer

unread,
Feb 5, 2009, 7:20:57 AM2/5/09
to Google-We...@googlegroups.com
jamer schrieb:
> It is the gwt.xml

What is in the gwt.xml? A correct quoting might avoid this
question in the future by the way.

> In apache tomcat i use java 1.5 and i compile with java 1.6, because
> apache tomcat not running with java 1.6, and i don't understand it.

Install a JDK 1.5 and compile with that. Java 1.6 has a new
Class-Version and JREs of version 1.5 will fail to load classes
compiled with Java 1.6. This should also be mentioned in the
log-files I asked you to have a look into.


Regards, Lothar

jamer

unread,
Feb 10, 2009, 10:26:27 AM2/10/09
to Google Web Toolkit
It is the Catalina log

10-feb-2009 16:18:14 org.apache.catalina.core.AprLifecycleListener
init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: .:/Library/Java/Extensions:/System/Library/Java/
Extensions:/usr/lib/java
10-feb-2009 16:18:14 org.apache.coyote.http11.Http11Protocol init
INFO: Inicializando Coyote HTTP/1.1 en puerto http-8080
10-feb-2009 16:18:14 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1200 ms
10-feb-2009 16:18:14 org.apache.catalina.core.StandardService start
INFO: Arrancando servicio Catalina
10-feb-2009 16:18:14 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
10-feb-2009 16:18:17 org.apache.tomcat.util.modeler.Registry
registerComponent
GRAVE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//
localhost/Main,J2EEApplication=none,J2EEServer=none
10-feb-2009 16:18:17 org.apache.catalina.startup.HostConfig
deployDirectory
GRAVE: Error durante el despliegue del directorio Main de la
aplicaci•À?n web
java.lang.UnsupportedClassVersionError: Bad version number in .class
file (unable to load class proyect.server.FrontEndServiceImpl)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal
(WebappClassLoader.java:1851)
at org.apache.catalina.loader.WebappClassLoader.findClass
(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1354)
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1233)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations
(WebAnnotationSet.java:108)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations
(WebAnnotationSet.java:58)
at
org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig
(ContextConfig.java:297)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:
1068)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent
(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:117)
at org.apache.catalina.core.StandardContext.start
(StandardContext.java:4252)
at org.apache.catalina.core.ContainerBase.addChildInternal
(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
525)
at org.apache.catalina.startup.HostConfig.deployDirectory
(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories
(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:
492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent
(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
443)
at org.apache.catalina.core.StandardService.start
(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:
710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
10-feb-2009 16:18:18 org.apache.catalina.loader.WebappClassLoader
validateJarFile
INFO: validateJarFile(/usr/local/apache-tomcat-6.0.18/webapps/Meztuls/
WEB-INF/lib/gwt-dev-mac.jar) - jar not loaded. See Servlet Spec 2.3,
section 9.7.2. Offending class: javax/servlet/Servlet.class
10-feb-2009 16:18:18 org.apache.catalina.loader.WebappClassLoader
validateJarFile
INFO: validateJarFile(/usr/local/apache-tomcat-6.0.18/webapps/Meztuls/
WEB-INF/lib/gwt-user.jar) - jar not loaded. See Servlet Spec 2.3,
section 9.7.2. Offending class: javax/servlet/Servlet.class
10-feb-2009 16:18:18 org.apache.coyote.http11.Http11Protocol start
INFO: Arrancando Coyote HTTP/1.1 en puerto http-8080
10-feb-2009 16:18:18 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
10-feb-2009 16:18:18 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/18 config=null
10-feb-2009 16:18:18 org.apache.catalina.startup.Catalina start
INFO: Server startup in 4384 ms

What happened?

Thank you!!

Lothar Kimmeringer

unread,
Feb 10, 2009, 10:33:37 AM2/10/09
to Google-We...@googlegroups.com
jamer schrieb:

> java.lang.UnsupportedClassVersionError: Bad version number in .class
> file (unable to load class proyect.server.FrontEndServiceImpl)

[...]
>
> What happened?

I already told you and my answer is in the quote you added as TOFU
(as we call it in Germany).

>> Install a JDK 1.5 and compile with that. Java 1.6 has a new
>> Class-Version and JREs of version 1.5 will fail to load classes
>> compiled with Java 1.6. This should also be mentioned in the
>> log-files I asked you to have a look into.

If your JRE being used with Tomcat is 1.4 you have to install
JDK 1.4 but the necessary steps are the same.


Regards, Lothar

Reply all
Reply to author
Forward
0 new messages