I uncovered the error as an extremely simple mistake in my servlet
location naming convention which was causing nothing to be run, and no
errors to be printed. Why is it that Tomcat doesn't log when an item/
servlet is requested which doesn't exist lol? GWT detects this error
when your running in normal/hosted mode. Would have made this mistake
so much clearer. It was the difference between /albumUpload and /
AlbumUpload in the web.xml and project.gwt.xml lol.

Your other comments have been massively helpful, and despite having
read in tutorials and on other posts here that getting HTTPServlets to
run with RPCServlets is tricky, I have to agree with yourself and say
there isn't any trick to it other than having a good solid
configuration in place.

Thanks again :) I had spent at least 100 hours trying to track down
the issues in running this and never thought to double check
capitalisation.

On Mar 12, 7:28 pm, Isaac Truett <[email protected]> wrote:
> On Thu, Mar 12, 2009 at 3:01 PM, Feltros <[email protected]> wrote:
>
> > Oh no sorry when I said the rather peculiar way, its the same peculiar
> > way you have to do it in GWT - as in you create a 'form' with the
> > target of your form-receiving-servlet (In my case
> > AlbumUploadController) which has some subelements which are fileupload
> > boxes. The implementation would be exactly the same in GWT and both
> > were tested. Didn't even mean to mention GXT lol :P I only said
> > 'peculiar' because its not the normal way you'd reference a servlet
> > which responded to a GET activity like /returnPictures?
> > img="someimg.jpg" or the way you use RPCServlets.
>
> Oh, well. Can't always get away with a simple
> blame-the-third-party-library. Just to narrow things down a bit, is
> the form is actually being submitted? Firebug's useful for checking
> that sort of thing, if you develop with Firefox.
>
> > A few questions to yourself then if you wouldn't mind assisting me in
> > a few things?
>
> Not at all.
>
> > When creating your war do you leave your front end bits in the www/
> > com.Blah.blah/ directory, or do you move them to the root of the WAR
> > file for simpler URL's? (This isn't perhaps related to my error but
> > i'd be interested to know if the location of the front end has a
> > bearing on how you should call server side bits and where it should
> > 'properly' be).
>
> Yes, I rebase everything to the web root. It does make it easier to
> keep track of what each URL is relative to.
>
> > In any of the HTTPServlets you run how do you handle errors? Are they
> > thrown for Tomcat to deal with, do you catch them and do
> > error.printStackTrace() or do you handle them some other way to get
> > them to end up in the logs?
>
> My current approach:
>
> I catch declared exceptions and log them (java.util.logging, or your
> preference of logger). Not every exception is a dire emergency, of
> course, so a lot of benign things like a request for an invalid record
> ID might be logged at INFO level or lower. For routine errors like
> that, I'll set the HTTP status (404 seems appropriate for an "ID not
> found" scenario) and leave it at that. For something worse (gee,
> suddenly I can't find the database) I'll throw a new ServletException
> with an appropriate message (but not including the original exception,
> since I've already logged that).
>
> > Thanks kindly for your help :)
>
> You're welcome.
>
>
>
> > On Mar 12, 6:48 pm, Isaac Truett <[email protected]> wrote:
> >> > If anyone knows of any examples of a project with an RPCServlet and
> >> > HTTPServlet (Any kind, a picture server, a file upload receiver, etc)
> >> > running in conjunction on the server side and they both print their
> >> > logs in Tomcat WAR deployment correctly that would be extraordinarily
> >> > fantastic.
>
> >> Yes, it can be done. I've done it in a couple of different projects.
> >> Unfortunately, no, it's not something I can point you to as an
> >> example. But there really isn't anything tricky about it.
>
> >> You mentioned GXT; have you tried writing a simple test without GXT?
> >> It seems quite likely that GXT is part of your problem, especially
> >> given "the rather peculiar way you have to do with file uploading in
> >> GXT" to which you refer. Have you searched a GXT forum for information
> >> about this problem?
>
> >> On Thu, Mar 12, 2009 at 2:34 PM, Feltros <[email protected]> wrote:
>
> >> > I have read several posts that seem to be explaining a problem similar
> >> > to my own and yet it is constantly misinterpreted and so the replies
> >> > are somewhat useless. I will attempt to explain the problem as clearly
> >> > as possible:
> >> > I have 2 server classes,
> >> > AlbumUploader extends HTTPServlet
> >> > ServerImpl extends RemoteServiceServlet
>
> >> > In deploying these items on tomcat I have the following web.xml
> >> > entries:
> >> > <servlet>
> >> >        <servlet-name>Server</servlet-name>
> >> >        <servlet-class>com.BTI.main.server.ServerImpl</servlet-class>
> >> > </servlet>
> >> > <servlet-mapping>
> >> >        <servlet-name>Server</servlet-name>
> >> >        <url-pattern>/service</url-pattern>
> >> > </servlet-mapping>
>
> >> > <servlet>
> >> >        <servlet-name>AlbumUpload</servlet-name>
> >> >        <servlet-class>com.BTI.main.server.AlbumUpload</servlet-class>
> >> > </servlet>
> >> > <servlet-mapping>
> >> >        <servlet-name>AlbumUpload</servlet-name>
> >> >        <url-pattern>/AlbumUpload</url-pattern>
> >> > </servlet-mapping>
>
> >> > Which seems to work fine (If I go to mydeploymentplace/AlbumUpload it
> >> > complains that it won't take a get data input - which is correct
> >> > because it only accepts post data).
>
> >> > Now my problem is that when I use the AlbumUploader (Which being a
> >> > file upload receiver is called in the rather peculiar way you have to
> >> > do with file uploading in GXT) it returns absolutely fine - almost
> >> > instantly. No file is uploaded, no error is returned, no logs are
> >> > written and clearly that AlbumUploader either - hasn't run whatsoever
> >> > - or returned null instantly without this being logged as an error.
>
> >> > It would appear that I can't run a HTTPServlet in conjunction with an
> >> > RPCServlet?
>
> >> > Do I need to deploy these to different projects on my Tomcat server?
> >> > Is there some special key in the web.xml file to make these work
> >> > properly? How can I get this to write an error into one of the logs?
> >> > Where does System.out.println/System.err.println print to when your
> >> > running a HTTPServlet. If I am running the HTTPServlets and
> >> > RPCServlets in seperate projects deployed on the same server are they
> >> > going to be accessible to me on the front end still?
>
> >> > If anyone knows of any examples of a project with an RPCServlet and
> >> > HTTPServlet (Any kind, a picture server, a file upload receiver, etc)
> >> > running in conjunction on the server side and they both print their
> >> > logs in Tomcat WAR deployment correctly that would be extraordinarily
> >> > fantastic.- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to