appengine-java-vm-runtime icon indicating copy to clipboard operation
appengine-java-vm-runtime copied to clipboard

javax.servlet.ServletException: was already commited (code=403). This might result in lost log messages

Open wangzilong opened this issue 9 years ago • 4 comments

When I add this in web.xml

<security-constraint>
        <web-resource-collection>
            <web-resource-name>rest</web-resource-name>
            <url-pattern>/rest/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

develop server always throw exception:

javax.servlet.ServletException: Response for request to '/rest/swagger.json' was already commited (code=403). This might result in lost log messages.'
[INFO]  at com.google.apphosting.vmruntime.jetty9.VmRuntimeWebAppContext.doScope(VmRuntimeWebAppContext.java:312)
[INFO]  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
[INFO]  at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
[INFO]  at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
[INFO]  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
[INFO]  at org.eclipse.jetty.server.Server.handle(Server.java:497)
[INFO]  at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
[INFO]  at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
[INFO]  at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
[INFO]  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
[INFO]  at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
[INFO]  at java.lang.Thread.run(Thread.java:745)

Please help me.

Thanks

wangzilong avatar Nov 22 '16 12:11 wangzilong

@wangzilong which environment are you using? Is it appengine standard, or compat? Do you have an app.yaml, and if so, do you have "env:flex" set? Do you have a custom docker file, if so, what is it based off?

janbartel avatar Nov 22 '16 22:11 janbartel

I use App Engine Flexible Environment I have no custom docker file. My app.yaml

runtime: java7
vm: True
manual_scaling:
  instances: 1
inbound_services:
- warmup
threadsafe: True
auto_id_policy: default
beta_settings:
  'machine_type': 'n1-standard-1'
  'source_reference': 'ssh://[email protected]:iDigiSign.git#5184d3e9af81f64882464e39ade45a20696fb5c4'
health_check:
  enable_health_check: True
api_version: '1.0'
handlers:
- url: (/rest/.*/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: always
- url: (/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/rest/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: always
- url: (/typings/.*/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/rest/.*\.html)
  static_files: __static__\1
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: always
- url: (/typings/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/js/.*/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/typings/.*)
  static_files: __static__\1
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/js/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/swagger/.*/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/js/.*)
  static_files: __static__\1
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/swagger/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/node_modules/.*/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/swagger/.*)
  static_files: __static__\1
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/node_modules/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/assets/.*/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/node_modules/.*)
  static_files: __static__\1
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/assets/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/app/.*/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/assets/.*)
  static_files: __static__\1
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/.*\.html)
  static_files: __static__\1
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/app/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/.*/)
  static_files: __static__\1index.html
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: (/app/.*)
  static_files: __static__\1
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: /rest
  script: unused
  login: optional
  secure: always
- url: /rest/.*
  script: unused
  login: optional
  secure: always
- url: /.*
  script: unused
  login: optional
  secure: optional

wangzilong avatar Nov 23 '16 15:11 wangzilong

@wangzilong Please try replacing vm: True with env: flex. Also, unless Java 7 is a requirement for you, please change runtime: java7 to runtime: java.

meltsufin avatar Nov 23 '16 16:11 meltsufin

I can not test on flexible environment. Because Objectify be used in my project. Project throw " java.lang.NullPointerException: No API environment is registered for this thread."

wangzilong avatar Dec 01 '16 11:12 wangzilong