- JAX-RS(の参照実装であるJersey) をなんとなく一通り使えるようにする
- GAE/J SE で動く
MIT
License: MIT License
config.getInitParameter 関連のやつとか?
今どうせ確認だからとFirebaseAdminSDK用のjsonまでrepository管理下にあるが…
その辺を別途取り出せるようにしておきたい(し、環境別に値を切り替えたい?)
HTTP/1.1 500 Internal Server Error
X-Cloud-Trace-Context: 992e150733b9f4de5feb331a74ed7102;o=1
Date: Mon, 03 Jul 2017 14:06:48 GMT
Content-Type: text/html; charset=UTF-8
Server: Google Frontend
Content-Length: 323
Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,36,35"
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>500 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered an error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>
これどうすれば良いんだろうな?
まさかidle instance 1にしろってことはないだろうし…(実際にこのリクエストを受けて一回立ち上がり、その後普通に動いているわけだし)
ContainerRequestFilter
を使って実装して動かすSlf4j + logback 的な構成のサンプルあるかなー?
例としてError時のBodyをJsonとするようなMapperを用意している。
curl -i -X POST -d '{"c":1, "b":"hoge"}' -H 'Content-Type: application/json' https://hello-jaxrs-dot-semiotic-karma-172203.appspot.com/hello_jso
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Cloud-Trace-Context: 1b24c26d71a809feb822830a254df7b6;o=1
Date: Mon, 03 Jul 2017 14:07:08 GMT
Server: Google Frontend
Content-Length: 196
Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,36,35"
{"status_code":404,"status_type":"CLIENT_ERROR","message":"Not Found","for_developer":{"message":"HTTP 404 Not Found","path":"https://hello-jaxrs-dot-semiotic-karma-172203.appspot.com/hello_jso"}}
これはわかる。想定通り。
curl -i -X POST -d '{"c":1, "b":"hoge"}' -H 'Content-Type: application/json' https://hello-jaxrs-dot-semiotic-karma-172203.appspot.com/hello_json
HTTP/1.1 400 Bad Request
Content-Type: text/plain
X-Cloud-Trace-Context: 52b88346333facebdc8f401203145ba6
Date: Mon, 03 Jul 2017 14:08:23 GMT
Server: Google Frontend
Content-Length: 312
Unrecognized field "c" (class com.example.sample.RequestBody), not marked as ignorable (2 known properties: "a", "b"])
at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@65de26b8; line: 1, column: 20] (through reference chain: com.example.sample.RequestBody["c"])
なんでPlanTextなんだろうな?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.