Tuesday, September 13, 2011

mvn eclipse:eclipse Request to merge when 'filtering' is not identical

To setup the eclipse IDE environment for a Maven project, I would typically use the following command:

mvn eclipse:eclipse

However, I received the following error:


[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Request to merge when 'filtering' is not identical. Original=resource src/main/resources: output=target/classes, include=[atlassian-plugin.xml], exclude=[**/*.java], test=false, filtering=true, merging with=resource src/main/resources: output=target/classes, include=[], exclude=[atlassian-plugin.xml|**/*.java], test=false, filtering=false
[INFO] ------------------------------------------------------------------------

It turns out there's bug with the latest version of the eclipse plugin for maven.
The workaround was to use:

mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse
References:
http://forums.atlassian.com/thread.jspa?threadID=34952

Wednesday, September 7, 2011

IE likes to cache ajax responses

To disable caching of ajax responses in IE when using jQuery use the following:

$.ajax({
  url: "./chat.php?type=json",
  cache: false,
  dataType: "json",
  success: function(data) {
    // Go do this, go do that…
}});


References:

http://i.justrealized.com/2008/jquerys-getjson-failing-randomly-in-internet-explorer

Sunday, August 7, 2011

grails detecting dependency conflicts

To find out what kind of dependency conflicts you might have in your grails application execute the following:


grails dependency-report

A conflict resulted when I had different versions of the slf4j api

Refernece: http://www.grails.org/doc/latest/ref/Command%20Line/dependency-report.html

grails No thread-bound request found

When attempting to save a Domain object outside of a web request (which is running in a forked thread),
I received the following error message:

No thread-bound request found

This has something to do with Grails thinking that the Domain object is a Command object, which is not true.

To workaround this issue, I  had to make some changes in the controller where the binding of the form parameters takes place.

Previously, I would bind parameters as follows:

def save = { MiddlewareCase mCase ->

...
       
}

Now to avoid the error, I do the following:

def save = { 
        
        // IMPORTANT!!! Must bind this way or we get "No thread-bound request found"        
        MiddlewareCase mCase = new MiddlewareCase();
        bindData(mCase, params)

}

Sunday, July 31, 2011

sshj could not load keys

Needed to include bouncy castle in maven dependencies:



         
   
        org.bouncycastle
        bcprov-jdk16
        1.45
   
     
     
   
        net.schmizz
        sshj
        0.3.0
   

apache httpd forbidden selinux

I had an issue where a folder that I was trying to share on the web was not accessible resulting in FORBIDDEN.

It turns out that SELinux policies in Linux were preventing access. To enable it use the following:

/usr/sbin/setsebool -P httpd_disable_trans 1
/etc/init.d/httpd restart