Exceptions on MessagingExtender overrides

Hello!
I want to do some extra logic on the backend side after a push notification was send and/or a device registered for push notifications. To accomplish this I’m extending the MessagingExtender as described in the docs. But as soon as i deploy my handlers via the CodeRunner (which works like a charm) I get exceptions as soon as the methods should be invoked.
[WEBORB ERROR, Thread-20, 03:13:16 08:33:26] org.apache.axis.types.UnsignedShort
[WEBORB ERROR, Thread-29, 03:13:16 08:33:26] unable to find matching server-side type for com.backendless.management.DeviceRegistrationDto
Mar 13, 2016 8:33:26 PM com.backendless.coderunner.runtime.task.EventInvocationTask runImpl
SEVERE: argument type mismatch
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.backendless.coderunner.runtime.task.EventInvocationTask.runImpl(EventInvocationTask.java:92)
at com.backendless.coderunner.runtime.concurrent.ExtendedRunnable.run(ExtendedRunnable.java:26)
at java.lang.Thread.run(Thread.java:745)
This happens in a very similar way when I’m using afterPublish, beforePublish and as you can see above the afterDeviceRegistration. Do you have any idea what I’m missing here? :slight_smile:
This is my (very empty) implementation of the afterDeviceRegistration handler:
package com.mbaas.events;
import com.backendless.DeviceRegistration;
import com.backendless.servercode.ExecutionResult;
import com.backendless.servercode.RunnerContext;
import com.backendless.servercode.annotation.Asset;
import com.backendless.servercode.extension.MessagingExtender;
@Asset("*")
public class MessageEvents extends MessagingExtender {

@Override
public void afterDeviceRegistration(RunnerContext context, DeviceRegistration registrationDto, ExecutionResult<String> registrationId) throws Exception {
super.afterDeviceRegistration(context, registrationDto, registrationId);
System.out.println(“after device registration”);
}
}
Thanks a lot in advance for your help!
Cheers, Manu

Hi Manu,

Do you have the Bootstrap class in your project which contains the messaging event handler?

Regards,
Mark

That was the perfect hint! I already added the Bootstrap.java to the project but didn’t compile it. So the class file was not generated. Now it works like a charm! It’s always those little missing bits which makes us grow white hair :smiley:
Thanks!!

Cheers, Manu