You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/04/05 09:50:54 UTC

[GitHub] brunogirin opened a new issue #31: Java action that depends on packages jar file fails

brunogirin opened a new issue #31: Java action that depends on packages jar file fails
URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/31
 
 
   I have a set of Java actions packaged in a jar file that I deploy on Bluemix. All Java code is packaged in a jar file with a `lib` directory that contains dependant jar files, in particular the Cloudant client. Simple actions that do not use any dependant libraries work fine. Actions that use the Cloudant library fail with a `NoClassDefFoundError`.
   
   ## Environment details:
   
   * Bluemix
   * Build on Ubuntu 16.04
   
   ## Steps to reproduce the issue:
   
   1.   Build the code with gradle
   2.   Deploy on bluemix (I use `wskdeploy`)
   3.   Invoke the example/greeting action
   4.   Invoke the example/cloudant-test action
   
   
   ## Provide the expected results and outputs:
   
   Result invoking `example/greeting`:
   
   ```
   $ bx wsk action invoke example/greeting  -b
   ok: invoked /_/example/greeting with id 48d37cc2dfff42c2937cc2dfff42c2cb
   {
       "activationId": "48d37cc2dfff42c2937cc2dfff42c2cb",
       "annotations": [
           {
               "key": "path",
               "value": "consideratehoteliers.com_dev/example/greeting"
           },
           {
               "key": "waitTime",
               "value": 493
           },
           {
               "key": "kind",
               "value": "java"
           },
           {
               "key": "limits",
               "value": {
                   "logs": 10,
                   "memory": 256,
                   "timeout": 60000
               }
           },
           {
               "key": "initTime",
               "value": 434
           }
       ],
       "duration": 460,
       "end": 1522921174650,
       "logs": [],
       "name": "greeting",
       "namespace": "consideratehoteliers.com_dev",
       "publish": false,
       "response": {
           "result": {
               "greeting": "Hello !"
           },
           "status": "success",
           "success": true
       },
       "start": 1522921174190,
       "subject": "bruno@imby.bio",
       "version": "0.0.1"
   }
   ```
   
   
   ## Provide the actual results and outputs:
   
   ```
   $ bx wsk action invoke example/cloudant_test -b
   ok: invoked /_/example/cloudant_test with id b7b7df5cbc754685b7df5cbc752685c5
   {
       "activationId": "b7b7df5cbc754685b7df5cbc752685c5",
       "annotations": [
           {
               "key": "path",
               "value": "consideratehoteliers.com_dev/example/cloudant_test"
           },
           {
               "key": "waitTime",
               "value": 520
           },
           {
               "key": "kind",
               "value": "java"
           },
           {
               "key": "limits",
               "value": {
                   "logs": 10,
                   "memory": 256,
                   "timeout": 60000
               }
           },
           {
               "key": "initTime",
               "value": 420
           }
       ],
       "duration": 447,
       "end": 1522851950713,
       "logs": [],
       "name": "cloudant_test",
       "namespace": "consideratehoteliers.com_dev",
       "publish": false,
       "response": {
           "result": {
               "error": "An error has occured while invoking the action (see logs for details): java.lang.NoClassDefFoundError: com/cloudant/client/api/ClientBuilder"
           },
           "status": "action developer error",
           "success": false
       },
       "start": 1522851950266,
       "subject": "bruno@imby.bio",
       "version": "0.0.1"
   }
   ```
   
   ## Additional information you deem important:
   
   See attached files that include:
   - the `wskdeploy` manifest
   - the `gradle` build file
   - two Java classes that implement the actions mentioned above, `Hello.java` that works and `CloudantTest.java` that doesn't
   
   [code.zip](https://github.com/apache/incubator-openwhisk-runtime-java/files/1879451/code.zip)
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services