Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2012-12-11T08:24:07Z by SystemAdmin
SystemAdmin
SystemAdmin
2327 Posts
ACCEPTED ANSWER

Pinned topic Issues deploying Adapter

‏2012-12-10T20:09:21Z |
I am working on creating an adapter which calls out to java to perform some function. This is working fine in my Eclipse development environment but when deploy it to my WLP based server I am getting the following error:
10/12/12 19:57:08:256 GMT 00000032 SystemOut O 19:57:08,247 DEBUG developer Put Message: test message on Topic: pie
10/12/12 19:57:08:345 GMT 00000032 SystemOut O 19:57:08,341 DEBUG developer Class: http://JavaPackage com.ibm.java.adapter.MQTTAdapter
10/12/12 19:57:08:792 GMT 00000032 SystemOut O 19:57:08,788 ERROR InvocationContext An error occurred while invoking procedure MQTTAdapter/putMessage parameters: {
"arr": [
"pie",
"test message"
]
}
TypeError: Cannot call property putMessage in object http://JavaPackage com.ibm.java.adapter.MQTTAdapter. It is not a function, it is "object". (MQTTAdapter-impl.js#31)
Caused by: null

The process I followed was:

1) Copy Project WAR file into <Worklight>/usr/server/worklightServer/apps directory
2) Updated server.xml file in <Worklight>/usr/server/worklightServer directory to add the following lines:

<application id="RaspberryProject" location="RaspberryProject.war" name="RaspberryProject" type="war">
<classloader delegation="parentLast">
<commonLibrary>
<fileset dir="${shared.resource.dir}/lib" includes="worklight-jee-library.jar"/>
</commonLibrary>
</classloader>
</application>

3) Restarted server

When my mobile app calls my adapter I see the above error. I've searched this forum and the web and as far as I can tell I've followed the advice but looks like I've missed something. I've made sure that my Eclipse is using Java v1.6 (which fixed the issue I had at first with testing my code in my eclipse environment and this appears to be in order.

Environment wise my development environment is Mac OS Mountain Lion and Eclipse is Juno.
  • christianIBM
    christianIBM
    78 Posts
    ACCEPTED ANSWER

    Re: Issues deploying Adapter

    ‏2012-12-10T21:50:52Z  in response to SystemAdmin
    What version of Juno?

    -Worklight Development Team, iOS-Christian Linares
    • SystemAdmin
      SystemAdmin
      2327 Posts
      ACCEPTED ANSWER

      Re: Issues deploying Adapter

      ‏2012-12-11T07:48:47Z  in response to christianIBM
      About Eclipse is reporting the following:

      Eclipse Java EE IDE for Web Developers.

      Version: Juno Service Release 1
      Build id: 20121004-1855

      (c) Copyright Eclipse contributors and others 2005, 2012. All rights reserved.
      Visit http://www.eclipse.org/webtools
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: Issues deploying Adapter

    ‏2012-12-11T07:52:02Z  in response to SystemAdmin
    Did you mean this (supported) version of Eclipse?
    http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr1

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • SystemAdmin
      SystemAdmin
      2327 Posts
      ACCEPTED ANSWER

      Re: Issues deploying Adapter

      ‏2012-12-11T08:24:07Z  in response to IdanAdar
      My shell is at a slightly higher version due to an eclipse update (the above is Build ID: 20120920-0800) can't quite see why that should be an issue and if it was I would have thought it more likely to impact the dev / test envs in the shell rather than deployment.