Jersey 用の LoggingFilter を作成し、web.xml で正しく構成しました。すべて正常に動作します。「GET」を実行すると、userPrincipal (request.getUserPrincipal()) が取得されますが、POST の場合は null が返されます。私は Websphere の Java 1.4 でいくつかの REST サービスを作成しており、常に userPrincipal にアクセスできましたが、Tomcat/1.6 では上記のようになりました。私は基本認証を使用しています。ジャージーはこれをやっていますか?それともトムキャット?
<security-constraint>
<web-resource-collection>
<web-resource-name>Lookup Resources</web-resource-name>
<description>A set of secured resources.</description>
<url-pattern>/rest/lookup/*</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>DataServ_Lookup</role-name>
<role-name>DataServ_Admin</role-name>
</auth-constraint>
<!-- Comment this out for Dev. It is a MUST for Prod...
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>-->
</security-constraint>