Welcome to my website. I am always posting links to photo albums, art, technology and other creations. Everything that you will see on my numerous personal sites is powered by the formVistaTM Website Management Engine.


  • Subscribe to this RSS Feed
  • Debugging Maven Tests by Connecting an IDE to the Maven JVM
    09/10/2015 1:50PM

    In some instances you cannot reproduce a failure or condition running a test in an IDE that manifests itself when you run it on your build server or via maven on the command line.

    In that case, it is very helpful to be able to remotely attach your IDE to the running maven process and then step through the code.

    To do so you will need to:

    Execute maven on  the command line as follows (adding any additional -D args as required by your project):

    $ mvn -Dmaven.surefire.debug test -pl module-in-question

    This will run the maven automatically pausing the JVM awaiting for a remote debugger to connect to port 5005.  If you want to have it listen on a different port you can pass it in as follows:

    $ mvn -Dmaven.surefire.debug="-Xdebug  -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8081 -Xnoagent -Djava.compiler=NONE" test -pl module-in-question

    Create a debugging run profile in either Eclipse or IntelliJ or your favorite IDE configured to connect to a JVM listening on the specified port.

    Then once you have run maven on the command line, simply execute the run configuration in your IDE and debug your application as usual.

    If need be, you can run the maven JVM on the cli such that maven does not fork the tests as follows:

    $ mvnDebug -DforkCount=0 test

  • Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process [SOLVED]
    09/09/2015 10:20AM

    If you are attempting to use jmap or another Java memory analysis tool to connect to a running JVM to generate a heap dump, even when running jmap as the same user as that of the running process, and encounter the following error:

    Attaching to process ID 2712, please wait...
    Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process

    Following is the (likely) solution to your problem.

    It is likely that the ptrace_scope setting for your system is set to a restrictive mode which will not allow another process access to the memory space of the other process.  See this link for more details.

    The fix is to update the setting in /proc/sys/kernel/yama/ptrace_scope.

    First, verify the current setting:

    $ cat /proc/sys/kernel/yama/ptrace_scope

    1, indicates a restricted setting.  To update it so that another process with the same UID can attach to that processes memory space do the following (as root)

    # echo 0 | tee /proc/sys/kernel/yama/ptrace_scope

    Now, checking that value should return 0

    $ cat /proc/sys/kernel/yama/ptrace_scope

    At this point you should now be able to do a heapdump with jmap on your process with a command similar to the following:

    $ jmap -J-d64 -heap 2712

  • Firewall for Ubuntu 14.04 LTS
    09/01/2015 4:16PM

    For whatever reason, Ubuntu 14.04 does not seem to come with a firewall.

    There are however two packages which provide, both a firewall and a handy GUI front-end for it.  UncomplicatedFireWall is the main package (ufw) and the GUI is gufw.

    To install:

    # apt-get install gufw

    This will install the front-end and the dependent packages

    To turn it on:

    # ufw enable

    The default is to block all incoming traffic.

    To update and add your own firewall rules and allow incoming connections

    # gufw

    The GUI is quite intuitive and allows advanced users the ability to create their own custom rules.

  • Possible Remediation for Stagefright Android Vulnerability
    07/27/2015 9:56AM

    By now, everyone is aware of the Stagefright vulnerability in Android.  It isn't as much the name of the vulnerability but a media player library used in Android.

    It seems that one of the ways to remediate the vulnerability is to configure your text messaging application to NOT auto-retrieve Multimedia messages (MMS).  On my phone that is under the Advanced Settings, "Auto-retrieve Automatically retrieve messages".

    The other thing that I did was disable Google Hangouts.  I don't use it on my phone anyway so I probably should have turned it off to begin with.

    If anyone has any other ideas, or corrections to this post, please contact me and I will update it.  (I am in the process of openning up the blog to comments).

  • Hadoop Cluster Sizing Wizard by Hortonworks
    07/13/2015 1:36PM

    Anyone who does any Hadoop development or systems engineering arrives at the "how should I size my cluster" question.

    Hortonworks has a very nice cluster sizing calculator that takes into account the basic use-cases and data profile to help get you started with your hardware requirements.

Advanced Search