aspose file tools*
The moose likes Java in General and the fly likes Google App Engine + Simple Stripes web-app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Google App Engine + Simple Stripes web-app" Watch "Google App Engine + Simple Stripes web-app" New topic
Author

Google App Engine + Simple Stripes web-app

James Elsey
Ranch Hand

Joined: Dec 21, 2007
Posts: 228

Hello,

I have a very basic web application that uses the Stripes framework. I've set this up in Netbeans, and it runs perfectly fine locally on Glassfish v3.

My app consists of a few JSPs and a few actions that navigate through the various pages, nothing fancy at the moment.

I've followed the GAE documentation as provided on the google site, I have successfully run my application locally using the GAE server as included in the SDK, this works fine I can access my application on port 8080 no problem.

I've checked in my app to GAE (once again following their documentation) however this fails to run, I'm able to get the following from their logs



Am I missing something completely obvious? Could there be an issue with my code? It runs fine on the GAE server I have running locally, so I'm unsure of what would change

Many thanks


Kind Regards, James. OCPJP 1.6 || My SCJP / OCJCP Study Notes
Interested in : SCJP, Google App Engine, Stripes, Android;|| My Bite-Size SCJP Study Blog
James Elsey
Ranch Hand

Joined: Dec 21, 2007
Posts: 228

After some more searching, it appears there is one common issue with GAE and stripes

Stripes Framework
Version(s): ?
Status: COMPATIBLE

* The default multipartwrapper implementation needs a temporary directory on the local file system for file uploads, which App Engine doesn't allow. The workaround is to create your own implementation -- more details at http://groups.google.com/group/google-appengine-java/browse_thread/thread/81dbcf7cf2281014.


source

This leads onto some discussions of initialising the multipartWrapper : http://groups.google.com/group/google-appengine-java/browse_thread/thread/81dbcf7cf2281014

I'm not sure how to do that, can anyone please advise? I will continue to research and post any solutions I find

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42639
    
  65
If you don't need file uploads, then proceed as described in the last section of http://www.stripesframework.org/display/stripes/File+Uploads: implement MultipartWrapperFactory with an implementation that does nothing at all.

If you do need file uploads, then you'd also implement MultipartWrapperFactory (maybe by subclasssing DefaultMultipartWrapperFactory), but with an implementation that does not use temp directories. In that case you should use the Apache Commons FileUpload library, since that can be configured to not use files, but hold everything in memory. Or you can configure it to use a directory that does exist, and to which GAE allows access.


Ping & DNS - my free Android networking tools app
James Elsey
Ranch Hand

Joined: Dec 21, 2007
Posts: 228

Just for the record, I had to provide an empty implementation of MultipartWrapper and update my web.xml, as follows






I also wrote up what I had to do on my blog

Hopefully this will help others in the future ;)

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42639
    
  65
GAE has no support for uploading of files, so we use this to disable that part of Stripes

I'm fairly certain that's not correct. The way it looks to me is that GAE doesn't support file uploads the way they work by default in Stripes. But that can apparently be changed in the way I described.
James Elsey
Ranch Hand

Joined: Dec 21, 2007
Posts: 228

Sorry got that comment wrong, cheers for pointing it out I'll make a note to update my code

thanks Ulf,

J
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Google App Engine + Simple Stripes web-app