Skip to main content

Posts

Standup

Recently I was asked if it makes sense to do standups. Is it just a formal waste of time? Wouldn't it be more useful to spend the same amount of time by actual work? This is how our standup looks like, this is how the work would look like without it according to me and this is why I think it's worth doing standups: Standup optionally starts with a half-minute long announcement by the Scrum Master if somebody is missing and when will be this person available again. Without standup:  We could check out this information from a well-prepared shared calendar but unexpected lates or illnesses which are missing from the calendar would require a little bit more communication and irrelevant discussion during the day. It would cause some delay for sure. Then we look at the burn-down chart of the sprint and to the status of the latest nightly build. Is it stable, what about automated tests which were run last night? We make a common standpoint in one minute which is clear a...

Architecture at CraftConf

At Craft Conf, there were some presentations about software architecture. I visited all of them and also searched for this subject in other talks. It was interesting to hear the same concepts from more places and to put together a picture how software architecture looks like in the mind of the presenters of today’s conferences. Stefan Tilkov: Architecture War Stories . It was indeed about weird stories from real life. I wrote down two things: If something is sophisticated, probable you shouldn’t do it. And having many architects is wrong. Many people liked this talk very much but I’m not really interested in real stories. I’m rather interested in the causes behind the stories to be able to avoid situations which head to weird architecture. Luckily for me, other talks were more abstract. The title of Rachel Laycock’s talk contained the very fashionable word combination “Continuous Delivery” beside “Architecture” so I anticipated it will be great, and it was. Rachel came with the same m...

Craft Conf Workshop - Gojko Adzic

The day started with a mistake I’ve made. I didn’t check my mailbox accurately and missed the info that workshops aren’t held at the conference venue. I knew that there were some email but I thought it’s redundant and everything is on the homepage. It wasn’t. After all, I managed to track it down and get to the Prezi office in time when the workshop was held. The workshop was about   How to Make Big Impact with Software Products and Projects by Gojko Adzic . We had to form group which was very nice because most people didn’t know each other. We had to come up with an imaginary milestone plan for some kind of a software. It was interesting that the seven groups came up with quite different ideas and every group was able to defend his own viewpoint. One group defended the idea that they didn’t want to touch the legacy code of the system, other team came up with the idea to rewrite the legacy part. The conclusion was, that no ranking can be defined, it’s nearly impossible to judge...

Some useful Java libraries

Here is a video from Javazone, where some useful Java libraries are mentioned: 02:30 xbean-finder : Annotation finder in jars. 03:50 shrinkwrap: Can download artifacts from Maven repo. 05:50 zt-zip : zip file utils from Zeroturnaround. 07:25 Airline: command line parser helper. 10:30 really-executable-jars-maven-plugin: makes self-extracting jars. 12:00 jansi : colorized command line. 13:30 jmxutils : JMX beans by annotations. 15:00 Feign : HTTP helper / annotation lib. OkHttp is also mentioned. 17:20 Jerry / Lagarto : JQuery-style selectors in Java. 20:00 jchronic : converting English free-text to time. 21:40 assertj: fluent interface for asserts in unit tests. 23:10 vtte : very trivial template engine. 24:45 tape : a collection of queue-related classes for Android. 26:10 connector/mxj (GPL): mysql helper. 28:10 ness-pg-embedded: prostgresql helper. 29:10 slice: effective off-heap memory helper tool instead of ByteBuffers. 32:20 paranamer : named params in java fro...

SAX Parser truncation problems

Have you ever met with strange problems regarding SAX parser when textual content seems to be truncated? When it seems that the parser transmits only a fragment of the content which is inside an XML element. Maybe not. Maybe yes but haven't noticed. Parser reads blocks of stream and it may call characters method more than one times. Well, it's written in the Javadoc and it's quite logical. If I have a very long text content, it couldn't had been processed in one go. It has to be split into parts. So, rather than assigning the content to a simple string, use concatenation instead and evaluate the content on endElement . By the way, the magical number is 2048. The parser implementation typically uses this block size. Unfortunately it's a kind of thing which easily creeps under the radar of tests. Nobody writes tests for long data. See also this on Stackoverflow.

NoClassDefFoundError

Recently I faced with NoClassDefFoundError s during unit testing despite all class files were in place. It was quite strange. Furthermore this error happened only on our CI (Linux) server, I couldn't reproduce it on desktop, neither on Windows nor on Linux. I started to investigate the stack traces and it seemed that the native open method of the FileInputStream was failed. After more investigation by JProfiler I found, that many classLoader.getResourceAsStream invocation happens in our code, but those streams are never closed. Meanwhile I found this nice writing about Tuning Linux applications which says: "Some Linux applications; for example, a JVM, might require a higher file descriptor limit. If an application can't open files because the file descriptor limit has been exceeded, you might get a NoClassDefFoundError error message." Then it says how to increase number of file handlers ( ulimit -n 2048 ), but let's rather close the resources guys. It ...

Installing Firefox Java plugin on Ubuntu Linux for Dummies

As a Windows user, I was amused how not easy to install Java on Ubuntu Linux (10.04) nor installing Java (1.6) plugin into Firefox (3.6). It's not nearly a download-next-next-finish task. Additionally, digging into forums I found a lot outdated solutions which I tried and soon realized that they doubtlessly aren't working. Here is the one which worked for me: First, open a terminal window: Applications menu -> Accessories -> Terminal. Type the followings (you will be promted for admin password, because sudo prefix means you want to do something in the name of the super (or sytem) user): sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" sudo aptitude update sudo aptitude install sun-java6-jdk Then you have to select things with arrows and pressing enter. Then Timothy says in the forum you have to type this, but I didn't need it: sudo update-alternatives --config java Now you can check if java is installed by typing java -version . ...

Web-based chart libraries

Recently I was hunting for good web-based client-side chart-drawing libraries . I've found a number of blog entries or articles which enumerates some subset of existing frameworks and write sentences about them, like this: ' This is fancy, this is not so fancy but it's still good. ' Those writings didn't help me a lot. What I am interested in? Presentation model: Can be Flash, HTML Canvas or any other magic. This influences interoperability and scalability of the charts. Licensing model: Is it free, commercial or GPL. Dependencies: Should I have to bring another dependencies with the chart-drawing facility? Docs: quality of documentation. Examples: quality of examples. And finally, outlook of the charts and number of the options are also matters. I've found 16 libraries up to now and made an overall matrix about them, regarding considerations above. Check it out.

Brillien

There were three presentation as usual at the 14th Java User Meeting at Budapest yesterday, but this time I'll write only about the first one. Imre Fazekas had been invited from Debrecen to make a presentation about Brillien , their Java enterprise platform. It's an alternative way of modeling and implementing business logic in place of Java Enterprise (J2EE) Technology. It uses invasive programming model which means we have to extend classes from Brillien superclasses and we may use annotations. The whole system based on asynchronous XMPP communication and a set-context-flow concept. It's something like an application server, but uses a more logical and set-based approach. As the presenter said, it has very good speed and performance characteristics. Currently there are no IDE or other tools for editing models because this is a very young project, however a Maven plugin and a Maven archetype is accessible on the homepage. A very good introduction and tutorial can be also ...

Hacking Apache POI

In the near future, presumably, I'll have to read and process complex xlsx documents containing a lots of formulas. Jexcelapi can't even open those kinds documents, so I turned to Apache POI . Unfortunately, POI also have problems with some formulas becase support of this field is not fully laboured. [ Update 2010.03.10: After some experimentations I found that Apache POI can read and process new Excel ( xlsx ) documents including calculating very complex formulas: Basically, cell.getStringCellValue() gives the evaluated outcome. This way, I didn't have to hack POI. That's great!] I choosed to start two methods: Knowing exact static structure of the Excel template document, I do problematic calculations in the reader program itself, eliminating POI's formula support. I study Apache POI's internal structure and try to make up the missing functionality. Unfortunately, POI isn't amendable in a non-invasive way with registering components at certain extensi...

