SOAP/SAAJ/XML Issues When Migrating to Java 6 (with Axis 1.2)
As mentioned on Spring pages:
Java 1.6 ships with SAAJ 1.3, JAXB 2.0, and JAXP 1.4 (a custom version of Xerces and Xalan). Overriding these libraries by putting different version on the classpath will result in various classloading issues, or exceptions in org.apache.xml.serializer.ToXMLSAXHandler. The only option for using more recent versions is to put the newer version in the endorsed directory (see above).Fortunately, there is a simple solution, at least for Axis 1.2.
Continue reading →
If You Don't Use Pair Programming and Code Reviews as Teaching Tools You Waste Money
Continue reading →
Knowing I'm Bad Programmer Makes Me Good Programmer
Continue reading →
Tip: Enable a shortcut for Occurrences in File in Eclipse under Gnome (default C+S+u)
Continue reading →
Most interesting links of October
- About dying JCP and too silent Oracle (or mostly silent) - a summary of the latest issues and hot topics in the Java community that cause lot of rumor but still no reaction from Oracle including the criticism of JCP and its proclaimed decline. Update 11/1: The article about IBM, Oracle and OpenJDK has links to many related resources and a section on JCP future.
- A fair evaluation of TDD - Test driven development at Transloadit ("honest assessment of the beauty and pain of tdd" - Kent Beck) - according to the author, TDD requires a lot of discipline and is a pain to do but it really pays off if your risks are high, basically it's something like an insurance - there are people living without it but to some it can save life. I miss there a thing I find essential about good test coverage - namely that it forces you to write a better code (more modular, following the single responsibility principle etc.).
- Dear Javascript Guru: Please Stop Using The Hash Symbol For No-Op HREFs - don't use href="#" for it modifies the browsing history and makes the browser scroll to the top. Prefer <a href="javascript:void(0);" ... > or just use the javascript: protocol for a function call that returns false (you can force it like this: <a href="javascript:doSomething(); void(0);">).
- Why Hibernate 4 switches to Gradle instead of Maven 3 - "a means to describe the issues and frustrations I have seen in my 2.5+ years of using Maven for Hibernate builds; in many cases the cause is simply an assumption or concept in Maven itself which did not line up cleanly with how I wanted to do build stuff in Hibernate." The main issues were that Hibernate is a very specific project, which doesn't line up very well with the Maven philosophy and, at the same time, Maven is very strict at forcing it and not really flexible to accommodate to unusual needs (and if Maven is, its plugin often aren't). For example Hibernate is composed of modules that depend on each other while Maven really supports only an aggregation of independent projects. Also, "the release plugin is completely worthless". On the other hand, Gradle is very flexible and - among others - offers powerful scripting, doesn't enforce its way of doing things at all cost (i.e. directory structure), let you also define dependencies on tasks, modules, directories, etc.
- Flot - JavaScript plotting library for jQuery, which has replaced Flash at WordPress.com (so it must be really good!) for blog statistics visualization. Main points: simple usage (all settings are optional), attractive looks and interactive features like zooming and mouse tracking. Really nice one! Check Flot examples.
- String Concatenation Performance vs. String Builder/Buffer and how Liferay 6 achieved a speedup by not using S.B. [that much] - StringBuilder/Buffer has lot of overhead and thus String.concat or custom code can be faster sometimes. Also see the linked ticket, esp. the comment 'most javac will try to translate "+" to StringBuilder whenever possible. So if you do need to use String.concate(), you'd better use it explicitly.'
- Paul Graham - Beating the Averages - why it's good to learn Lisp. (Because it makes you able to see the limitations of you current language as it's most likely superior to it - among others thanks to Lisp macros.) A really good essay on the power of programming languages, which has persuaded me about some year ago, when I've originally read it, to learn Clojure (a modern Lisp dialect running on the JVM).
Continue reading →
Tip: Retrieving server certificate used in SSL communication (e.g. POP3s)
Continue reading →
Most interesting links of September
- The Open-Closed Principle , i.e. open to extension, closed to modification - one of the basic principles in OOP underlying many best practices such as "make all member variables private" nicely explained, with code samples with and without O/CP applied. Noteworthy: The principle is implemented with abstractions (abstract classes defining the constant part with subclasses being the extensions). You can't "close" your design against all changes and must thus choose the ones that are more likely, i.e. create a "strategic closure".
- Java EE 6 xor Spring by A. Bien - the main difference is in the philosophy behind - Java EE is based on Convention over Configuration. The decision factor is usually the support policy, though. Also the tc Server is certainly better than a "custom" Tomcat with Spring.
- ThoughtWorks Technology Radar - to help decision-makers from CIOs to developers understand emerging technologies and trends that affect the market today; though their assignment of GWT under hold is disputable (http://www.dzone.com/links/r/thoughtworks_radar_demystified_gwt.html); TW answers: "As it turned out the conciseness of the text didn’t allow us to adequately make our points so that they were not misunderstood. We are interested in a discussion but our opinion about the suitability and usability of GWT has still not changed."
- JavaScript as a 1st-class language w/ the same best practices (unit t., refact.,...); functional languages (Clojure > Scala)
- WS-* beyond the basic profile, GWT, RIA on hold
- "Agile Business" for a startup with "Virtual Assistants": outsource (to an "Virtual Assistant") what you can, only do what's necessary at the time even if that means doing manually (outsourced) st. that could be automated; this helped to decrease time from 160 MH to 10 MH. "The lesson is that before you launch your product, think about the processes you can avoid automating. How about reminder emails? How about monthly billing? Could a human being run a report once a month and send emails or charge credit cards?" , "Every hour spent writing code is wasted time if that code could be replaced by a human being doing the same task until your product proves itself."
- InMemProfiler: Identifying Memory Allocators - tool to track memory allocation capable of attributing it to the classes (i.e. packages) of interest without blurring the results with char[] and all the java.lang.* classes
- Easy Performance Analysis with AppDynamics Lite - I'm fond of performance troubleshooting tools and AppDynamics Lite looks really cool. The post includes two very short yet very informative and nice screencast showing its installation and usage. App. D. automatically discovers Struts actions, JDBC calls, webservices etc. and captures slow operations with the necessary details; this is quite similar to what the open-source Glassbox.com does. The monitoring web UI is very nice and user friendly. See the white box on the right side at http://www.appdynamics.com/lite.php to see what JVMs, ASs and frameworks it supports. Check also the comparison of the lite and standard versions (max 30 transactions, max 2 hours if diagnostics data, ...).
- Google Relaunches Instantiations Developer Tools - Now Available for Free - incl. the static code analysis tool (Eclipse plugin) CodePro AnalytiX
- A blog about Terracota's new BigMemory (commercial) claims that 64b JVM with heap over few GB may be a nightmare - "... not all people know about 64-bit JVMs and the nightmare these things can cause. Contrary to what other vendors are claiming, most shops such as Unibet, PartyPoker, Expedia, Sabre Holdings, Intercontinental Hotels Group, JP Morgan, Goldman, and more will tell you a 64-bit JVM pauses unpredictably and for minutes at a time. even when a 64 bit JVM is small (<2GB) it takes 30+% more RAM than a 32-bit equivalent JVM running under the same app."
- Presentation Real Software Engineering by Glenn Vanderburg - the talk is pretty interesting and I recommend it. Few, subjectively selected and interpreted points: The SW engineering as taught in universities doesn't work, it's actually a caricature of "engineering" (that is, established practices that work). The reason is that SwE is unreasonably fascinated by (ideally mathematical) modeling and precise, repeatable processes. This is not how real SW development can or does work. Given the complexity and uncertainty, an empirical process, based on frequent feedback and continual adjustment, is much more suitable. Also we don't need complex models because prototyping and testing is nearly "free", compared e.g. to spacecraft engineering. And with BDD and tools like RSpec and FitNesse we may have both readable and executable specifications - the code becomes the model.
- Monte Carlo Analysis of the Zero Defect Mentality of TDD - conclusion: TDD pays off in the long run even though being slower [learning curve; 0-value bringing defect fixing] Fow short life time, TDD may be not worth it. Don't argue, simulate :-)
Continue reading →
The power of batching or speeding JDBC by 100
Continue reading →
Exposing a POJO as a JMX MBean easily with Spring
I needed to monitor a command-line java application using Spring 2.5 on IBM JVM 1.4 1.5 running on a server with a jconsole on Sun JVM 1.6 as the JMX client on my PC.
Continue reading →
Implementing retrial with a MDB or an MQ batch job? (WAS 7, MQ 6)
Continue reading →
SSH magic: Authorize only once for multiple ssh/scp invocations
Continue reading →
Jetty-maven-plugin: Running a webapp with a DataSource and security
Continue reading →
Most interesting links of August
- Working With Static Imports in Eclipse - how to make working with static imports (nearly) as easy as with the normal ones (especially useful for fluent interfaces and "DSLs"), mainly by adding types like JUnit's Assert and Mockito to your favorite imports and setting Eclipse to always generate static imports in the form <type>.*
- 5 things you didn't know about ... Java Database Connectivity - it was interesting to learn that JDBC specifies some scalar functions that drivers may support and translate into the DB's language such as "{CURRENT_DATE()}"; for common functions supported by most drivers this should make your implementation more portable
- Four Things to Remember about java.lang.String - a really good one thanks to information on how to compare correctly the same Unicode character/string that can be encoded in different ways with java.text.Normalizer.normalize and Locale-sensitive comparison ignoring optionally unimportant differences such as letter size and accents (using a Collator)
Continue reading →
An encrypted backup of a disk/partition to a Samba share with Clonezilla
Content: What is Clonezilla? | Preparing Clonezilla for a custom backup | Backup | Encryption of the backup | Restoration and testing of the backup | The complete backup - encrypt - test cycle | Summary
PS: If you are scared by the length of this post then read only "The complete backup – encrypt – test cycle" :-)
Update 2010-09-23: Added "The complete backup – encrypt – test cycle", little reorganization.
What is Clonezilla?
Clonezilla is a live Linux distribution containing tools for performing backup and restoration of disks and partitions. It is basically a collection of various open-source tools such as partimage and gzip and custom scripts that "glue" them together to create a single backup tool driven by a wizard-like user interface. You install it to a CD or USB flash disk, boot from that medium, answer few questions and a backup or a restoration may start.Continue reading →
Most interesting links of July
Continue reading →