{"action":"opened","issue":{"url":"https://api.github.com/repos/apache/incubator-openwhisk-wskdeploy/issues/276","repository_url":"https://api.github.com/repos/apache/incubator-openwhisk-wskdeploy","labels_url":"https://api.github.com/repos/apache/incubator-openwhisk-wskdeploy/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/apache/incubator-openwhisk-wskdeploy/issues/276/comments","events_url":"https://api.github.com/repos/apache/incubator-openwhisk-wskdeploy/issues/276/events","html_url":"https://github.com/apache/incubator-openwhisk-wskdeploy/issues/276","id":233038760,"number":276,"title":"Action creation with .jar fails with \"The request content was malformed\"","user":{"login":"pritidesai","id":206285,"avatar_url":"https://avatars2.githubusercontent.com/u/206285?v=3","gravatar_id":"","url":"https://api.github.com/users/pritidesai","html_url":"https://github.com/pritidesai","followers_url":"https://api.github.com/users/pritidesai/followers","following_url":"https://api.github.com/users/pritidesai/following{/other_user}","gists_url":"https://api.github.com/users/pritidesai/gists{/gist_id}","starred_url":"https://api.github.com/users/pritidesai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pritidesai/subscriptions","organizations_url":"https://api.github.com/users/pritidesai/orgs","repos_url":"https://api.github.com/users/pritidesai/repos","events_url":"https://api.github.com/users/pritidesai/events{/privacy}","received_events_url":"https://api.github.com/users/pritidesai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-01T23:33:39Z","updated_at":"2017-06-01T23:33:39Z","closed_at":null,"body":"**1: Create a Java file called `Hello.Java` from [here](https://console.ng.bluemix.net/docs/openwhisk/openwhisk_actions.html#openwhisk_actions_java)**\r\n\r\n```\r\nimport com.google.gson.JsonObject;\r\npublic class Hello {\r\n    public static JsonObject main(JsonObject args) {\r\n        String name = \"stranger\";\r\n        if (args.has(\"name\"))\r\n            name = args.getAsJsonPrimitive(\"name\").getAsString();\r\n        JsonObject response = new JsonObject();\r\n        response.addProperty(\"greeting\", \"Hello \" + name + \"!\");\r\n        return response;\r\n    }\r\n}\r\n```\r\n\r\n**2: Compile `Hello.java` into a JAR file `hello.jar` as follows:**\r\n\r\n```\r\njavac Hello.java\r\njar cvf hello.jar Hello.class\r\n```\r\n\r\n**3: Create `manifest.yaml` with:**\r\n\r\n```\r\npackage:\r\n    name: helloworldjar\r\n    actions:\r\n        helloworld:\r\n            location: src/hello.jar\r\n            runtime: java\r\n            main: Hello\r\n```\r\n\r\n**4: Deployment fails with:**\r\n\r\n```\r\nResponse body received:\r\n{\r\n  \"error\": \"The request content was malformed:\\n'main' must be a string defined in 'exec' for 'java' actions\",\r\n  \"code\": 4001042\r\n}\r\n2017/06/01 12:48:50 Got error creating action with error message: The request content was malformed:\r\n'main' must be a string defined in 'exec' for 'java' actions (code 4001042) and error code: 144.\r\n```"}}
{"actor":{"display_login":"pritidesai"}}