Json-lib vs Hibernate

Subtitle: java.util.Date vs java.sql.Timestamp One of my projects has a data path where Hibernate entities are converted to Json objects by using json-lib . I have some special formatters, e.g. for Date objects for having an easy readable format instead of this: {"date":1,"day":4,"hours":1, "minutes":0,"month":0,"nanos":0, "seconds":0,"time":0,"timezoneOffset":-60,"year":70} A JsonConfig object can be suited by special formatters which later will be given to the fromObject method: JsonConfig cfg = new JsonConfig(); cfg.registerJsonValueProcessor( java.util.Date.class, new JsonValueProcessor() { private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd"); public Object processArrayValue(Object value, JsonConfig c) { return format((Date)value); } public Object processObjectValue( String key, Object v, JsonConfig c) { return format(...

jxl.log

In an intranet production environment we have running a Glassfish v2 appserver with several J2EE applications which all use JexcelApi , a.k.a JXL, which is an open source library for accessing, generating or manipulating Microsoft Excel documents. We use version 2.6.3 of JXL because it's the recent one in the Maven repository which we use, however, at the official JXL site there are newer versions. Additionally we have log4j and Java Commons Logging (JCL), ignoring Glassfish's JSR-47 Java Util Logging (JUL) facility. Application #1 uses purely log4j and gets its log4j.xml config from a custom location. Application #2 runs Java Commons Logging with no explicite configuration file given, so JCL uses the default JUL facility of the appserver. Application #1 had been running for a long time without problems but when we installed #2 we realized that a jxl.log file had been created in the glassfish/domain/domain1/config directory and it's rapidly growing. As it happens, we ...

JUM VIII. - IX. - X.

In the recent months there were a few Java-related microconferences organized at Budapest. At the eighth occassion of the Java User Meeting (JUM) in January we had a presentation about OSGi by local guys and about Flex by Cornel Creanga from the Romanian Adobe office. I've read his blog and I must say life of an evangelist can be very cool (if there's no wife or girlfriend:)). Visiting Java and Adobe user groups all around in Europe, it's great. At the ninth occasion in March we had three presentations: introduction to the Maven build system, SOAP testing with SOAPui and various other components, and OLAP architectures. The latter was driven by the magnificant prezi presentation engine, which is a very young Hungarian startup project and which will be introduced soon at the Silicon Walley and I'm sure it will have a great success. Otherwise, I guess this time we beat down the highest participant number with about 40 attendees. At the tenth occassion we had a pr...

Budapest Newtech Meetup

The originally planned programme of the January Budapest Newtech Meetup contained some interesting presentations like the smart 3D visualizer solution ( 3dForAll ) from a young Hungarian inventor or the Google App Engine which is an alternative server-side solution for those who don't have own server facilities. It can be used mainly for OpenSocial applications which is actual nowadays because of leader social network of Hungary (Wiw: Who is Who) had been announced to support opensocial applications in the near future. Further live demo would had been the Surface which is a Microsoft hardware but it had been also cancelled. The event had been organized this time in a small art movie near the Buda-side of the Margareth bridge. About 130 people were present, some of them couldn't fit into the room. The first demo was about the Zoomery application which is built on Microsoft Silverlight technology and used for deep-zooming a set of pictures or documents. Several kinds of docume...

Client's transaction aborted

I've met the above error message using a Wicket 1.2 / EJB3 intranet application under Glassfish v2 . Here is the more particular head of the stack trace: javax.ejb.TransactionRolledbackLocalException: Client's transaction aborted at com.sun.ejb.containers.BaseContainer.useClientTx(BaseContainer.java:3394) at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:3274) at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1244) at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:195) at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127) This exception raised on the integration server sometimes, randomly, for simple page fetch operations. After pressing reload on the browser, the operation was usually successful. I couldn't reproduce the failure on the local machine where I regularly restart the app server and...

