{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/5507","repository_url":"https://api.github.com/repos/jhipster/generator-jhipster","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/5507/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/5507/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/5507/events","html_url":"https://github.com/jhipster/generator-jhipster/issues/5507","id":217775459,"number":5507,"title":"Error using WebSockets on Heroku","user":{"login":"henriquesmoco","id":8483398,"avatar_url":"https://avatars0.githubusercontent.com/u/8483398?v=3","gravatar_id":"","url":"https://api.github.com/users/henriquesmoco","html_url":"https://github.com/henriquesmoco","followers_url":"https://api.github.com/users/henriquesmoco/followers","following_url":"https://api.github.com/users/henriquesmoco/following{/other_user}","gists_url":"https://api.github.com/users/henriquesmoco/gists{/gist_id}","starred_url":"https://api.github.com/users/henriquesmoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henriquesmoco/subscriptions","organizations_url":"https://api.github.com/users/henriquesmoco/orgs","repos_url":"https://api.github.com/users/henriquesmoco/repos","events_url":"https://api.github.com/users/henriquesmoco/events{/privacy}","received_events_url":"https://api.github.com/users/henriquesmoco/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-29T06:17:40Z","updated_at":"2017-03-30T05:36:23Z","closed_at":"2017-03-29T06:23:04Z","body":"##### **Overview of the issue**\r\n\r\nWhen I deploy the app to Heroku and load the generated \"user tracking\" page that uses websockets the following error appears on logs and the page don't show the tracking data:\r\n\r\n>Caused by: org.springframework.web.socket.sockjs.SockJsTransportFailureException: WebSocket handshake failure; nested exception is java.lang.IllegalArgumentException: >No 'javax.websocket.server.ServerContainer' ServletContext attribute. Are you running in a Servlet container that supports JSR-356?\r\n\r\n##### **Motivation for or Use Case**\r\n\r\nI want to use WebSockets without errors on console/app.\r\n\r\n##### **Reproduce the error**\r\n\r\n1. Create a monolith angular 1.x app with websockets\r\n2. Deploy to Heroku with the command (found on gitlab-ci.yml generated by JHipster):\r\n`./mvnw com.heroku.sdk:heroku-maven-plugin:1.1.1:deploy-war -DskipTests -Pprod -Dheroku.appName=myapp`\r\n3. Navigate to the user tracking page (Ex.: https://myapp.herokuapp.com/#/tracker)\r\n4. Open another browser, log in and open any page on the app\r\n5. See Heroku logs for the error\r\n\r\n\r\n##### **Related issues**\r\n\r\nNone that I have found.\r\n\r\n##### **Suggest a Fix**\r\n\r\nThis error appears to happen because the command deploy-war of heroku-maven-plugin uses webapp-runner.jar to run the war on Heroku, but since \"myapp\" is a SpringBoot one we don't need this webapp-runner.jar.\r\n\r\nIf we use the command **deploy instead of deploy-war** the app works without errors (and with a bit small deploy):\r\n`./mvnw com.heroku.sdk:heroku-maven-plugin:1.1.1:deploy -DskipTests -Pprod -Dheroku.appName=myapp`\r\n\r\n##### **JHipster Version(s)**\r\n\r\n```\r\nmyapp@0.0.0 C:\\myapp\\server-app\r\n`-- generator-jhipster@4.0.2\r\n\r\n```\r\n\r\n##### **JHipster configuration**\r\n\r\n```yaml\r\n{\r\n  \"generator-jhipster\": {\r\n    \"jhipsterVersion\": \"4.0.2\",\r\n    \"baseName\": \"myapp\",\r\n    \"packageName\": \"com.myapp\",\r\n    \"packageFolder\": \"com/myapp\",\r\n    \"serverPort\": \"8080\",\r\n    \"authenticationType\": \"jwt\",\r\n    \"hibernateCache\": \"hazelcast\",\r\n    \"clusteredHttpSession\": false,\r\n    \"websocket\": \"spring-websocket\",\r\n    \"databaseType\": \"sql\",\r\n    \"devDatabaseType\": \"h2Disk\",\r\n    \"prodDatabaseType\": \"postgresql\",\r\n    \"searchEngine\": false,\r\n    \"messageBroker\": false,\r\n    \"buildTool\": \"maven\",\r\n    \"enableSocialSignIn\": false,\r\n    \"jwtSecretKey\": \"abcd\",\r\n    \"useSass\": false,\r\n    \"clientPackageManager\": \"npm\",\r\n    \"applicationType\": \"monolith\",\r\n    \"clientFramework\": \"angular1\",\r\n    \"testFrameworks\": [\r\n      \"gatling\",\r\n      \"protractor\"\r\n    ],\r\n    \"jhiPrefix\": \"jhi\",\r\n    \"enableTranslation\": true,\r\n    \"nativeLanguage\": \"pt-br\",\r\n    \"languages\": [\r\n      \"pt-br\"\r\n    ],\r\n    \"herokuAppName\": \"myapp\"\r\n  }\r\n}\r\n```\r\n\r\n\r\n##### **Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**\r\n\r\nTipoDocumento.json\r\n\r\n```yaml\r\n{\r\n    \"fluentMethods\": true,\r\n    \"relationships\": [],\r\n    \"fields\": [\r\n        {\r\n            \"fieldName\": \"nome\",\r\n            \"fieldType\": \"String\",\r\n            \"fieldValidateRules\": [\r\n                \"required\",\r\n                \"maxlength\"\r\n            ],\r\n            \"fieldValidateRulesMaxlength\": \"30\"\r\n        }\r\n    ],\r\n    \"changelogDate\": \"20170301192641\",\r\n    \"dto\": \"no\",\r\n    \"service\": \"no\",\r\n    \"entityTableName\": \"tipo_documento\",\r\n    \"pagination\": \"no\"\r\n}\r\n\r\n```\r\n\r\nTipoEndereco.json\r\n\r\n```yaml\r\n{\r\n    \"fluentMethods\": true,\r\n    \"relationships\": [],\r\n    \"fields\": [\r\n        {\r\n            \"fieldName\": \"nome\",\r\n            \"fieldType\": \"String\",\r\n            \"fieldValidateRules\": [\r\n                \"required\",\r\n                \"maxlength\"\r\n            ],\r\n            \"fieldValidateRulesMaxlength\": 20\r\n        }\r\n    ],\r\n    \"changelogDate\": \"20170228171654\",\r\n    \"dto\": \"no\",\r\n    \"service\": \"no\",\r\n    \"entityTableName\": \"tipo_endereco\",\r\n    \"pagination\": \"no\"\r\n}\r\n\r\n```\r\n\r\n##### **Browsers and Operating System**\r\n\r\nAll browsers.\r\n\r\njava version \"1.8.0_91\"\r\nJava(TM) SE Runtime Environment (build 1.8.0_91-b15)\r\nJava HotSpot(TM) Client VM (build 25.91-b15, mixed mode)\r\n\r\ngit version 1.9.5.msysgit.0\r\n\r\nnode: v6.9.1\r\n\r\nnpm: 3.10.8\r\n\r\nbower: 1.8.0\r\n\r\ngulp:\r\n[02:59:27] CLI version 3.9.1\r\n[02:59:27] Local version 3.9.1\r\n\r\n- [ x ] Checking this box is mandatory (this is just to show you read everything)\r\n"},"comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments/290307280","html_url":"https://github.com/jhipster/generator-jhipster/issues/5507#issuecomment-290307280","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/5507","id":290307280,"user":{"login":"henriquesmoco","id":8483398,"avatar_url":"https://avatars0.githubusercontent.com/u/8483398?v=3","gravatar_id":"","url":"https://api.github.com/users/henriquesmoco","html_url":"https://github.com/henriquesmoco","followers_url":"https://api.github.com/users/henriquesmoco/followers","following_url":"https://api.github.com/users/henriquesmoco/following{/other_user}","gists_url":"https://api.github.com/users/henriquesmoco/gists{/gist_id}","starred_url":"https://api.github.com/users/henriquesmoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henriquesmoco/subscriptions","organizations_url":"https://api.github.com/users/henriquesmoco/orgs","repos_url":"https://api.github.com/users/henriquesmoco/repos","events_url":"https://api.github.com/users/henriquesmoco/events{/privacy}","received_events_url":"https://api.github.com/users/henriquesmoco/received_events","type":"User","site_admin":false},"created_at":"2017-03-30T05:36:23Z","updated_at":"2017-03-30T05:36:23Z","body":"@jdubois  I am sorry if I wasn't very clear. The command I wrote on this issue was inside a file generated by JHipster for GitLab CI as described in this page: https://jhipster.github.io/setting-up-ci/\r\n\r\n`yo jhipster:ci-cd`\r\n\r\nAnd yes, Heroku support WebSockets in production since July 2014 (https://blog.heroku.com/websockets_now_ga) \r\n\r\nAnd with all the respect, I wrote in the issue the problem AND the solution I am using,, so it seems I know the difference between Stackoverflow and bug trackers :P\r\n"}}
{"actor":{"display_login":"henriquesmoco"}}