shivizard / android-notifier

Automatically exported from code.google.com/p/android-notifier
0 stars 0 forks source link

Error when sending notification to libnotify #574

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
With the latest version of libnotify (0.7.6-1) Android notifier is now unable 
to send notifications to it. Any and all status updates yield an error popup 
stating "An Error while sending notification to libnotify."

When running in terminal this is what it spits out when the error occurs. 

2014-07-22 20:36:30,448 INFO [NotificationManagerImpl] - Notification received: 
notificationId=43705292431777822, type=Battery
2014-07-22 20:36:30,449 ERROR [LibnotifyNotificationBroadcaster] - Error 
sending notification [notificationId=43705292431777822, type=Battery] to 
libnotify
java.io.IOException: invalid null character in command
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023)
    at com.notifier.desktop.notification.broadcast.LibnotifyNotificationBroadcaster.broadcast(LibnotifyNotificationBroadcaster.java:61)
    at com.notifier.desktop.notification.NotificationManagerImpl.doBroadcast(NotificationManagerImpl.java:167)
    at com.notifier.desktop.notification.NotificationManagerImpl.handleNotification(NotificationManagerImpl.java:151)
    at com.notifier.desktop.notification.NotificationManagerImpl.notificationReceived(NotificationManagerImpl.java:88)
    at com.notifier.desktop.notification.wifi.NotificationChannelHandler.messageReceived(NotificationChannelHandler.java:50)
    at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)
    at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:76)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:540)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
    at org.jboss.netty.channel.socket.oio.OioDatagramWorker.run(OioDatagramWorker.java:84)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

Original issue reported on code.google.com by Jfarring...@gmail.com on 23 Jul 2014 at 12:37

GoogleCodeExporter commented 9 years ago
Fixed by using Java 1.6.x any newer version breaks the libnotify messages.

Original comment by d.rammel...@gmail.com on 28 Aug 2014 at 4:07

GoogleCodeExporter commented 9 years ago
Hi, I also have this issue. So, what you're saying is that the only way to 
"fix" it is downgrading Java/installing an older version of Java? I installed 
jre6-compat (on archlinux https://aur.archlinux.org/packages/jre6-compat/) and 
modified /usr/share/android-notifier-desktop/run.sh so that it's launching the 
jar with /opt/java6/jre/bin/java.

Thanks, now it's working, but I would have liked to have a patch to make it 
compatible with java 7 or java 8. Java 6 is not supported by Oracle anymore.

Original comment by pierre.d...@gmail.com on 28 Sep 2014 at 1:42

GoogleCodeExporter commented 9 years ago
Mind putting the modified run.sh up on Git as an unofficial patch?

Original comment by Jfarring...@gmail.com on 28 Sep 2014 at 9:27

GoogleCodeExporter commented 9 years ago
I made the neccessary change in the class LibnotifyNotificationBroadcaster, 
then recompiled only this one, added to the jar and it works beautifully! 
Compiled and tested on ubuntu 14.04.

I've attached the jar. I've only changed that single class file in the jar that 
was included in the .deb installer.

Feel free to use it. But please note: this is an *executable downloaded form 
the internet*. Do every step you can and feel neccessary to verify it doesn't 
do any harm to your system. I recommend virustotal.

Original comment by m...@maerlyn.eu on 18 Oct 2014 at 5:54

Attachments:

GoogleCodeExporter commented 9 years ago
maerlyn.eu, do you mind posting the modified source to 
LibnotifyNotificationBroadcaster? It appears the jar you posted was compiled in 
1.8, so I'll need to recompile targeting 1.7 in order to get it working on my 
system. Java is something I'm not familiar with, so I'd definitely appreciate 
if you could post the changes you made in cleartext. Thanks!

Original comment by brb...@gmail.com on 14 Jan 2015 at 8:41

GoogleCodeExporter commented 9 years ago
Just in case anyone else finds themselves in a similar situation and needs to 
compile it themselves, I've attached the working source to 
LibnotifyNotificationBroadcaster.class. Also attached is a version of the jar 
that will work with Java 1.7.0.

Original comment by brb...@gmail.com on 14 Jan 2015 at 9:40

Attachments:

GoogleCodeExporter commented 9 years ago
Here is the deb repacked with the modified LibnotifyNotificationBroadcaster 
that will work with Java 7. I removed the dependency to 'sun-java6-jre | 
sun-java6-jdk | openjdk-6-jre | openjdk-6-jdk' assuming you can figure out what 
version of Java you want to run on your own.

Original comment by brb...@gmail.com on 19 Jan 2015 at 6:59

Attachments: