Spark tray icon is not recreated when Windows Explorer restarts

I’m still not convinced this is a Spark problem. This maybe a video driver issue or how WDM talks with video driver, etc. I see that your Spark icon is distorted. But you are using the latest nightly build version, the beta? I’ve noticed that Spark icon is sometimes distorted on some of our machines at work, though OS is the same, but now i think it could be different video card and drivers. Will try to kill explorer on those machines and see if Spark tray icon vanishes. It would be hard to find the real key to this problem.

This would be not the first and only mystic problem with Spark. Aside the sometimes distorted icon. I have seen many reports on the forums and now i notice in my own deployment that sometimes Spark locks up and users can’t see they messages going out, though they are sent. Spark restart helps. I have never experienced this myself on 4 different PCs and 2 OSes in 7 years. And yet it happens to say 5% of my 220 PCs deployment. I thought it should be related to resources and it mostly happens on old PCs with Vista, but it happened on a fast i3 PC with Win7. And i’m using same PC at work for two years and Spark is working fine…

video card or system-related issue is a good possibility… since code is in spark to put the icon there in the sys tray.

i’ve personally witnessed the issue you are talking about wroot - where a user suddenly can’t see outgoing messages so they hit the “enter” or send button multiple times (causing the receiving party to get annoyed lol). Restart of spark fixes and i’ve always chalked it up to bizzare system behavior (some of our system are still win 2000!!!). It’s never happened to me before, always another user somewhere.

Tom, if you know some code, and wanna give this a crack - it may be the best bet to fix this since I’m not able to replicate for whatever reason. Your OP had a link to msdn which looks like either C++ or C# – C# is quite similar to Java in many ways (differs in many ways too lol), but if you poke around maybe you can find an issue? I linked to the classes I found that handle the sys tray icons somewhere in this thread :stuck_out_tongue_winking_eye:

Are you using the embedded jre with spark, or the system’s jre? if the embedded, perhaps try swapping it out for a java 7 jre. Just grab the jre7 directory from your Program Files, then copy it into the Spark folder, rename the current jre to something else, then rename jre7 directory to jre. restart spark and try it out.

I installed the JRE separately, because the installer failed to download it. Apparently it was using an old URL (something at jivesoftware.com) that was redirected to the igniterealtime.org homepage.

PS: what do you mean that spark cannot use jre 7 anyays? jre7 actually fixes some bugs that were java related and not spark related, such as the window focus being stolen when a new message was sent to you, etc.

Well, I remember that last time I installed Spark 2.6.3 (the stable release) while having only JRE 7 installed, it complained that it needed version 5 or 6. So I didn’t even bother to try again with JRE 7…

I’m still not convinced this is a Spark problem. This maybe a video driver issue or how WDM talks with video driver, etc.

It doesn’t seem very likely to me. A video driver issue would cause rendering issues, but in this case the icon isn’t there at all, it’s not just a rendering problem.

But you are using the latest nightly build version, the beta?

I used the version that Jason linked to in his first answer:

Log in as a Bamboo user - IgniteRealtime Bamboo l4j/

BTW, this version seems to have another bug. Every few hours it disconnects and fails to reconnect automatically. If I try to force it to reconnect, it returns to the login screen. I’ve never seen this behavior on the stable 2.6.3

I may have linked you to an artifact that is… less-than-stable.

try the latest (again lol): http://bamboo.igniterealtime.org/artifact/SPARK-INSTALL4J/JOB1/build-600/Install 4j/spark_2_6_3_12555.exe

Wroot - do you know which jre version is bundled with the nightlies/beta builds? Are we on jre7 now or still jre6 for these?

Ah I see – yes, Spark is being moved to jre7. Although, I don’t recall ever seeing it complain about j7 being used… but then again, I always do the embedded jre install version, even for my custom in-house builds as this can garuntee me that all deployments will behave more-or-less similar (no shocker discovery at user system - “your system is using jre5 and i’ve just troubleshot your system for an hour for no reason, update java!” lol).

EDIT: So it sounds like you are using the system’s jre. is this the oracle jre or some other? I could be wrong, but I think Install4j embedds the oracle jre…

Message was edited by: Jason

Jason wrote:

Tom, if you know some code, and wanna give this a crack - it may be the best bet to fix this since I’m not able to replicate for whatever reason. Your OP had a link to msdn which looks like either C++ or C# – C# is quite similar to Java in many ways (differs in many ways too lol), but if you poke around maybe you can find an issue? I linked to the classes I found that handle the sys tray icons somewhere in this thread :stuck_out_tongue_winking_eye:

The code sample is actually in C (the Win32 API is in C).

My language of choice is C#, but I know a bit of Java, so I had a look at the SysTrayPlugin class. There doesn’t seem to be anything related to recreating the icon when Explorer restarts. This must be handled at a lower level, probably in the TrayIcon or SystemTray classes. In this case the bug wouldn’t be in Spark but in AWT…

596 build is not different from 600 in stability. After reading recent comments i’m not sure what version is used. I hope Tom is testing with the version you linked in the last message, Jason. I mean with the embedded jre (which is 7 and Spark is ok with that). Then we will be on the same page. I haven’t seen or experienced the disconnect issue either. The only thing i can think of it’s maybe an xmpp.client.idle system property. I have it set to 60000 (10 minutes), because Exodus client (which we used before) was disconnecting often. This client wasn’t sending keep alive packets or ping normally. But it wasn’t affecting Spark at that time. At home i have it at -1 (which means no disconnecting of idle sessions). Spark works fine in both cases.

Ok, i have narrowed down the problem.

If you have Java 6 installed on your system, then Spark will load with that Java version and won’t use either installed Java 7 on the system or the embedded one Java 7. Probably this is happening because of backwards compatibility for Java 6 still left in Spark. So when Spark starts it still searches for Java 6 and as it founds it, it loads Spark with that version. So the focus stealing bug is there and also tray icon distortion and tray icon isn’t repopulating after the explorer restart. Maybe this disconnection issue is related too as it runs new Spark code with older Java, though we haven’t experienced that. A few people at our company still have Java 6 installed to run some old CMS system, and they have those issues, but not the disconnection one.

Solution: remove Java 6 from the system if you don’t need it. If you need it, then you can only wait till Spark drops Java 6 support completely, which should have been done long time ago. Don’t know how hard it is, but at least i will file a ticket for that. Java 6 is long end of life and i think it is safe to drop support for that buggy mess of software in the current nightly builds and for the future 2.7.0.

SPARK-1545

Awesome! I removed Java 6 and installed this build:

http://bamboo.igniterealtime.org/browse/SPARK-INSTALL4J-596/artifact/JOB1/Instal l4j/

And now it works fine: the icon is recreated when Explorer restarts, and it also looks much better.

BTW, I also found this bug that confirms the problem was in AWT

Thanks both of you for your help!

1 Like

OK, perhaps I was a bit quick to rejoice… The build I installed is still a beta, and it has the disconnection bug, which is worse than the tray icon bug

So I’m back to stable 2.6.3 with Java 6 (I tried removing Java 6 after installing Spark, but then it fails to launch)

2.6.3 was still relaying on java6, so it can’t work with java7. As this disconnect issue is not easily recreated, it won’t be fixed fast. Have you tried that setting for idle clients?

Not yet; I won’t have time today, so I’ll try it on Monday

id support dropping of j6 - i think we just need to update build script and starter scripts and the like to simply not allow spark to build or run on < version 7. however, j7 does appear to have dropped “support” for < Windows XP (and oddly enough server 2k3 is not listed either). This doesn’t necessarily mean j7 won’t install/run on systems < XP, but it’s just not officially supported. In fairness though, systems < XP have been EOL for a very long while, and XP gets it’s EOL June 2014 I believe…

hmm… if it’s a bug in Swing or AWT, then this, as you said, would be a jre issue. Wroot’s likely right that this is an old JRE issue – as we’ve run into that before with several things running on j6. Wroot mentioned the biggest ones, and i’m sure there may be more. Swing and AWT have always been a little… uh… strange at times.

I have been using Spark on XP SP3 with Java7 just last year and we have a few older PCs at work with XP and Java 7 is running fine. I guess they only dropped the support for XP, though maybe it will stop working at some point. Will get rid of these PCs in a few months.

XP will be EOL on 2014 April.

I was referring to my PITA Windows 2000 workstation problem (lol?)

Win 2000 is gone from the list of “officially supported” systems for the JRE7 on Oracle’s site. Off the top of my head, I’m not sure if it actually still installs (I’d think it would) –

Wow, didn’t know it was April… even sooner than I thought…

oh, didn’t even see this post until now (darn threaded view!!! lol) – nice find on the AWT bug

Threaded view is confusing, but it’s not the case. His post contains links and it has to be approved by moderator (by me ), but you don’t get notification about such posts even after approval.