Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 717165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:22:53+00:00 2026-05-14T05:22:53+00:00

I’m playing with the project ap pengine-rest-server to create the REST webservices for all

  • 0

I’m playing with the project appengine-rest-server to create the REST webservices for all the existing models. I got a strange error, the first time I query the browser: http://localhost:8080/rest/metadata/user, it gives me the result:

      <xs:schema>
      −
      <xs:element name="user">
      −
      <xs:complexType>
      −
      <xs:sequence>
      <xs:element maxOccurs="1" minOccurs="0" name="key" type="xs:normalizedString"/>
      <xs:element maxOccurs="1" minOccurs="0" name="surname" type="xs:string"/>
      <xs:element maxOccurs="1" minOccurs="0" name="firstname" type="xs:string"/>
      <xs:element maxOccurs="1" minOccurs="0" name="ages" type="xs:long"/>
      <xs:element maxOccurs="1" minOccurs="0" name="sex" type="xs:boolean"/>
      <xs:element maxOccurs="1" minOccurs="0" name="updatedDate" type="xs:dateTime"/>
      <xs:element maxOccurs="1" minOccurs="0" name="createdDate" type="xs:dateTime"/>
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:schema>

But refreshing the page, gives me this error:

  Traceback (most recent call last):
    File "/Users/foo/Documents/AppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 3185, in _HandleRequest
      self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
    File "/Users/foo/Documents/AppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 3128, in _Dispatch
      base_env_dict=env_dict)
    File "/Users/foo/Documents/AppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 515, in Dispatch
      base_env_dict=base_env_dict)
    File "/Users/foo/Documents/AppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2387, in Dispatch
      self._module_dict)
    File "/Users/foo/Documents/AppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2297, in ExecuteCGI
      reset_modules = exec_script(handler_path, cgi_path, hook)
    File "/Users/foo/Documents/AppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2195, in ExecuteOrImportScript
      script_module.main()
    File "/Users/foo/Documents/AppEngine/helloworld/main.py", line 48, in main
      rest.Dispatcher.add_models({"user": UserModel})
    File "/Users/foo/Documents/AppEngine/helloworld/rest/__init__.py", line 845, in add_models
      cls.add_model(model_name, model_type)
    File "/Users/foo/Documents/AppEngine/helloworld/rest/__init__.py", line 863, in add_model
      raise KeyError("name %s already used" % model_name)
  KeyError: 'name user already used'

Can someone give me the explanation on why it happens? Restarting the server, run on the browser again I get the xml result, but refreshing causes the error. Is it a bug in the appengine-rest-server application or it is in my code? My helloworld application is available for download here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:22:54+00:00Added an answer on May 14, 2026 at 5:22 am

    Since you have a main() function, the App Engine caches your module and imports. Hence within the same runtime, you may call add_models() more than once. If you move the rest initialization code to module level (or into a function that gets called once during module initialization, not during every call to main()) it should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
i want to parse a xhtml file and display in UITableView. what is the
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.