Posted 10 months ago

VisualVM and local processes

There is a not so rare problem with VisualVM, Oracles monitoring tool for Java processes. On some occasions VisualVM brings an error message on startup, stating it wouldn’t be able to monitor local Java applications. It immediately provides an URL with a proposal to resolve the problem (http://java.net/projects/visualvm/content/troubleshooting.html#jpswin2). The troubleshooting article points to the fact, that on Windows the useraccountnames are not case sensitive, which causes some confusion with the internal performance monitoring. The article claims it should be sufficient ta make sure the %TMP%\hsperfdata_UserName is capitalized.

To make it short: this didn’t work for me in that form, since my folder was already capitalized and it took me some googling for resource to help me troubleshoot this.

Anyway I did solve the problem by running this small Java-program (remember, you will have to include several libs from the VisualVm installation folder) which creates the helpful output — I do log on with a camelcased account, but an all lowercased is expected… m)


import java.io.File;
import java.io.IOException;

import org.openide.util.NbBundle;

import com.sun.tools.visualvm.core.ui.DesktopUtils;
import com.sun.tools.visualvm.jvmstat.application.JvmstatApplicationProvider;

public class EnvTest {

  public static void main(String[] args) throws IOException {
    String perf = "hsperfdata_" + System.getProperty("user.name");
    File perfCorrect = new File(System.getProperty("java.io.tmpdir"), perf);
    File perfCurrent = perfCorrect.getCanonicalFile();
    System.out.println("current: "+perfCurrent.getAbsolutePath());
    System.out.println("expected: "+perfCorrect.getAbsolutePath());
    if (!perfCorrect.getName().equals(perfCurrent.getName())) {
      String link = 
          DesktopUtils.isBrowseAvailable() ?
          NbBundle.getMessage(JvmstatApplicationProvider.class, "MSG_Broken_Jps2_Link") :
          NbBundle.getMessage(JvmstatApplicationProvider.class, "MSG_Broken_Jsp2_NoLink");
          String message = 
NbBundle.getMessage(JvmstatApplicationProvider.class, "MSG_Broken_Jps2", link); System.out.println(message); } } }


BTW: The neccessary libs are 

%JAVA_HOME%/lib/visualvm/visualvm/modules/com-sun-tools-visualvm-core.jar
%JAVA_HOME%/lib/visualvm/visualvm/modules/com-sun-tools-visualvm-jvmstat.jar
%JAVA_HOME%/lib/visualvm/platform/lib/org-openide-util.jar
%JAVA_HOME%/lib/visualvm/platform/lib/org-openide-modules.jar
%JAVA_HOME%/lib/visualvm/platform/lib/org-openide-util-lookup.jar

Posted 1 year ago

Zwei Dinge übers iPad

Ich habe gerade zwei wichtige Dinge über mein iPad gelernt:

  1. Präsentationen, die Du mit Powerpoint unter Windows erstellt hast, kannste in Keynote auf dem iPad vergessen.
  2. Das Glas des iPads ist nicht unzerstörbar.

Das Keynote meine Animationen versaut kann man reparieren (werd ich aber nicht! Die Bedienung saugt).
Aber die Kratzer nerven… Sind zwar klein, aber jetzt wo ich weiß, das sie da sind, könnte ich kotzen!

Posted 2 years ago

Fritz!Box, Mac und VPN

Ich hab neulich versucht mich von meinem MacBook per VPN auf meine Fritz!Box zu Hause zu verbinden.

Das stellte sich komplizierter dar als gedacht.

AVM stellt unter http://www.avm.de/de/Service/Service-Portale/Service-Portal/VPN_Interoperabilitaet/15451.php?portal=VPN eine ausführliche Anleitung bereit, es ist jedoch nicht einfach zu testen, ob die Operation erfolgreich war.

Das in der Anleitung verwendete IPSecuritas erbrachte mir nämlich stets einen Fehler
Error APP Tunnel creation failed with errno 17
und verweigerte den Verbindungsaufbau.
Googlen nach dem Fehler erbringt einige Forenthreads, aber leider keine echte Beschreibung der Fehlerursache. Der Code 17 repräsentiert offenbar einen allgemeinen unspezifischen Fehler.

Die Lösung ist dabei leider sehr einfach.
Naiverweise testete ich die erzeugten Konfigurationen zu Hause in meinem lokalen WLAN, mit der IP, die mir meine Fritz!Box zugewiesen hatte. Die gleiche Fritz!box, auf die ich mich remote verbinden wollte.
Klingelt’s schon?
Das kann natürlich nicht ohne weiteres Funktionieren, wenn man einen Tunnel in sich selbst aufbauen möchte.

Testen sollte man also tunlichst aus einem anderen Netz heraus, das andere IP-Adressen verteilt als die Fritz!Box zu der man sich verbinden möchte.

Posted 2 years ago

Immer wenn man denkt “Dümmer geht’s nicht mehr!”, kommt von irgendwo ein Spammer her. Ist aber vom Niveau her schon glaubhaft… 

Posted 2 years ago

Drools 5 with Eclipse 3.5 [updated]

Nearly went mad when I tried to set up a testing environment for Drools 5 with Eclipse 3.5.
I planned to build and to resolve the dependencies with maven. Actually it was already a pain to figure out which dependencies I had to pick to use the new Drools 5. JBoss is driving me crazy with their new project structure.

Turned out, it was easier to download the binaries at JBoss and actually read the provided README… (no comment please). Which is the way I hereby recommend.

Pro tip: use Janino as compiler by adding it to your pom.xml (see the mentioned readme for the required version). This prevents strange compiler errors, complaining about the Eclipse JDT Core jar not being present in the classpath. I prefer Janino over Eclipse JDT, because of having a Maven-repo.

Just in case I forget it again: The necessary VM-parameter is -Ddrools.dialect.java.compiler=JANINO

[update] It seems that you actually have to pass the compiler setting via a configfile. One way is to create a drools.packagebuilder.conf file in META-INF (ordinary properties-syntax) to hold the compiler setting. The KnowledgeBuilder has an auto-discovery for this directory. [/update]

Posted 2 years ago

Pastes - Pastie

something inspiring at every visit

Posted 2 years ago

jna: Java Native Access (JNA): Pure Java access to native libraries

looks promising. have to test this vs JNI. awaiting my next mutltimedia-project… :)

Posted via web from dergilm’s posterous | Comment »