{"id":153,"date":"2010-11-28T14:11:49","date_gmt":"2010-11-28T05:11:49","guid":{"rendered":"http:\/\/ec2-52-35-32-26.us-west-2.compute.amazonaws.com\/blog\/2010\/11\/28\/20101128141149\/"},"modified":"2010-11-28T14:11:49","modified_gmt":"2010-11-28T05:11:49","slug":"20101128141149","status":"publish","type":"post","link":"http:\/\/daimlars.jp\/blog\/?p=153","title":{"rendered":"EJB\u4f8b\u5916"},"content":{"rendered":"<p>\u8077\u5834\u3067\u8b70\u8ad6\u304c\u3042\u3063\u305f\u306e\u3067\u6574\u7406\u3057\u3066\u30e1\u30e2\u3002\u3002\u3002<\/p>\n<\/p>\n<p><a title=\"\u30de\u30b9\u30bf\u30ea\u30f3\u30b0JavaEE5\" href=\"http:\/\/daimlars.jp\/2010\/09\/20\/%e3%83%9e%e3%82%b9%e3%82%bf%e3%83%aa%e3%83%b3%e3%82%b0javaee5\/\">\u672c<\/a>\u3092\u898b\u308b\u3068<\/p>\n<blockquote><p>\u30c1\u30a7\u30c3\u30af\u4f8b\u5916<\/p>\n<p>Exception\u62e1\u5f35\u3002<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%C8%A5%E9%A5%F3%A5%B6%A5%AF%A5%B7%A5%E7%A5%F3\">\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3<\/a>\u3092\u539f\u5247<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%ED%A1%BC%A5%EB%A5%D0%A5%C3%A5%AF\">\u30ed\u30fc\u30eb\u30d0\u30c3\u30af<\/a>\u3057\u306a\u3044\u3002\u3055\u305b\u305f\u3044\u5834\u5408\u306f\u3001setRollbackOnly\u3067\u30de\u30fc\u30ad\u30f3\u30b0\u304c\u5fc5\u8981\u3002<\/p>\n<p>\u975e\u30c1\u30a7\u30c3\u30af\u4f8b\u5916<\/p>\n<p>RuntimeException\u62e1\u5f35\u3002\u30ed\u30fc\u30ab\u30eb<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a>\u547c\u3073\u51fa\u3057\u306e\u5834\u5408\u306fEjbException\u3092\u3001\u30ea\u30e2\u30fc\u30c8<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a>\u547c\u3073\u51fa\u3057\u306e\u5834\u5408\u306f\u3001RemoteException\u306b\u3066\u30e9\u30c3\u30d7\u3057\u3066\u5fdc\u7b54\u3092\u8fd4\u3059<\/p><\/blockquote>\n<p>\u3068\u3042\u308b\u3002<a title=\"EJB \u4f8b\u5916\u3092\u51e6\u7406\u3059\u308b\" href=\"http:\/\/otndnld.oracle.co.jp\/document\/products\/workshop\/docs81\/doc\/ja_JP\/core\/index.html\">Oracle\u306e\u30da\u30fc\u30b8<\/a>\u3067\u306f<\/p>\n<blockquote><p>\u30c1\u30a7\u30c3\u30af\u6e08\u307f\u4f8b\u5916<\/p>\n<p>\u5bfe\u8c61\u3068\u306a\u308b <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a> \u306e<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%E1%A5%BD%A5%C3%A5%C9\">\u30e1\u30bd\u30c3\u30c9<\/a>\u304c\u30c1\u30a7\u30c3\u30af\u6e08\u307f\u4f8b\u5916 (RuntimeException\u00a0\u3092\u62e1\u5f35\u3057\u306a\u3044\u4f8b\u5916) \u3092\u9001\u51fa\u3059\u308b\u5834\u5408\u306f\u3001\u305d\u306e\u4f8b\u5916\u3092 try-catch \u30d6\u30ed\u30c3\u30af\u3067\u6355\u6349\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4e00\u822c\u7684\u306b\u306f\u3001<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a> <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%E1%A5%BD%A5%C3%A5%C9\">\u30e1\u30bd\u30c3\u30c9<\/a>\u5185\u3067\u767a\u751f\u3059\u308b (<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a> <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%E1%A5%BD%A5%C3%A5%C9\">\u30e1\u30bd\u30c3\u30c9<\/a>\u304c\u4f7f\u7528\u3059\u308b\u5225\u306e<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%E1%A5%BD%A5%C3%A5%C9\">\u30e1\u30bd\u30c3\u30c9<\/a>\u306b\u3088\u3063\u3066\u9001\u51fa\u3055\u308c\u308b) \u4f8b\u5916\u3092\u6355\u6349\u3057\u3001\u305d\u306e\u4f8b\u5916\u3092\u514b\u670d\u3059\u308b\u304b\u3001\u305d\u308c\u304c\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u3001\u305d\u306e\u969c\u5bb3\u306e\u539f\u56e0\u304c\u30b7\u30b9\u30c6\u30e0\u30ec\u30d9\u30eb\u306e\u30a8\u30e9\u30fc\u307e\u305f\u306f\u30d3\u30b8\u30cd\u30b9 \u30ed\u30b8\u30c3\u30af\u306e\u30a8\u30e9\u30fc\u306e\u3044\u305a\u308c\u3067\u3042\u308b\u304b\u3001\u3042\u308b\u3044\u306f<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%C8%A5%E9%A5%F3%A5%B6%A5%AF%A5%B7%A5%E7%A5%F3\">\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3<\/a>\u306b\u3088\u3063\u3066\u81ea\u52d5\u7684\u306b<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%ED%A1%BC%A5%EB%A5%D0%A5%C3%A5%AF\">\u30ed\u30fc\u30eb\u30d0\u30c3\u30af<\/a>\u3055\u308c\u308b\u3079\u304d\u304b\u3069\u3046\u304b\u306b\u5fdc\u3058\u3066\u3001\u3053\u308c\u3089\u306e\u4f8b\u5916\u3092\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u4f8b\u5916\u307e\u305f\u306f\u00a0EJBException\u00a0\u306e\u3044\u305a\u308c\u304b\u3068\u3057\u3066\u518d\u9001\u51fa\u3059\u308b\u3053\u3068\u304c\u30d9\u30b9\u30c8 \u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3067\u3042\u308b\u3068\u8003\u3048\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<\/p>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u4f8b\u5916\u306f\u3001Bean \u306e\u958b\u767a\u8005\u306b\u3088\u3063\u3066\u5b9a\u7fa9\u3055\u308c\u305f\u3001RemoteException\u00a0\u3092\u62e1\u5f35\u3057\u306a\u3044\u30c1\u30a7\u30c3\u30af\u6e08\u307f\u4f8b\u5916\u3067\u3042\u308b\u304b\u3001\u307e\u305f\u306f\u00a0javax.<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/ejb\">ejb<\/a>\u00a0\u30d1\u30c3\u30b1\u30fc\u30b8 (CreateException\u3001DuplicateKeyException\u3001FinderException\u3001ObjectNotFoundException\u3001\u307e\u305f\u306f\u00a0RemoveException) \u3067\u3042\u3089\u304b\u3058\u3081\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30c1\u30a7\u30c3\u30af\u6e08\u307f\u4f8b\u5916\u3067\u3059\u3002<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a> \u306e<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%E1%A5%BD%A5%C3%A5%C9\">\u30e1\u30bd\u30c3\u30c9<\/a>\u3067\u306f\u3001throws\u00a0\u6587\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u4f8b\u5916\u304c\u660e\u793a\u7684\u306b\u5b9a\u7fa9\u3055\u308c\u307e\u3059\u3002<\/p>\n<\/p>\n<p>\u5b9f\u884c\u6642\u4f8b\u5916<\/p>\n<p>EJBException\u00a0\u306a\u3069\u306e\u3001<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/java\">java<\/a>.lang.RuntimeException\u00a0\u3068\u305d\u306e\u30b5\u30d6\u30bf\u30a4\u30d7\u306f\u3001\u5bfe\u5fdc\u3059\u308b <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a> \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u4ecb\u3057\u3066 <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a> <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%E1%A5%BD%A5%C3%A5%C9\">\u30e1\u30bd\u30c3\u30c9<\/a>\u3067\u9001\u51fa\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u4f8b\u5916\u306f\u30b3\u30fc\u30c9\u5185\u3067\u660e\u793a\u7684\u306b\u6355\u6349\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u901a\u5e38\u306f <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a> \u306e\u30ed\u30fc\u30ab\u30eb \u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3092\u4f7f\u7528\u3059\u308b <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a> \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u547c\u3073\u51fa\u3059\u30af\u30e9\u30a4\u30a2\u30f3\u30c8 \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u3067\u3053\u308c\u3089\u306e\u4f8b\u5916\u3092\u6355\u6349\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059 (\u30ea\u30e2\u30fc\u30c8 \u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u5834\u5408\u306f\u3001EJBException\u00a0\u304c\u00a0RemoteException\u00a0\u3068\u3057\u3066 <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/EJB\">EJB<\/a> \u30b3\u30f3\u30c6\u30ca\u306b\u3088\u3063\u3066\u518d\u9001\u51fa\u3055\u308c\u307e\u3059)\u3002<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<\/p>\n<p>\u6700\u5f8c\u3001<a title=\"RemoteException\" href=\"http:\/\/java.sun.com\/j2se\/1.5.0\/ja\/docs\/ja\/api\/java\/rmi\/RemoteException.html\">JavaDoc<\/a>\u3092\u898b\u308b\u3068<\/p>\n<blockquote><p><code>RemoteException<\/code> \u306f\u3001\u30ea\u30e2\u30fc\u30c8<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%E1%A5%BD%A5%C3%A5%C9\">\u30e1\u30bd\u30c3\u30c9<\/a>\u547c\u3073\u51fa\u3057\u306e\u5b9f\u884c\u4e2d\u306b\u767a\u751f\u3059\u308b\u591a\u304f\u306e\u901a\u4fe1\u95a2\u9023\u306e\u4f8b\u5916\u3067\u4f7f\u7528\u3059\u308b\u5171\u901a\u306e<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%B9%A1%BC%A5%D1%A1%BC%A5%AF%A5%E9%A5%B9\">\u30b9\u30fc\u30d1\u30fc\u30af\u30e9\u30b9<\/a>\u3067\u3059\u3002<code>java.rmi.Remote<\/code> \u3092\u62e1\u5f35\u3059\u308b\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3067\u3042\u308b\u30ea\u30e2\u30fc\u30c8\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u5404<a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%E1%A5%BD%A5%C3%A5%C9\">\u30e1\u30bd\u30c3\u30c9<\/a>\u306f\u3001\u305d\u306e throws \u7bc0\u306b\u00a0<code>RemoteException<\/code> \u3092\u8a18\u8f09\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<\/p>\n<p>\u30ea\u30ea\u30fc\u30b9 1.4 \u3067\u306f\u3001\u3053\u306e\u4f8b\u5916\u306f\u6c4e\u7528\u76ee\u7684\u306e\u4f8b\u5916\u30c1\u30a7\u30fc\u30f3\u6a5f\u69cb\u306b\u6e96\u62e0\u3059\u308b\u3088\u3046\u306b\u6539\u826f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u300c\u30e9\u30c3\u30d7\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u4f8b\u5916\u300d\u306f\u3001\u4f8b\u5916\u3092\u69cb\u7bc9\u3059\u308b\u3068\u304d\u306b\u6307\u5b9a\u3057\u3001public<a href=\"http:\/\/java.sun.com\/j2se\/1.5.0\/ja\/docs\/ja\/api\/java\/rmi\/RemoteException.html#detail\"><code>detail<\/code><\/a> \u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4ecb\u3057\u3066\u53d6\u5f97\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u4f8b\u5916\u306f\u3001\u30ea\u30ea\u30fc\u30b9 1.4 \u3067\u306f\u300c\u539f\u56e0\u300d\u3068\u547c\u3070\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u524d\u8ff0\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3060\u3051\u3067\u306a\u304f\u3001<a href=\"http:\/\/java.sun.com\/j2se\/1.5.0\/ja\/docs\/ja\/api\/java\/lang\/Throwable.html#getCause()\"><code>Throwable.getCause()<\/code><\/a> <a class=\"keyword\" href=\"http:\/\/d.hatena.ne.jp\/keyword\/%A5%E1%A5%BD%A5%C3%A5%C9\">\u30e1\u30bd\u30c3\u30c9<\/a>\u3092\u4ecb\u3057\u3066\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<\/p>\n<p>\u30c1\u30a7\u30c3\u30af\u4f8b\u5916\u3092\u6295\u3052\u308b\u3088\u3046\u306a\u5b9f\u88c5\u306f\u3001\u3042\u3093\u307e\u308a\u898b\u3066\u306a\u3044\u4e8b\u3092\u601d\u3044\u51fa\u3057\u305f\u3002\u591a\u5206\u3001\u3069\u3063\u304b\u3067\u7d30\u5de5\u3092\u3057\u3066\u308b\u3093\u3060\u308d\u3046\u3002<\/p>\n<p>\u660e\u65e5\u898b\u3066\u307f\u3088\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8077\u5834\u3067\u8b70\u8ad6\u304c\u3042\u3063\u305f\u306e\u3067\u6574\u7406\u3057\u3066\u30e1\u30e2\u3002\u3002\u3002 \u672c\u3092\u898b\u308b\u3068 \u30c1\u30a7\u30c3\u30af\u4f8b\u5916 Exception\u62e1\u5f35\u3002\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u539f\u5247\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3057\u306a\u3044\u3002\u3055\u305b\u305f\u3044\u5834\u5408\u306f\u3001setRollbackOnly\u3067\u30de\u30fc\u30ad\u30f3\u30b0\u304c\u5fc5\u8981\u3002 \u975e\u30c1\u30a7\u30c3\u30af\u4f8b\u5916 R [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-engineering"],"_links":{"self":[{"href":"http:\/\/daimlars.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/daimlars.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/daimlars.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/daimlars.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/daimlars.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":0,"href":"http:\/\/daimlars.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions"}],"wp:attachment":[{"href":"http:\/\/daimlars.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/daimlars.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/daimlars.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}