Deploying on tomcat

23 views
Skip to first unread message

fatja...@googlemail.com

unread,
Mar 31, 2009, 11:07:35 AM3/31/09
to Google Web Toolkit
Hi everyone,

I am trying to deploy my application on tomcat. I can connect to my
project, however, it is having problems finding my server classes. I
believe my xml file is setup incorrectly. Would someone be kind enough
to look at my xml file and point out where I am going wrong. I'm sure
it is something simple!

Here is my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<!-- Standard Action Servlet Configuration -->
<servlet>
<servlet-name>Application-status</servlet-name>
<servlet-class>com.project.server.Management.ServerSQLServiceImpl</
servlet-class>
</servlet>

<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>Application-status</servlet-name>
<url-pattern>/Application-status</url-pattern>
</servlet-mapping>

</web-app>







And here is my GWT XML file:

<module>

<!-- Inherit the core Web Toolkit stuff.
-->
<inherits name='com.google.gwt.user.User'/>

<!-- Inherit the default GWT style sheet. You can change
-->
<!-- the theme of your GWT application by uncommenting
-->
<!-- any one of the following lines.
-->
<!--inherits name='com.google.gwt.user.theme.standard.Standard'/
> -->
<!--inherits name='com.google.gwt.user.theme.chrome.Chrome'/> --
>
<inherits name='com.google.gwt.user.theme.dark.Dark'/>

<!-- Other module inherits
-->


<!-- Specify the app entry point class.
-->
<entry-point class='com.project.client.MainApplication'/>

<servlet path="/Application-status"
class="com.project.server.Management.ServerSQLServiceImpl"/
>



<!-- Specify the application specific style sheet.
-->
<stylesheet src='MainApplication.css' />

</module>


I'm sure i'm getting mixed up somewhere along the way. Please can
someone point out where I am going wrong.

Regards,
Jack

Isaac Truett

unread,
Mar 31, 2009, 2:07:45 PM3/31/09
to Google-We...@googlegroups.com
Jack,

Can you post the actual error message? I'm not sure if by "problems
finding my server classes" you mean a ClassNotFoundException, a 404
error, or something else entirely.

If it's a CNFE, did you compile your servlet and deploy it, along with
any supporting classes, in either WEB-INF/classes or WEB-INF/lib?

If it's 404, then you probably have a disconnect between your servlet
mapping and the URL you're actually requesting. In that case, post the
code where you call the RPC service, specfically where you set the
endpoint.

Nothing in the configuration files strikes me immediately as being wrong.

- Isaac
Message has been deleted

fatja...@googlemail.com

unread,
Mar 31, 2009, 2:32:14 PM3/31/09
to Google Web Toolkit
Hi,

Cheers for your reply. I can connect to my GWT application, it just
wont pick up any of the data on the server e.g. from MySQL.

The Tomcat error log is quite long so I have copied the first few
lines below:

1-Mar-2009 15:48:06 org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet Application-status as unavailable
31-Mar-2009 15:48:06 org.apache.catalina.core.ApplicationContext log
SEVERE: Error loading WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@54172f
com.project.server.Management.ServerSQLServiceImpl
java.lang.ClassNotFoundException:
com.project.server.Management.ServerSQLServiceImpl
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper.loadServlet
(StandardWrapper.java:1094)
at org.apache.catalina.core.StandardWrapper.allocate
(StandardWrapper.java:808)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447)
at java.lang.Thread.run(Unknown Source)
31-Mar-2009 15:48:06 org.apache.catalina.core.StandardWrapperValve
invoke
SEVERE: Allocate exception for servlet Application-status
java.lang.ClassNotFoundException:
com.project.server.Management.ServerSQLServiceImpl
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper.loadServlet
(StandardWrapper.java:1094)
at org.apache.catalina.core.StandardWrapper.allocate
(StandardWrapper.java:808)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447)
at java.lang.Thread.run(Unknown Source)


Can you spot anything wrong?

Regards,
Jack

On Mar 31, 7:07 pm, Isaac Truett <itru...@gmail.com> wrote:
> Jack,
>
> Can you post the actual error message? I'm not sure if by "problems
> finding my server classes" you mean a ClassNotFoundException, a 404
> error, or something else entirely.
>
> If it's a CNFE, did you compile your servlet and deploy it, along with
> any supporting classes, in either WEB-INF/classes or WEB-INF/lib?
>
> If it's 404, then you probably have a disconnect between your servlet
> mapping and the URL you're actually requesting. In that case, post the
> code where you call the RPC service, specfically where you set the
> endpoint.
>
> Nothing in the configuration files strikes me immediately as being wrong.
>
> - Isaac
>
> On Tue, Mar 31, 2009 at 11:07 AM, fatjack1...@googlemail.com
Message has been deleted

Isaac Truett

unread,
Mar 31, 2009, 2:54:30 PM3/31/09
to Google-We...@googlegroups.com
On Tue, Mar 31, 2009 at 2:44 PM, fatja...@googlemail.com
<fatja...@googlemail.com> wrote:
...
> java.lang.ClassNotFoundException:
> com.project.server.Management.ServerSQLServiceImpl
...

> On Mar 31, 7:07 pm, Isaac Truett <itru...@gmail.com> wrote:
...

>> If it's a CNFE, did you compile your servlet and deploy it, along with
>> any supporting classes, in either WEB-INF/classes or WEB-INF/lib?
...