Eclipse DemoCamp Budapest

This year I also couldn't get to any of the heavy European Java conferences, so I stayed at visiting some tiny local events intown. For example last week I attended on the Eclipse DemoCamp Budapest which was organized by the right engaging b2i local team at a pleasant (but not too silent) downtown pub. Around 20 participant were present and there were two presentations, or rather demos planned. When people entered they were asked if they had some interesting subject to speak about, so the whole thing had an unconference style. FOT Testing Services guys actually had a notebook with a copy of their recent project so they took the opportunity to introduce it to the public. First demo was about making a generic data model with EMF (Eclipse Modeling Framework) plugin and creating a model editor with Eclipse GMF (Graphical Modeling Framework) which is given by GEF (Graphical Editing Framework). The example model was a basic CD database. With suitable experiences, it takes about 10-2...

Cloud Computing

Is it the ultimate innovation or is it the next buzzword managers and sales staff members must record into their notebooks? After reading some material it doesn't mean more for me than a clustered client-server architecture where processing capacity and memory can be hired and clients are generally web browsers or other applications. It's not a big novelty form the developers' point of view so first of all we got a new phrase for the hot water. Don't mix it with 'grid computing' where real math computations are running on a statically or dynamically built distributed network (SETI@home for an example) and clients are active participants of the process. Instead of this, with cloud computing, you connect to the service and use it. So I don't get again where is the magic. (Maybe the magic is in the ability of obtaining a large amount of personal data and money from the users.) I can imagine an architecture which discovers (sourceforge does this) or even deplo...

Setting up EJB3 default interceptor

It wasn't easy to find out how to configure a default interceptor in EJB3 environment. It's okay to make this snippet into the ejb-jar.xml: <assembly-descriptor> <interceptor-binding> <ejb-name>*</ejb-name> <interceptor-class>pkg.IC</interceptor-class> </interceptor-binding> </assembly-descriptor> Maybe everybody forget to mention maybe it's a Glassfish V2 trick that I get this error message during deployment: Interceptor binding contains an interceptor class name = pkg.IC that is not defined as an interceptor ...unless I register the interceptor class itself too with this: <interceptors> <interceptor> <interceptor-class>pkg.IC</interceptor-class> <around-invoke> <method-name>call</method-name> </around-invoke> </interceptor> </interceptors> <interceptors> and <as...

Survey

Some months ago I read an article which said programmers usually do their hobby projects much better than their working projects. There are several reasons like time-pressure, predefined set of useless tools and pointless procedures, rubber specifications etc. I've made a little survey about that. Do you feel sometimes it would be better to be a shepherd somewhere on a sympathetic highland in, say, Scotland and to forget all office crap? Or do you arrive at yor workplace every morning that you know you will change the world a little, of course in the right direction? The survey is here at the right. Thank you for giving an answer if you did. It would be nice to know the distribution of the answers by several categories like programming languages, destination environments, open source and commercial projects, speciality of the projects (banking, science, administration, telecommunications, entertainment, web/publishing), however, this simple survey is not capable for that. But I hav...

AppServer Shootout

Recently we organized an AppServer shootout (we call it deatmatch) on our local Java User Meeting. The three contestants would have been Sun's Glassfish v2, Redhat's JBoss and IBM's Geronimo. Unfortunately IBM guy couldn't attend on this event because of other business and JBoss presentation had technical difficulties so we had to do with Glassfish demo. Let's see the 8 tasks: 1. Deploying simple EJB3/JPA webapplication with pre-initialized DB. Checking WSDL as a bonus. It was easy and elegant. We checked WSDL which was an ugly and large XML but it's been generated automatically. We did a test request by using the Glassfish's admin console. That means we filled an HTML form containing one of the webservice's method's parameters and submitted it. 2. Remote deploy from build script. (Usual development task.) We did it from Netbeans using Ant and a special Glassfish deploy task. AFAIK hot deploy is also supported by Glassfish when appserver scans a pre-...