Removing contacts from Favorites

If you use an HTC phone (I have the Incredible) and have signed in to Facebook and linked your friends’ Facebook profile with their Google/phone contact, you may have noticed that it can be very difficult to remove a contact from the Favorites group once you have added them. This often means that the contact shows up on your People widget even though you don’t want it to. That’s because you cannot directly edit the group membership of the Facebook contact.

This has led to suggestions involving unlinking, editing the groups, then relinking the contacts. Or even clearing your Facebook account information and re-entering it. However, none of that is necessary.

Just leave the contact linked, and go to People, then Groups (at the bottom), go into the Favorites group (or whatever group you’re having the problem with). Hit the Menu button, then choose “Delete group member”. It will remove the contact, including the Facebook contact, from the group. Problem solved!

Coherence Extend

Are you getting the following error when trying to use a Coherence Extend client?

java.lang.IllegalStateException : SafeCluster has been explicitly stopped or has not been started

You may want to disable the packet publisher on the client (override is tangosol.coherence.tcmp.enabled). To be extra sure, you could even set client’s TTL is set to 0 (which will prevent it from finding clusters on other computers), and if you run the cache server locally you may even want to give it a clusterport that no cluster members use. Why? Because even though Extend clients are supposed to communicate over TCP, in my experience they will try to discover clusters via multicast and, if found, attempt to join them via the usual UDP connection. Particularly when they are run on the same machine as the server.

Coherence “directed query not supported”

Oracle claims that the Coherence API is the same whether or not during runtime it is a full member of the grid or it is an Extend client:

Coherence*ExtendTM clients provide the same rich API support as the standard Coherence API without being full data members of the cluster.ref

While strictly speaking that is true, I am learning the API usage may differ. The latest example I have is the following code, which works fine when run inside (as a full member of) the grid:

InvocationService invocationService = getInvocationService();
Set members = invocationService.getCluster().getMemberSet();
Map<Member, CoherenceMember> memberResults = invocationService.query(  
    new MyCacheDistributionQueryInvocable(), members);

However, when run as an Extend client, this code gives an error that Google as yet can shed no light on:

java.lang.IllegalArgumentException : directed query not supported; the specified Member set must be null

So, the second parameter to InvocationService#query() has to be null, if run as an Extend client. So, the question is now: how do I get information about the individual members of the grid from the Extend client? Or is it even possible? This post may end up being helpful.

Spring AOP requires an ApplicationContext

Having problems getting Spring AOP working? Is your bean being created, but your aspect not running? Is the section on @AspectJ support not helping?

Make sure you check out Section 3.8.1 of the Spring documentation, which says, “if you are using just a plain BeanFactory then a fair amount of support such as transactions and AOP will not take effect (at least not without some extra steps on your part), which could be confusing because nothing will actually be wrong with the configuration.”

Wicket problems & solutions

So, I’m learning a lot about Wicket lately. Here’s a couple things I’ve learned:

If you’re using the CheckBoxTree from the openCDMS, make sure you get the most recent version. The revision linked to in the Google search results is old, and does not include CheckBoxIconPanel.html. It took me a while to realize what the problem was, because Wicket Components will use the HTML file of their superclass if one is not provided. Here’s a link to the most recent version.

Another issue I recently ran into is that an AJAX Component on my page would get redrawn for the first AJAX call, but not for subsequent calls, even though I added it to the AjaxRequestTarget. Looking at the handy in-page Wicket AJAX debug, I saw,

“ERROR: Wicket.Ajax.Call.processComponent: Component with id [[selectedFeaturesContainera]] a was not found while trying to perform markup update. Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update.”

I was indeed calling setOutputMarkupId(true). The problem was actually that I was using a <wicket:container> for that Component. The <wicket:container> was present with the proper id in the HTML of the initial page load, but would not be included in the document replacing it during the AJAX call. As a result, subsequent calls could not find the element to replace.

The solution: use a real HTML element for every element that has setOutputMarkupId(true). Also, remember that if you’re using using id selectors in your stylesheets, you need to be careful of setOutputMarkupId(true) because your id hard-coded in the HTML will get replaced/overwritten by Wicket’s automatically generated id.

Eclipse IAM

If you get this error when launching a Run Configuration in Eclipse with the IAM (Maven) plugin:

Referenced classpath provider does not exist: org.maven.ide.eclipse.launchconfig.classpathProvider

It’s probably because your Run Configuration was created on an old project, and has bad entries in the Classpath section. The solution is to delete the Run Configuration and create a new one.