- Isaac

fatja...@googlemail.com

unread,
Mar 31, 2009, 5:42:05 PM3/31/09
to Google Web Toolkit
Hi,

I have placed my server classes directly in the WEB-INF folder. So the
directory reads: WEB-INF\com\project\server

Have I placed the server files in the wrong folder?

Also, what is the correct way to compile the server files? I tried
using javac but it produced 67 errors. I therefore just used the files
found directly in the Src folder (e.g. the ServerSQLServiceImpl.class)

Regards,
Jack


On Mar 31, 7:54 pm, Isaac Truett <itru...@gmail.com> wrote:

Thomas Broyer

unread,
Mar 31, 2009, 6:29:44 PM3/31/09
to Google Web Toolkit


On 31 mar, 23:42, "fatjack1...@googlemail.com"
<fatjack1...@googlemail.com> wrote:
> Hi,
>
> I have placed my server classes directly in the WEB-INF folder. So the
> directory reads: WEB-INF\com\project\server
>
> Have I placed the server files in the wrong folder?

Yes, it should be WEB-INF/classes/com/project/server (but people tend
to JAR the classes and put the jar in WEB-INF/lib)

fatja...@googlemail.com

unread,
Mar 31, 2009, 7:41:08 PM3/31/09
to Google Web Toolkit
Hi,

I have done this and now get a different error. This has changed from
the other error in that it now says java.lang.ClassNotFoundException:
com.project.client.ServerStatusSQLService. This class is on the client
and so am I right in thinking it should have been compiled by GWT? Can
anyone suggest a reason as to why this would not have worked? FYI this
class extends the com.google.gwt.user.client.rpc.RemoteService


01-Apr-2009 00:29:59 org.apache.catalina.core.StandardWrapperValve
invoke
SEVERE: Allocate exception for servlet Application-status
java.lang.ClassNotFoundException:
com.project.client.ServerStatusSQLService
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal
(WebappClassLoader.java:1847)
at org.apache.catalina.loader.WebappClassLoader.findClass
(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1354)
01-Apr-2009 00:29:59 org.apache.catalina.core.StandardWrapperValve
invoke
SEVERE: Allocate exception for servlet Application-status
java.lang.ClassNotFoundException:
com.project.client.ServerStatusSQLService
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass
(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)

Radek Jun

unread,
Apr 1, 2009, 4:38:24 AM4/1/09
to Google Web Toolkit
It is a little bit weird :(. Are you sure that you have all the
classes right in the WEB-INF/classes and libraries in WEB-INF/lib ?

On Apr 1, 1:41 am, "fatjack1...@googlemail.com"

fatja...@googlemail.com

unread,
Apr 1, 2009, 5:23:30 AM4/1/09
to Google Web Toolkit
I have only placed the server and database packages in the WEB-INF/
classes folder i.e. I did not place the client package or the public
package in here. Is this wrong?

Regards,
Jack

Isaac Truett

unread,
Apr 1, 2009, 8:16:22 AM4/1/09
to Google-We...@googlegroups.com
Yes, it's wrong. Your servlet implements the ServerStatusSQLService
interface, so that class has to be deployed with the server classes.

fatja...@googlemail.com

unread,
Apr 1, 2009, 8:48:55 AM4/1/09
to Google Web Toolkit
Hi there,

Thanks for your help. That has fixed my last problem, now I am getting
a new one...

01-Apr-2009 13:38:15 org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract com.project.client.ServerSQLData
com.project.client.ServerStatusSQLService.getSQLData()' threw an
unexpected exception: java.lang.NullPointerException
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure
(RPC.java:360)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:546)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:164)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at
com.project.server.Management.ServerStartupData.setCategoryArrayList
(ServerStartupData.java:60)
at com.project.server.Management.ServerSQLServiceImpl.getSQLData
(ServerSQLServiceImpl.java:1225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
... 16 more
01-Apr-2009 13:38:15 org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract com.project.client.ServerSQLData
com.project.client.ServerStatusSQLService.getSQLData()' threw an
unexpected exception: java.lang.NullPointerException
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure
(RPC.java:360)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:546)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:164)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at
com.project.server.Management.ServerStartupData.setCategoryArrayList
(ServerStartupData.java:60)
at com.project.server.Management.ServerSQLServiceImpl.getSQLData
(ServerSQLServiceImpl.java:1225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
... 16 more


On Apr 1, 1:16 pm, Isaac Truett <itru...@gmail.com> wrote:
> Yes, it's wrong. Your servlet implements the ServerStatusSQLService
> interface, so that class has to be deployed with the server classes.
>
> On Wed, Apr 1, 2009 at 5:23 AM, fatjack1...@googlemail.com

Isaac Truett

unread,
Apr 1, 2009, 8:57:31 AM4/1/09
to Google-We...@googlegroups.com
And what have you done so far to try to solve this problem?

fatja...@googlemail.com

unread,
Apr 1, 2009, 9:54:25 AM4/1/09
to Google Web Toolkit
I have managed to fix this problem. It turned out that the MySQL JAR
had been removed.

Thanks for all your help!

Regards,
Jack

On Apr 1, 1:57 pm, Isaac Truett <itru...@gmail.com> wrote:
> And what have you done so far to try to solve this problem?
>
> On Wed, Apr 1, 2009 at 8:48 AM, fatjack1...@googlemail.com
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages