Title: Illegal reflective access by org.msgpack.core.buffer.DirectBufferAccess · Issue #605 · msgpack/msgpack-java · GitHub
Open Graph Title: Illegal reflective access by org.msgpack.core.buffer.DirectBufferAccess · Issue #605 · msgpack/msgpack-java
X Title: Illegal reflective access by org.msgpack.core.buffer.DirectBufferAccess · Issue #605 · msgpack/msgpack-java
Description: When I run my program, I get a warning message with the title. The message also said "Please consider reporting this to the maintainers of org.msgpack.core.buffer.DirectBufferAccess", so I will report it here. A simple reproduction progr...
Open Graph Description: When I run my program, I get a warning message with the title. The message also said "Please consider reporting this to the maintainers of org.msgpack.core.buffer.DirectBufferAccess", so I will rep...
X Description: When I run my program, I get a warning message with the title. The message also said "Please consider reporting this to the maintainers of org.msgpack.core.buffer.DirectBufferAccess", so ...
Opengraph URL: https://github.com/msgpack/msgpack-java/issues/605
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Illegal reflective access by org.msgpack.core.buffer.DirectBufferAccess","articleBody":"When I run my program, I get a warning message with the title. The message also said \"Please consider reporting this to the maintainers of org.msgpack.core.buffer.DirectBufferAccess\", so I will report it here.\r\n\r\nA simple reproduction program (named ReproduceCase.java) is below.\r\n```\r\nimport java.io.ByteArrayOutputStream;\r\nimport java.io.IOException;\r\nimport java.nio.ByteBuffer;\r\nimport org.msgpack.core.MessagePack;\r\nimport org.msgpack.core.MessagePacker;\r\nimport org.msgpack.core.MessageUnpacker;\r\nimport org.msgpack.core.buffer.ByteBufferInput;\r\n\r\npublic final class ReproduceCase {\r\n class ByteBufferBackedInput extends ByteBufferInput {\r\n ByteBufferBackedInput(ByteBuffer byteBuffer) {\r\n super(byteBuffer);\r\n }\r\n }\r\n\r\n ReproduceCase() {\r\n }\r\n\r\n ByteBufferInput encode() throws IOException {\r\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\r\n MessagePacker packer = org.msgpack.core.MessagePack.newDefaultPacker(outputStream);\r\n\r\n packer.packLong((long) 123456789);\r\n packer.flush();\r\n\r\n byte[] ba = outputStream.toByteArray();\r\n var length = ba.length;\r\n\r\n var directByteBuffer = ByteBuffer.allocateDirect(length);\r\n directByteBuffer.put(ba, 0, length);\r\n directByteBuffer.rewind();\r\n\r\n return new ByteBufferBackedInput(directByteBuffer);\r\n }\r\n\r\n void decode(ByteBufferInput buffer) throws IOException {\r\n var unpacker = org.msgpack.core.MessagePack.newDefaultUnpacker(buffer);\r\n System.out.println(unpacker.unpackLong());\r\n }\r\n\r\n public static void main(String[] args) {\r\n try {\r\n var reproduce = new ReproduceCase();\r\n var buffer = reproduce.encode();\r\n reproduce.decode(buffer);\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }\r\n}\r\n```\r\n\r\nThe warning message is output when the following line is executed.\r\n```\r\n var unpacker = org.msgpack.core.MessagePack.newDefaultUnpacker(buffer);\r\n```\r\n\r\nThe following is supplementary information.\r\n1) This happens with both msgpack-core-0.8.24 and 0.9.0.\r\n2) unpacker.unpackLong() works fine, as you can see when you run the program.\r\n3) If you used ByteBuffer.allocate(length) instead of ByteBuffer.allocateDirect(length), you will not get that warning. However, that is not a solution for me because my program needs to use direct byte buffer.\r\n","author":{"url":"https://github.com/t-horikawa","@type":"Person","name":"t-horikawa"},"datePublished":"2021-11-18T08:13:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/605/msgpack-java/issues/605"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4cec0edb-bf72-d52a-35f0-9c6f416fc56f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C2C:1D4F69:215C311:2D3F8F3:6A538E46 |
| html-safe-nonce | 9e5f57c17d0882467b38b0ba85d8e7e9a39cb5d32a39b1a3ed0a59985c1db246 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzJDOjFENEY2OToyMTVDMzExOjJEM0Y4RjM6NkE1MzhFNDYiLCJ2aXNpdG9yX2lkIjoiMTU5NDk1MDY0OTkxMjcyNTA2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4de26ba4696f2c095a6749d51cf3611e4aab6ede430c78450b1289a235c4c348 |
| hovercard-subject-tag | issue:1057060583 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/msgpack/msgpack-java/605/issue_layout |
| twitter:image | https://opengraph.githubassets.com/67cb51cb978a40dd581580971c078ba7a1b81a2c84ffd8e5d82cec81c98f3149/msgpack/msgpack-java/issues/605 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/67cb51cb978a40dd581580971c078ba7a1b81a2c84ffd8e5d82cec81c98f3149/msgpack/msgpack-java/issues/605 |
| og:image:alt | When I run my program, I get a warning message with the title. The message also said "Please consider reporting this to the maintainers of org.msgpack.core.buffer.DirectBufferAccess", so I will rep... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | t-horikawa |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/msgpack/msgpack-java git https://github.com/msgpack/msgpack-java.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 1971346 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1971346 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width