Tag Archives: Development environment

[Solved] MybatisPlus Error: Error querying database. Cause: java.lang.IndexOutOfBoundsException

Cause: java.lang.IndexOutOfBoundsException” error when testing after using mybatisplus to generate code changes.

Using mybatis-plus code generation tool `@AllArgsConstructor` is not checked `@NoArgsConstructor` lombok annotation; in the resultSet session, can not find the appropriate object generation method to generate an exception, here for the record to find.

gunicorn.errors.HaltServer: HaltServer ‘App failed to load.’ 4

Error executing the following code while installing Gunicorn:

from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
    # return 'hello world'

if __name__ == '__main__':
    app.run(debug=True)

Use the command: Gunicorn WSGI: application-b 0.0.0.0.0:8000-w 2
Error message:

[2019-01-09 15:39:40 +0800] [29565] [INFO] Starting gunicorn 19.9.0
[2019-01-09 15:39:40 +0800] [29565] [INFO] Listening at: http://0.0.0.0:8000 (29565)
[2019-01-09 15:39:40 +0800] [29565] [INFO] Using worker: sync
[2019-01-09 15:39:40 +0800] [29568] [INFO] Booting worker with pid: 29568
[2019-01-09 15:39:40 +0800] [29570] [INFO] Booting worker with pid: 29570
Failed to find application object 'application' in 'wsgi'
[2019-01-09 15:39:40 +0800] [29568] [INFO] Worker exiting (pid: 29568)
Failed to find application object 'application' in 'wsgi'
[2019-01-09 15:39:40 +0800] [29570] [INFO] Worker exiting (pid: 29570)
Traceback (most recent call last):
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 203, in run
    self.manage_workers()
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 545, in manage_workers
    self.spawn_workers()
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 617, in spawn_workers
    time.sleep(0.1 * random.random())
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 245, in handle_chld
    self.reap_workers()
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 528, in reap_workers
    raise HaltServer(reason, self.APP_LOAD_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'App failed to load.' 4>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ejior/.virtualenvs/begin/bin/gunicorn", line 11, in <module>
    sys.exit(run())
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 61, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/app/base.py", line 223, in run
    super(Application, self).run()
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 232, in run
    self.halt(reason=inst.reason, exit_status=inst.exit_status)
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 345, in halt
    self.stop()
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop
    time.sleep(0.1)
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 245, in handle_chld
    self.reap_workers()
  File "/home/ejior/.virtualenvs/begin/lib/python3.6/site-packages/gunicorn/arbiter.py", line 528, in reap_workers
    raise HaltServer(reason, self.APP_LOAD_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'App failed to load.' 4>

 
Reason for error:
app = Flask(___)). This is defined as app. This should also be used in the command gunicorn-w 4-b 0.0.0.0.0:8000-k gevent wsgi:app.
 
 
 
 

Save file and exit command of vim

vim save file and exit command


collates VIM save and exit commands as follows:

1

3

4

5 6 ZZ8 vim9 9 0 vim1 editor 1 1 1 1 3

4 5 6 ZZ7 9 9 0 vim1 editor 0 Vim . Note that the ZZ command does not need to be preceded by a colon “:” or press the Enter key.

command

simple description

: w

save the edited content of the files, but don’t quit vim editor. The purpose of this command is to write the data from the memory buffer to the file specified when you start vim.

:w!

forced write files, or forced to cover the original file. You can use this command to force a write if the original file has access that does not allow writing to the file, for example, if the original file is read-only. However, this command usage applies only if the user is the owner of the file, not to the superuser.

: wq

to save the file content after exit vim editor. The purpose of this command is to write the data from the memory buffer to the file specified when you start vim, and then exit the vim editor. Another alternative is to use the ZZ command.

:wq!

exit after being forced to save the file content vim editor. The purpose of this command is to force the data from the memory buffer to the file specified when you start vim, and then exit the vim editor. ZZ1

: q

without doing any editing process and ready to quit vim , you can use this command.

No write since last change (:quit! overrides)

:q!

require a vim editor, give up the result of the editing process. If you really don’t need to save the contents of the modified file, type :q! “command, forced to exit vim editor.

: w filename

writes the editor after processing the results of the specified file save

: w! filename

0 compulsorily saves the edited result to the specified file, overwriting the existing file if the file already exists.

:wq! filename

0.