Title: can't catch `LocalException`: tried to access class com.browserstack.local.LocalException · Issue #46 · browserstack/browserstack-local-java · GitHub
Open Graph Title: can't catch `LocalException`: tried to access class com.browserstack.local.LocalException · Issue #46 · browserstack/browserstack-local-java
X Title: can't catch `LocalException`: tried to access class com.browserstack.local.LocalException · Issue #46 · browserstack/browserstack-local-java
Description: Using version 1.0.3 I have this Groovy code: import com.browserstack.local.LocalException class AcsTestBase { ... log.info 'Starting BrowserStack Local binary ...' try { bsLocal = new Local() HashMap
Open Graph Description: Using version 1.0.3 I have this Groovy code: import com.browserstack.local.LocalException class AcsTestBase { ... log.info 'Starting BrowserStack Local binary ...' try { bsLocal = new Local() HashM...
X Description: Using version 1.0.3 I have this Groovy code: import com.browserstack.local.LocalException class AcsTestBase { ... log.info 'Starting BrowserStack Local binary ...' try { bsLocal = new Local...
Opengraph URL: https://github.com/browserstack/browserstack-local-java/issues/46
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"can't catch `LocalException`: tried to access class com.browserstack.local.LocalException","articleBody":"Using version 1.0.3\r\n\r\nI have this Groovy code:\r\n```\r\nimport com.browserstack.local.LocalException\r\n\r\nclass AcsTestBase {\r\n...\r\n log.info 'Starting BrowserStack Local binary ...'\r\n try {\r\n bsLocal = new Local()\r\n HashMap\u003cString, String\u003e bsLocalArgs = new HashMap\u003cString, String\u003e()\r\n bsLocalArgs.put('key', key)\r\n bsLocal.start(bsLocalArgs)\r\n log.info 'bsLocal.isRunning(): ' + bsLocal.isRunning()\r\n } catch (LocalException e) {\r\n log.error e.message\r\n throw e\r\n }\r\n```\r\nThis results in this:\r\n\u003e java.lang.IllegalAccessError: tried to access class com.browserstack.local.LocalException from class tests.AcsTestBase\r\n\r\nBut if I use `catch (Exception e)` instead, then everything is working ok: I'm getting message in the log, as expected.\r\n\r\nThe point of this issue is not fact, that I'm getting Exception, but the issue is that I can't catch the exception by using `LocalException` class\r\n\r\nBy the way, the cause of exception was this (I know how to handle it):\r\n```\r\ncom.browserstack.local.LocalException: Either another browserstack local client is running on your machine or some server is listening on port 45691\r\n\tat com.browserstack.local.Local.start(Local.java:80)\r\n\tat com.browserstack.local.Local$start.call(Unknown Source)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)\r\n...\r\n```\r\n","author":{"url":"https://github.com/SlavikCA","@type":"Person","name":"SlavikCA"},"datePublished":"2019-11-16T00:34:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/46/browserstack-local-java/issues/46"}
| 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:bc0e437c-fee7-6091-476f-27386e8310c3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD6C:37D639:10E2418:16CE040:6973D99C |
| html-safe-nonce | b3181fc02102219383d75adbf797b6bac8d1975cc0efca97bb3b80208b18409d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDZDOjM3RDYzOToxMEUyNDE4OjE2Q0UwNDA6Njk3M0Q5OUMiLCJ2aXNpdG9yX2lkIjoiNTEzNTY0ODEyMDIyNTY1MTEwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 585403ae171455d1d6247e6c6570cf20f7984b957a76ec396c895d708754062f |
| hovercard-subject-tag | issue:523760108 |
| 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/browserstack/browserstack-local-java/46/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f91bbb3460f597da1411081013e4a75cb99ee0e66db96a90487c144c7ef100b9/browserstack/browserstack-local-java/issues/46 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f91bbb3460f597da1411081013e4a75cb99ee0e66db96a90487c144c7ef100b9/browserstack/browserstack-local-java/issues/46 |
| og:image:alt | Using version 1.0.3 I have this Groovy code: import com.browserstack.local.LocalException class AcsTestBase { ... log.info 'Starting BrowserStack Local binary ...' try { bsLocal = new Local() HashM... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SlavikCA |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4c466014c8820edcdcbef69f57f90d1c8041009ca459463b96b062ebca83c424 |
| turbo-cache-control | no-preview |
| go-import | github.com/browserstack/browserstack-local-java git https://github.com/browserstack/browserstack-local-java.git |
| octolytics-dimension-user_id | 1119453 |
| octolytics-dimension-user_login | browserstack |
| octolytics-dimension-repository_id | 51923142 |
| octolytics-dimension-repository_nwo | browserstack/browserstack-local-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51923142 |
| octolytics-dimension-repository_network_root_nwo | browserstack/browserstack-local-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 | b4cd3a8af1483283fd4c6bcf6e24fd9fc8ab0e78 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width