JDeveloper 11g and Maven

Submitted by Jochus on Thu, 03/01/2013 - 21:06 | Posted in: Java
Posted in

This evening, I played a little bit with Oracle JDeveloper 11g (http://www.oracle.com/technetwork/developer-tools/jdev/overview/index.h…). I'm using Eclipse since 2007 as IDE and I'm very happy with it, but I was wondering how JDeveloper works.

I wanted to import some existing Java projects into my JDeveloper workspace. I'm used to run the $ mvn eclipse:eclipse command to create a .project and .classpath file, but I noticed there's no $ mvn jdeveloper:jdeveloper command. However, after Googling, I found that Trinidad developed a custom plugin which does exactly the same.

To let it work, add the following tag in the pom.xml file:


Then, run the following command:

$ mvn jdev:jdev

This command will create a JDeveloper .jpr project file which you can easily import in JDeveloper.

Deploying to JBoss AS 6.X through Maven

Submitted by Jochus on Wed, 02/01/2013 - 23:40 | Posted in: Java
Posted in

In your POM file, add the following plugin:


In your settings.xml file (which is user dependent), add the following properties:


To deploy, you can execute the command:

$ mvn jboss:hard-deploy
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building my-webapp Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- jboss-maven-plugin:1.5.0:hard-deploy (default-cli) @ my-webapp ---
[INFO] Copying /Users/jochen/Documents/workspace/TestDeployWebapp/my-webapp/target/my-webapp.war to /Applications/jboss-6.1.0.Final/server/default/deploy/my-webapp.war
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.498s
[INFO] Finished at: Wed Jan 02 11:32:48 CET 2013
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------

Touchpad freezes on Medion MD96500

Submitted by Jochus on Mon, 31/12/2012 - 14:03 | Posted in: Windows
Posted in

Today, I had to fix a very old Medion laptop of a friend on which the touchpad stopped working after a while working on the laptop. After booting, the touchpad could be used for +- 5 minutes, but afterwards the only way to move the mouse pointer was by attaching an external USB mouse.

I fixed the issue by installing the following driver: http://www1.medion.de/downloads/download.pl?id=3031&type=treiber&filena…. After a reboot, the touchpad kept working.

Creating a custom JSF deployer in JBoss AS 6.X

Submitted by Jochus on Sun, 30/12/2012 - 18:47 | Posted in: Java
Posted in

JBoss AS 6.X gets shipped with Mojarra 2.0.3 (b5), but I wanted to do some testing with Mojarra 2.0.9. To be able to use this JSF implementation, you need to create a custom JSF deployer:

~ $ cd /Applications/jboss-6.1.0.Final/server/default/deployers/jsf.deployer/
/Applications/jboss-6.1.0.Final/server/default/deployers/jsf.deployer $ mkdir Mojarra-2.0.9
/Applications/jboss-6.1.0.Final/server/default/deployers/jsf.deployer $ cd Mojarra-2.0.9/
/Applications/jboss-6.1.0.Final/server/default/deployers/jsf.deployer/Mojarra-2.0.9 $ mkdir META-INF jsf-libs

In the META-INF folder, create the following file: web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="<a href="http://java.sun.com/xml/ns/javaee"&#10">http://java.sun.com/xml/ns/javaee"&#10</a>;   xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance"&#10">http://www.w3.org/2001/XMLSchema-instance"&#10</a>;   xsi:schemaLocation="<a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a> <a href="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&#10">http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&#10</a>;   version="2.5">
   <!-- ======================== Introduction ============================== -->
   <!-- This document defines default values for the Mojarra-2.0 JSF config  -->
   <!--                                                                      -->
   <!-- WARNING:  Do not configure application-specific resources here!      -->
   <!-- They should go in the "/WEB-INF/web.xml" file in your application.   -->
   <!-- =========== Common Context Params ================================== -->
   <!-- Regular expression to determine if two different URLs actually point -->
   <!-- to the same jar file.  This keeps faces-config files from being      -->
   <!-- read twice.                                                          -->
   <!-- JBossInjectionProvider provides resource injection for managed beans. -->
   <!-- See JSF 1.2 spec section 5.4 for details.                             -->
   <!-- ================== Common filter Configuration ==================== -->
   <!-- ================== Common Listener Configuration ==================== -->
   <!-- Configures JSF 2.0 -->

In jsf-libs:

  • Copy the file jboss-faces.jar from the 2.0.3 folder
  • Download the JSF libraries from: http://javaserverfaces.java.net/download.html
  • This should result in something as:
    /Applications/jboss-6.1.0.Final/server/default/deployers/jsf.deployer/Mojarra-2.0.9/jsf-libs $ ls -al
    total 4952
    drwxr-xr-x  5 jochen  staff      170 Nov  7 16:58 .
    drwxr-xr-x  4 jochen  staff      136 Nov  7 16:44 ..
    -rw-r--r--@ 1 jochen  staff     6148 Nov  7 16:58 .DS_Store
    -rw-r--r--@ 1 jochen  staff  2502592 Nov  7 16:45 javax.faces-2.0.9.jar
    -rw-rw-r--@ 1 jochen  staff    21804 Aug 16  2011 jboss-faces.jar

Open the file: /Applications/jboss-6.1.0.Final/server/default/deployers/jsf.deployer/META-INF/jsf-integration-deployer-jboss-beans.xml:

  • Extend the property jsfConfigurations:
        <property name="jsfConfigurations">
          <map keyClass="java.lang.String" valueClass="java.lang.String">
  • Add the following bean:
      <bean name="JSFUrlIntegrationDeployer-209" class="org.jboss.jsf.deployer.JSFUrlIntegrationDeployer">
        <property name="JSFConfigName">
        <property name="JSFImplManagementDeployer">
          <inject bean="JSFImplManagementDeployer"/>

Finally, to let your web application use the correct JSF deployer, make a reference in your WEB-INF/web.xml of your application (using the context-param: org.jboss.jbossfaces.JSF_CONFIG_NAME) :


Enabling syntax highlighting in vim

Submitted by Jochus on Thu, 27/12/2012 - 22:24 | Posted in: Mac
Posted in

$ cd /usr/share/vim
$ sudo vim vimrc

Add the following lines below: set backspace=2

set ai                  " auto indenting
set history=100         " keep 100 lines of history
set ruler               " show the cursor position
syntax on               " syntax highlighting
set hlsearch            " highlight the last searched term
filetype plugin on      " use the file type plugins
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif

Creating a Java heapdump in JBoss AS 6.x

Submitted by Jochus on Wed, 12/12/2012 - 23:12 | Posted in: Java
Posted in

If you want to create a heapdump from your application running in a JBoss AS 6.X J2EE container, you can easily perform the dump operation by some MBean in the JMX console.

  • Browse to: http://localhost:8080/jmx-console/
  • Search for com.sun.management and click on type=HotSpotDiagnostic
  • Scroll to the bottom of the page and provide the parameter /tmp/heap.dump in the textfield p0, which is actually the location to which the dump will be written. If you want to perform a garbage collection before dumping, leave p1 on value true
  • Push the button Invoke. A dump file will be available at /tmp/heap.dump. This file can easily be viewed by a tool like Java VisualVM

Also, remember that you can easily create a heap dump automatically when JBoss is going OutOfMemory. Just add the following Java arguments in your run.conf file

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heap.dump

How to re-enable the Apple-provided Java SE 6 applet plug-in

Submitted by Jochus on Mon, 10/12/2012 - 15:08 | Posted in: Mac
Posted in

After the latest Java update on Mac OS X 10.7, I was unable to use the Java plugin in my Chrome browser (I'm not really into Java applets, but the Java applet in JIRA to attach screenshots is very easy and useful to use in combination with Cmd + Shift + 4 buttons).

To fix this issue, follow the steps written below:

  • Open Terminal, located in the Utilities folder.
  • Enter this command, then press the Return or Enter key:
    $ sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
  • Enter this command, then press the Return or Enter key:
    $ sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
  • Enter this command, then press the Return or Enter key:
    $ sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plug

Source: http://support.apple.com/kb/HT5559

FCCU virus verwijderen

Submitted by Jochus on Sat, 08/12/2012 - 19:29 | Posted in: Windows
Posted in

Gisterenavond bij iemand langs geweest omdat die het bovenstaande scherm kreeg. De PC zit volledig blok, je kan nergens meer naar toe. Zelfs via "Veilige modus" lukte het niet meer.

Hardnekkig virus/malware, maar ik heb het er op deze manier afgekregen:

  • Download Windows Offline Defender en maak een startup cd/dvd of usb stick
  • Start daarna de pc op met de Windows Offline Defender disk
  • Scan u computer op malware met de Windows Offline Defender software
  • Herstart uw PC en kies voor een normale startup. Het virus zal nu niet meer opkomen, maar het is wel nog steeds aanwezig op de PC
  • Scan daarna u computer met MalwareBytes AntiMalware om het FCCU virus te verwijderen of te detecteren
  • Scan nogmaals met ComboFix! om deze malware nog dieper te detecteren en te verwijderen

Windows Offline Defender en MalwareBytes hebben er voor gezorgd dat de PC terug "vrij" kwam.
De ComboFix! heeft de "Veilig modus" terug hersteld.

... geef mij toch Mac OS X :-) ...