Category: Java

  • IntelliJ IDEA: Pass M2_HOME to the IDE on OS X Yosemite

    , ,

    I had issues in Yosemite with IntelliJ always complaining that it couldn’t see my M2_HOME variable, even though I had it in my .bash_profile.  Turns out that only works in the terminal. In any case, this worked — I verified it on my Mac, which runs v10.10.5. 1. Save this plist in ~/Library/LaunchAgents/ as custom.startup.plist…

  • Debugging the dreaded “SEVERE: Error listenerStart” and “SEVERE: Error filterStart” Tomcat error messages

    The solution is to add a logging.properties file inside WEB-INF/classes with the following: org.apache.catalina.core.ContainerBase.[Catalina].level = INFOorg.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler Source: Debugging the dreaded “SEVERE: Error listenerStart” and “SEVERE: Error filterStart” tomcat error messages « Trifork Blog / Trifork: Enterprise Java, Open Source, software solutions

  • Fix for JAVA_HOME variable in OS X Yosemite

    ,

    In case you upgraded to OS X Yosemite and your JAVA_HOME variable in bash_profile no longer works, change/add the following: export JAVA_HOME=`/usr/libexec/java_home -v 1.7` Then, run source ~/.bash_profile and it should work from there.

  • Java: Concatenate a string before the last occurrence of any character

    private String addToString(String source, char separator, String toBeInserted) { int index = source.lastIndexOf(separator); if(index >= 0 && index < source.length()) return source.substring(0, index) + toBeInserted + source.substring(index); else return null; }

  • CXF logging via interceptors

    In case you need to see what you’re passing to a web service via CXF, add the following in you web client XML (i.e. cucumber.xml): <property name=”inInterceptors”> <util:list> <bean class=”org.apache.cxf.interceptor.LoggingInInterceptor”/> </util:list> </property> <property name=”outInterceptors”> <util:list> <bean class=”org.apache.cxf.interceptor.LoggingOutInterceptor”/> </util:list> </property>

  • Accepted boolean XML inputs

    ,

    Adding for archival purposes: http://xformsinstitute.com/essentials/browse/re45.php true, 1, false, 0 are valid.