This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Other Java Products and Servers and the fly likes Does Google app engine doesn't support Struts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Does Google app engine doesn Watch "Does Google app engine doesn New topic
Author

Does Google app engine doesn't support Struts?

Amey Desai
Greenhorn

Joined: Jun 12, 2006
Posts: 1
Hi,

Does Google app engine doesn't support Struts? If the answer is NO then can anybody share across his or her experience in making it a success.

Thanks,
rdesai
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

I am using Struts with the Google App engine and it works fine for me! What is the problem that you are facing while using struts on the app engine?


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
raghav prakasam
Greenhorn

Joined: Jun 29, 2009
Posts: 23
Hi,

shall we use struts 1.x.x with google app engine?Can any body privide a good docs or sample GAE application with struts?.


Thankyou,
Raghav
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

You can use any Java Framework with GAE. Deploying a struts application on the GAE is no different than deploying it on any other server.
raghav prakasam
Greenhorn

Joined: Jun 29, 2009
Posts: 23
Hi Sam Mercs,

Thank you For your reply.I included struts(1.2) in side an existing GAE application and i can land on the home page.When ever i clicked on the link in the home page which gives a struts call,am getting some error as below in my log.txt file.


61.246.237.226 - - [26/Jun/2009:03:30:19 -0700] "GET /strutstest HTTP/1.1" 500 0 "http://1.latest.raghav-struts.appspot.com/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe)"
61.246.237.226 - - [26/Jun/2009:03:30:10 -0700] "GET /strutstest HTTP/1.1" 500 0 "http://1.latest.raghav-struts.appspot.com/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe)"
61.246.237.226 - - [26/Jun/2009:03:30:07 -0700] "GET /favicon.ico HTTP/1.1" 404 0 - "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe)"
61.246.237.226 - - [26/Jun/2009:03:30:04 -0700] "GET /favicon.ico HTTP/1.1" 404 0 - "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe)"
61.246.237.226 - - [26/Jun/2009:03:30:03 -0700] "GET / HTTP/1.1" 200 794 "http://appengine.google.com/deployment?&app_id=raghav-struts" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe)"

Can any one help on this Issue?

Thanks,

Raghav
raghav prakasam
Greenhorn

Joined: Jun 29, 2009
Posts: 23
Hi ,

I added a context listener to make "OgnlRuntime.setSecurityManager(null)".And still am getting the same error.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

The information you posted isn't enough to pinpoint the problem. What happens when you try out the code locally? Have you included the necessary Struts Jar files in the WEB-INF/lib folder?
raghav prakasam
Greenhorn

Joined: Jun 29, 2009
Posts: 23
Hi ,

Yes I have included the struts jar files too..And i have mentioned the location on struts-config in web.xml as "/war/WEB-INF/struts-config.xml"


now i changed to "/WEB-INF/struts-config.xml".And am now getting following logs

61.246.237.226 - - [29/Jun/2009:04:09:49 -0700] "GET /Startup.do HTTP/1.1" 500 0 "http://2.latest.raghav-struts.appspot.com/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe)"
61.246.237.226 - - [29/Jun/2009:04:09:43 -0700] "GET / HTTP/1.1" 200 795 "http://appengine.google.com/deployment?app_id=raghav-struts" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe)"

Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

I repeat myself,

The information you posted isn't enough to pinpoint the problem. What happens when you try out the code locally? Have you included the necessary Struts Jar files in the WEB-INF/lib folder?
raghav prakasam
Greenhorn

Joined: Jun 29, 2009
Posts: 23
Hi,

I didnt try out locally coz once i start the server ,i cant stop or shutdown it.And i have included the necessary Struts Jar files in the WEB-INF/lib folder.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

Without more information there isn't really much help that can be provided.
All the log file says is a '500' error which basically means that the server has encountered an error. You might have to dig deeper into the logs or try the code locally and see the detailed error.
raghav prakasam
Greenhorn

Joined: Jun 29, 2009
Posts: 23
Hi,

If i start the server locally through GAE ,it listens to the port 8080.But i can restart or stop it any more.How can i stop or restart the server again?
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

I did face the same problem.

To stop the GAE server this is what I do.

1. Keep the console and Debug view windows open.
2. You can stop the GAE server in the console by closing the running Java application.
3. Sometimes due to other messages on the console - its not possible to stop GAE from the console. In this case you can stop the GAE server by stopping the running Java process in the Debug view.

Hope this helps. Of course if everything fails you can always re-start eclipse - at least might get you some info on why the application is giving a 500 error!
raghav prakasam
Greenhorn

Joined: Jun 29, 2009
Posts: 23
Hi,

It works fine but not for all the time .It s a very good solution.And i resolved my error.We can have only one <servlet> in web.xml.If i keep another ,it shows an error.I dont know why they restrict like this.Thanks For your solution.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

Its good to know that your problem is resolved.

But I am absolutely sure that you can have as many <servlet> tags as you need in the Web.xml. Probably something else going wrong!!!
raghav prakasam
Greenhorn

Joined: Jun 29, 2009
Posts: 23
Yes.I too think like that.Let me try again and wil let you know soon.
raghav prakasam
Greenhorn

Joined: Jun 29, 2009
Posts: 23
Hi sam,

Its working fine.But i amazed why i have faced the similar problem earlier.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

Loads of reasons -
Maybe you copy pasted and non-ASCII character got copied
Maybe the Web.xml was not well formed - you know a closing tag missing here or there.
Maybe the XML was not as per the DTD - the tags were not positioned right or incorrectly nested.

Lots of possibles Maybe - can't be sure. Its just one of those things that happens in computers all the time - Maybe just a Heisenbug
Dennis Gajudo
Greenhorn

Joined: Mar 07, 2004
Posts: 2
Google App Engine supports Struts2.

You need to download the latest release of Struts framework (struts-2.1.8-lib.zip for example) and add these libraries to war/WEB-INF/lib and in Java Build Path (in case your using Google plugin for Eclipse) in your GAE Project :

commons-fileupload-1.2.1
commons-io-1.3.2
commons-logging-1.0.4
freemarker-2.3.15
ognl-2.7.3
struts2-core-2.1.8
xwork-core-2.1.6

here's the link for the step by step procedure on how to integrate Struts 2 in Google App Engine:
http://infotechden.blogspot.com/2009/10/struts-2-on-google-app-engine.html

regards!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Does Google app engine doesn't support Struts?