{"message":"Missing Authentication Token"}

POSTの場合、リクエストの投げ方が間違っているこういうエラーがでる。わかりにくい。

こうするとうまくいった

curl -H "Content-Type: application/x-www-form-urlencoded" -X POST -d '{"hoge":"123"}' https://aaaaaaaaaaa


参考
AWS API GatewayでContent-Type:application/x-www-form-urlencoded のPOSTデータを受け取り JSONに変換する - Qiita

java.lang.NoClassDefFoundError JaxbAnnotationIntrospector

はまり

[GLASSFISH-21141] Missing jackson-module-jaxb-annotations JAR causes error on first Jersey/Jackson JSON response - Java.net JIRA

A quick hack how I managed to overcome this on GlassFish Server Open Source Edition 4.1 (build 13):
0) stopped the server
1) downloaded and copied the jars below into glassfish4\glassfish\modules (version: 2.4.2 for all)
jackson-annotations.jar
jackson-core.jar
jackson-databind.jar
jackson-jaxrs-base.jar
jackson-jaxrs-json-provider.jar
jackson-module-jaxb-annotations.jar
2) deleted the osgi-cache: removed glassfish4\glassfish\domains\domain1\osgi-cache\felix
3) re-started the server

分散的にsqliteを扱う場合のパフォーマンスに関するメモ

巨大なSQLliteのDBをいくつかのDBに分けた場合のパフォーマンスに関するメモ。

結論:2つ以上のDBに交互にSELECT文を発行すると、そうでない場合に比べて10〜100倍くらい遅くなった。


最初に複数のDBコネクションを配列に入れる。

my @dbhs = qw();
for(my $take=$TAKE_MIN; $take<=$TAKE_MAX; $take++){
    my $path = sprintf($DB_PATH2, $take);
    my $data_source2 = "dbi:SQLite:dbname=$path";
    my $dbh2 = DBI->connect($data_source2);
    push(@dbhs, $dbh2);
}

で、SELECT文を各DBに交互に発行。

    my $sql2 = "SELECT * FROM tb WHERE uid=? LIMIT 1";
    for(my $take=$TAKE_MIN; $take<=$TAKE_MAX; $take++){
        my $rows2 = $dbhs[$take-1]->selectall_arrayref($sql2, { Slice => {} }, $uid);
        for my $row2 (@$rows2){
            my $uid2 = $row2->{uid};
        }
    }

1つのDBだけに比べて2つ以上の場合は、HDDのガリガリ音も激しく、またdstatでdiskのread/write両方ほとんど数値がでていなかったので、HDDのヘッドが激しく動きまくってそこがボトルネックになっているのではないかと予想。

同じクラス名は避けるべし

重大: Mapping conflict. A Servlet registration exists with same mapping as the Jersey servlet application, named jp.unko.hoge1.resources.MyApplication, at the servlet mapping, /rest/*. The Jersey servlet is not deployed.
重大: Mapping conflict. A Servlet registration exists with same mapping as the Jersey servlet application, named jp.unko.hoge2.resources.MyApplication, at the servlet mapping, /rest/*. The Jersey servlet is not deployed.

hoge1アプリケーションからhoge2の.jarに依存を張っていて、その両方に同じクラス名のクラスがあるとまずいっぽい。
あ クラス名ってより@Pathか