Adding the address command-line argument to the Java Development Server causes error when uploading blobs

327 Views Asked by At

I have a Google App Engine (GAE) application running on Java with Eclipse. I wish to access the development server from other computers on the same LAN, so I added the --address=0.0.0.0 (or -a 0.0.0.0) command-line argument when running it locally on Eclipse.

After adding this argument, however, I can no longer upload datastore entities that contain a blob. When I try to upload a blob using the BlobstoreService.createUploadUrl() method I get Error 401 on my browser. The upload works fine when I don't add the address argument to the server.

This is how my HTML form looks like in the JSP file where I perform the upload:

<form method="post" id="form1" name="form1"
action="<%= blobstoreService.createUploadUrl("/servletName") %>"
enctype="multipart/form-data">

Extra note:

Before adding the address argument, the HTML source displayed by the browser looked like this in the createUploadUrl portion:

action="http://localhost:8888/_ah/upload/agpzbWFzcnYtcG9zciILEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YgICAgICA6AkM"

After adding that argument, the code displayed by the browser looked like this:

action="http://Lenovo-PC:8888/_ah/upload/agpzbWFzcnYtcG9zciILEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YgICAgICA6AkM"

(it used the hostname of my computer instead of the localhost keyword)

1

There are 1 best solutions below

2
On

It could be your IP configuration or host name resolution. What OS are you running? The Lenovo-PC name suggests Windows. The 0.0.0.0 address in the download URL might be unworkable too. Can you ping 0.0.0.0? If you have a stable IP address, replace the 0.0.0.0 with that.