Method Call in handleCommand

48 views
Skip to first unread message

JohannesR

unread,
Aug 5, 2015, 8:18:34 AM8/5/15
to openhab2
Hi Community again its me ;)

I want to call a method in my handleCommand method in the Handler class. but I always get a TimeoutException.
Even if the method is empty, is there a problem with calling methods in the handleCommand?

-------------------------------------Console-----------------------------------------

CONNECT/dev/tty.usbserial-fd12

2015-08-05 14:14:26 [ERROR] [.s.c.i.events.OSGiEventManager:173  ] - Dispatching event to subscriber 'org.eclipse.smarthome.core.events.EventSubscriber' timed out.java.util.concurrent.TimeoutException: null

at java.util.concurrent.FutureTask.get(FutureTask.java:205)

at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchrnous(SafeMethodCaller.java:158)

at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:75)

at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:59)

at org.eclipse.smarthome.core.internal.events.OSGiEventManager.dispatchESHEvent(OSGiEventManager.java:163)

at org.eclipse.smarthome.core.internal.events.OSGiEventManager.handleEvent(OSGiEventManager.java:138)

at org.eclipse.smarthome.core.internal.events.OSGiEventManager.handleEvent(OSGiEventManager.java:122)

at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)

at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)

at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)


2015-08-05 14:14:26 [INFO ] [arthome.event.ItemCommandEvent:43   ] - Item 'uvr2_inputs_70e61686_input1' received command ON

2015-08-05 14:14:26 [ERROR] [.c.thing.internal.ThingManager:259  ] - Exception occured while calling handler: nulljava.util.concurrent.TimeoutException: null

at java.util.concurrent.FutureTask.get(FutureTask.java:205)

at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchrnous(SafeMethodCaller.java:158)

at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:75)

at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:59)

at org.eclipse.smarthome.core.thing.internal.ThingManager.receiveCommand(ThingManager.java:251)

at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:46)

at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:167)

at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:1)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)


-----------Code-----------

@Override

    public void handleCommand(ChannelUID channelUID, Command command) {

       if (channelUID.getId().equals(INPUT_1)) {

           // String portName = (String) getThing().getConfiguration()

           // .get(uvr2BindingConstants.CONFIG_PARAMETER_SERIAL_PORT);

           System.out.println("CONNECT" + portName);

           request();

       }

   }




Kai Kreuzer

unread,
Aug 5, 2015, 8:45:17 AM8/5/15
to open...@googlegroups.com
Hi Johannes,

There is a timeout of 5 seconds on these calls - but this timeout only means that the ERROR is logged to highlight that there seems to be a performance issue in your code. It should be nonetheless further executed, even if it takes longer than 5 seconds.

Even if the method is empty,

Are you sure? If the method returns immediately (and you do not cause it to stop with the debugger), this message should definitely not appear.

Regards,
Kai


--
You received this message because you are subscribed to the Google Groups "openhab2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/8bcf49c7-b9a6-4d45-9f58-13e8b5e1737f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

JohannesR

unread,
Aug 6, 2015, 5:38:09 PM8/6/15
to openhab2
I am so sorry, the problem were the breakpoints ;) after i disabled them there was no problem at all ;)
So Problem fixed again. Thanks!
Reply all
Reply to author
Forward
0 new messages