Upload .war file to Google app engine (GAE) using appcfg - google-app-engine

Out of curiosity, Is it possible to upload single .war file generated by maven to Google app engine using the tool appcfg.(/cmd/sh)?
I tried but got errors, when I specify the exploded directory (directory that contains gwt files) as the path, it worked.
Would be nice to specify single archive (.war) for upload as path to appcfg tool.
Please let me know if you have been able to do this or whether it's even supported.
Cheers
PB

The Google App Engine makes no provision for uploading a single .war file.
Since a war/ folder necessarily precedes the creation of a .war archive (since a .war archive is simply a zipped up war/ directory) obtaining the war/directory is provably easier than obtaining a .war file.
Perhaps you are used to tomcat where you can just deploy a .war file through the admin interface. When tomcat receives that file, all it does is extract it under webapps/. I suspect that GAE fiddles with the contents of your war/ a bit before it is actually uploaded to them anyway. If you provide more information about why you want to do this, perhaps we can discover the source of your confusion.

Related

What is the easiest way to push a file on the GCP AppEngine?

To verify the ownership of a domain to a mail service, I need to put a file with a specific name for verification. Is there a better way than pushing it into my app source repository?
For security reasons you would have to put the file in your source and do a deployment to App Engine. If you’ve worked with a traditional web server in the past where you basically dump files into a folder and serve them this will be a bit of a change. The App Engine files are going to execute only. If you want to get in to adding other files on the fly you would need a Cloud Storage Bucket, but I don’t think that will do it for your domain verification.

Uploading a data file to my Google app engine app

How may I upload a data file to my Google app engine folder using any standard file transfer protocol e.g. SFTP, WebDav etc.?
This is so I can use a regular desktop file transfer client
So far the only ways I've found are Google proprietary, and web form upload.
GAE's filesystem is readonly, i.e. you can't really make changes to any of the files once the app is deployed.
You can upload your files to GCS by mounting a bucket as a local directory but as you noted that option doesn't seem to be available on Windows.
You could also use gsutil to transfer files to/from the bucket, like that: gsutil cp *.txt gs://my-bucket, even on Windows (see more details here) but if you want a GUI client - just google for gui clients for gcs, many storage browsers i.e. more or less advanced ftp clients seem to support it (see for example Cyberduck, CrossFTP, etc).

How do I refresh resources folder of web application?

I'm developing a web application in which I want to insert users and be able to display files that they upload via a search option. I can get all of the logic that I need sorted and the files uploaded into the correct directory. However, if I insert a new user into the db, the web app cannot find their file in the directory until I restart the server.
How can I make it so that the resources directory of my web app automatically gets refreshed by the server? I'm developing in Java/JSP and using Tomcat as my server.
Thanks!!
I'm guessing you're putting the files into the src/main/resources folder, then it's being packaged into the artifact and then you access them as the classpath resources. Then the next portion of the resources is going to be available after the next packaging.
Instead you should access the Files via usual File System and Absolute or Relative paths.

Datastore Location with Google App Engine / Java

How can I customize the location of the datastore file while working with GAE/J.
The option --datastore_path doesn't seem to work with GAE/J.
And if it is possible, what option do I use in the maven-gae-plugin.
I assume you mean while running the dev app server locally. Try the --generated_dir option with <sdk>/bin/dev_appserver.sh:
--generated_dir=dir Set the directory where generated files are created.
The generated files include the local datastore file.

Deployment of static directory contents to google app engine

I've deployed my first GAE application and I am getting "TemplateDoesNotExist" exception at my main page. It feels like my static directory content is not uploaded to GAE.
Isn't it possible that I update (appcfg.py update myapp/) all my files including the static ones and run it standalone on myappid.appspot.com ?
by the way here you can see the problem:
http://pollbook.appspot.com
PS: my app works perfect locally
Your templates should not be stored in a directory that you refer to as "static" in app.yaml. Static directories are for literally static files that will be served to end users by the CDN without changing. These files cannot be read by the templating engine. It works locally because the dev_appserver does not precisely emulate the production server.
Put your templates in a different directory like /templates or something. You do not need to refer to this directory in your app.yaml.

Resources