webOS Nation Forums >  webOS Developers >  webOS Development > Problem with JS services
Problem with JS services
  Reply
Like Tree1Likes
  • 1 Post By bhutten

 
Thread Tools Display Modes
Old 05/25/2015, 02:51 PM   #1 (permalink)
Homebrew Developer
 
Posts: 42
Hi,

I'm trying to write a simple app using a self made JS service. So I call:

this.controller.serviceRequest("palm://com.palm.mojoservicetest.service", {
method : "echo",
parameters : { "message" : "Echo this!" },
onSuccess:this.serviceSuccess.bind(this),
onFailure:this.serviceFailure.bind(this)
});

But I get the error below. It's driving me nuts, but I cannot find what I'm doing wrong here.
This error does not make any sense to me:

{
"message":"palm://com.palm.activitymanager/monitor {"activityId":121,"subscribe":true}: Not permitted to send to com.palm.activitymanager.",
"stack":"Error: palm://com.palm.activitymanager/monitor {"activityId":121,"subscribe":true}: Not permitted to send to com.palm.activitymanager.
at Object.create (/usr/palm/frameworks/foundations/version/1.0/javascript/structure/err.js:5:17)
at /usr/palm/frameworks/foundations/version/1.0/javascript/comms/palmcall.js:158:16
at Future.<anonymous> (/usr/palm/frameworks/foundations/version/1.0/javascript/control/future.js:228:17)
at Timer.dispatch [as callback] (/usr/palm/frameworks/foundations/version/1.0/javascript/control/queue.js:72:16)
at /usr/palm/nodejs/fork_server.js:201:10
at ChildProcess.fork (child_process:8:245)
at Object.fork (child_process:1:434)
at /usr/palm/nodejs/fork_server.js:246:32
at Object.parseMessage (/usr/palm/nodejs/fork_server.js:68:5)
at Stream.<anonymous> (/usr/palm/nodejs/fork_server.js:445:18)",
"errorCode":-1,
"response": {
"returnValue":false,
"errorCode":-1,
"errorText":"Not permitted to send to com.palm.activitymanager."
},
"returnValue":false
}

Can anobody help me on this?
bhutten is offline   Reply With Quote
Old 05/25/2015, 11:58 PM   #2 (permalink)
Member
 
Grabber5.0's Avatar
 
Posts: 4,465
I have never written a service myself, only looked at some for the purpose of patching them, so I have little to offer outside of ideas. I looked at the code and it seems simple enough to create your own simple service and call it - and the calling code looks pretty much exactly like yours. I packaged up the BasicService example from the SDK (on Windows it's under C:\Program Files (x86)\HP webOS\SDK\share\samplecode\mojo\BasicService) and installed it, and it works correctly on the emulator and on my Pre2. I would probably start by comparing that sample app to yours and see if anything jumps out. Are your app and service packaged and installed separately? Is your service method set to public in services.json? (I would expect that only to be necessary for other apps to use your service, but if you are installing your service separately from your app, I can see needing that set to true).

From the stack trace, it appears the error is occurring in the service. Is it attempting to set an interval to be invoked again?
__________________
Matt Williams
*How to install .patch files on your device*
Developer of: SMS Auto Forward/Reply, GPS Viewer,
Keyring converters for CSV, eWallet, & CodeWallet
Touchpad patches:Keyring HD,ClassicNote HD, YouTube HD (for 2.1 app), Show email recipient addresses for contacts
Phone patches: Forums fixes and enhancements patch, Weather Channel fix
All-device patches: Update GlobalSign certs, Google Sync https fix, Yahoo contact sync fix


Last edited by Grabber5.0; 05/26/2015 at 12:08 AM.
Grabber5.0 is online now   Reply With Quote
Old 05/26/2015, 03:38 PM   #3 (permalink)
Homebrew Developer
 
Posts: 42
Finally! I found the problem.
I used the app id [com.palm.mojoservicetest.service]. But somehow the prefix [com.palm] seems reserved. When using a different prefix (like [com.palmdts] which is used in many sample apps) it works.
This took me days to find out....

Thanks Grabber5.0 for your reply, it feels good that there are still active developers for webOS.
bhutten is offline   Reply With Quote
Liked by Preemptive likes this.
Old 05/26/2015, 05:33 PM   #4 (permalink)
Member
 
Grabber5.0's Avatar
 
Posts: 4,465
Glad you found it. The com.palm prefix is not a problem for apps, I wonder what the problem with services is? I've had to use com.palm on an app to be able to access the private bus reserved for system apps. As long as you don't need to do that, changing the package id is the right approach.
__________________
Matt Williams
*How to install .patch files on your device*
Developer of: SMS Auto Forward/Reply, GPS Viewer,
Keyring converters for CSV, eWallet, & CodeWallet
Touchpad patches:Keyring HD,ClassicNote HD, YouTube HD (for 2.1 app), Show email recipient addresses for contacts
Phone patches: Forums fixes and enhancements patch, Weather Channel fix
All-device patches: Update GlobalSign certs, Google Sync https fix, Yahoo contact sync fix

Grabber5.0 is online now   Reply With Quote
Old 05/27/2015, 01:13 AM   #5 (permalink)
pivotCE Developer
 
Preemptive's Avatar
 
Posts: 2,462
Quote:
Originally Posted by bhutten View Post
Thanks Grabber5.0 for your reply, it feels good that there are still active developers for webOS.
Including you!

What are you making?
__________________
webOS Status Report | The Zombie & Dead app list | User Count | webOS Service Pack
Preemptive is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with connecting to webos account as well as HP cloud services. AAA HP TouchPad 2 08/13/2011 12:11 AM
Problem with homebrew services on gms Palm Pre Plus Gravesent Palm Pre and Pre Plus 4 04/26/2011 02:20 PM
New Location Services Problem TomD webOS Discussion Lounge 0 03/24/2011 09:16 PM
Goodlink problem on downloading services svieira Palm OS Devices & Apps 4 05/09/2007 01:17 PM
Confused on Verizon services, I just got unlimited data plan, what services do I get? BrianV North American Carriers (CDMA) 2 10/02/2004 09:38 AM


 


Content Relevant URLs by vBSEO 3.6.0