Java Day 2006 in Paris

Well, in fact Java Day 2006 wasn’t held in Paris itself but in Versailles, just in front of the castle So, yes, things also happen outside the US. I know, it was just a one day java conferences with only 5 sessions, nothing compare to the four days of Java One and its 188 sessions. But still, we had James Goslings on stage. If you look at the agenda, this is what happened. Welcome Eric Mahé ? Technology Advisor ? Sun Microsystems France Eric, who has been working for 17 years at Sun, introduced the java day and the agenda. After few marketing slides (you always have to thank the sponsors) he joked about Extreme Pixel Programming. The idea is that Eric is not a java programmer, the tool he uses the most is Photoshop and he would like to use it to code some java classes. So he opened Photoshop, dragged & dropped some images, saved it as a raw file, opened the raw file, copied the content and pasted it into a java file in Netbeans. He then executed it, and the image was displayed with animation. He said that the one who finds the trick will win one of its own art work… bets opened. The Next Wave of Java Tools James Gosling ? Chief Technology Officer of Sun’s Developer Products group James arrived on stage and threw some left over t-shirt of Java One at the […]

Read More →

What would be your ideal job?

I‘ve been working in the IT industry for quite a long time now. Mainly in big companies, on big projects where you spend half your time in meetings and the other half writing meeting reports. Through this experience I‘ve met a lot of people who have had different experiences, different projects but I‘ve never met anyone who has had their ideal job during his/her career. There are always management, political, personnel or budget problems which cause the project to turn into a nightmare. When you talk to people, everybody seems to converge towards an ideal situation where innovation, dynamism, professionalism, intelligent management and beauty flow 10 hours a day… but that never happens. As a Java developer, architect or project leader, what would be your ideal job? Working in a big company, an editor, a start-up, self-employed, working in open-source, in a training company? At the office or at home? Part-time or full-time? What kind of industry would fulfil your dreams? Bank, insurance, telecommunications, industry, leisure? What would be the perfect allocation between development, management, training, publishing articles, working for open source, technology watch, learning new things? Or would you quit Java to move to .Net or a deserted island under the sun? While waiting for the magical wand to create the job of our dreams, let’s blog about it.

Read More →

Weblogic cluster life cycle

When you run a weblogic cluster you have to deal with several messages BEA-0001xx . It is then difficult to figure out what is the normal behavior of a cluster and the normal messages to get. Imagine two managed servers ClusterServer1 (listening on port 4001) and ClusterServer2 (port 4002) running on a cluster and sharing heartbeats through the multicast address […]

Read More →

Connection time out. Careful with your threads

Last week we had a bottle neck on our application and it took us several days to find it. So, here is what you should not do. The architecture is as followed : 2 Alteons to spread the load 2 reverse proxy a layer of Firewalls 2 HTTP compressors 4 web server iPlanet (Sun Java Web Server 6.0) a cluster of 40 Weblogic server running on 4 different boxes a database server. Everything running on HP-Ux11. iPlanet only dispatch static pages and images and Weblogic has the presentation (JSP/Servlet) and EJB layers (it does 99% of the work). The problem was that a lot of connections were falling on time out. We kept on focusing on weblogic and controlling the thread and memory activity to see if we had any dead lock of memory leek (there are some JNI calls somewhere). Weblogic wasn‘t doing anything, not under stressed at all. The application was configured to run 2000 concurent users that‘s why each instance of weblogic was running 60 threads (60 threads * 40 instance = 2400). After some days of analysing and twisting weblogic, we remembered that we had a layer of iPlanets on the front. The admin guys were sure that there was no problem with iPlanet because each server was supposed to run 512 threads. It wasn‘t the case. Each instance was configured with 128 thread (128*4 instance = 512). That was why weblogic was doing nothing and […]

Read More →

God is a .Net Programmer

Part of my company‘s job is to create tailored software for clients. They manage to deliver 5–6 a year and producing each one takes between 200–500 days. For the last 2 years they have developed around 80% using the .Net platform and the remaining 20% using Java. Last year I worked for 1 month with a .Net team trying to re-architect their software, but I gave up. Those guys didn‘t know what a Singleton was, nor a framework, nor even a package ! And because I didn‘t know anything about .Net (and still don‘t) I moved to do other things. The other day I was talking to one of the commercial guys and I asked him why my company wasn‘t putting any effort in trying to do more Java. The answer was quick and precise: “We realized that .Net software is 40% cheaper than Java“ (understand faster to develop for the same price). I was about to argue, bring the technical side, the big mistakes that I spotted during my little experience with .Net, talk about the Java community, the open source framework, the well designed architecture I‘ve worked with and so on. When I realized that he was a commercial guy, wearing a suit and a tie, I had the divine inspiration that made me reply: “God created the universe, the planet and Man in just 7 days. And you can see the mess. Imagine if he had 40% […]

Read More →

I HATE HTML !!!

Am I the only one to hate HTML or is this « language » really a pain in the back ? Like many of you, I am a back-end guy : I love Java, I feel happy when I use hibernate, J2EE doesn’t scare me anymore, Struts has no secret… but behind the Strut’s Form lies the dark side of web applications : HTML (or XHTML) I’m working with some friends on a website that we will soon put online. This time we are not allowed to have dirty Hello World black&white pages. This time there is no HTML designer to do the dirty job of writing HTML for us, so we have to do it. We use a java IDE, Google to find some nice icons and the look for help in the community of javascripters, flashers, designers and htmlers. We have been using Firefox. So we change a JSP, deploy, look at Firefox and see if it looks nice. « Oops, too high, too low, a bit more to the right, the font is not the right one… » and so on and so forth. When in the middle of the development we thought of having a look at Internet Explorer, the difference was amazing. We were using just normal HTML tags (tables, td, tr, div..), nothing fancy. We spent hours and hours trying to make look pretty on both browsers. And we’ve discovered something very sad: <tr> […]

Read More →

10 things to do when your job is really boring

Sometimes, your job is really boring. And I’m not talking about a couple of hours or a day, I’m taking about weeks and even months of boredom. This can be due to several reasons: the project is delayed, the client has not really made up his mind, the budget has not been approved yet, the compliance team is still checking that the JDK 1.3 can be installed, let’s prototype all the MVC frameworks first… But the most common reason is political issues: everybody is waiting for a decision maker to do his job, take a decision. In the meantime, what can you do: Change the situation: the first thing to do is to try to change the situation. Make things go faster, talk to the right people, send emails explaining how this situation could be improved… In one word, be constructive. Most of the time, this is completely utopist because you don’t have the power to make things move on. Shorten your days: if you can, shorten your painful days. Arrive at 10:30am at the office, have a nice long lunch with your bored colleagues and leave at 4:30pm. Cut the morning and the afternoon with coffee breaks. Work on something interesting: there is nothing better than feeling useful, so, work on something you like: your own project or be part of an open source one (plenty to do on sourceforge). To make things easier, buy a portable hard drive […]

Read More →

And the winner is : COBOL !!!

J2EE has nothing new happening ! J2EE is a back-end language ! JCP is too heavy ! Java language is not open sourced ! Ruby on Rails is the next thing ! JRuby looks interesting ! Java is dead ! .Net is easier to develop than Java ! Ruby is more flexible than Java ! J2EE is too complicated when you want to do web development ! And what about PHP ? This is what we can read here and there in blogs, articles, web sites. I have to admit, I’m starting to get confused too. I arrived at the early stages of Java, coming from C and C++, and I thought that was great. When J2EE arrived I was the first one to say “this is cool, developers will have to focus on business requirements rather that wasting time with technical issues that will be held by the server”… and so on and so forth. Unfortunately, J2EE has become so complex that developpers have to read tones of specs and design patterns before developping a simple web app. And what about Ruby, and what about Rails, and what about COBOL ! Maybe like me you have coffee breaks, and maybe like me you work in big companies who have developped their system 30 years ago in Cobol. These companies have started to move to, so called, new technologies. But of course, there are still millions of lines of code […]

Read More →

Migrating from Tiles to SiteMesh in AppFuse 1.5

In this blog I explain how I’ve migrated from Struts Tiles to SiteMesh in a AppFuse 1.5 project. I wanted to do that because I was fedup of dealing with Tiles aliases and also because I’ve used SiteMesh in other projects and it’s really easy to use. Metadata filter-mappings.xml In %ROOT%metadatawebfilter-mappings.xml add the folowing <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern> <!-- These are needed by Tomcat 5 for forwards --> <!--dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher--> </filter-mapping> filters.xml And in the filters.xml file add. <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> </filter> struts-actions.xml Change all the actions parameter from Tiles to path to JSP pages. For example, change from <action path="/login" type="org.apache.struts.actions.ForwardAction" parameter=".login"/> to <action path="/login" type="org.apache.struts.actions.ForwardAction" parameter="/WEB-INF/pages/login.jsp"/> struts-plugins.xml In the %ROOT%metadatawebstruts-plugins.xml delete the reference to Tiles plugin <plug-in className="org.apache.struts.tiles.TilesPlugin" > <set-property property="definitions-config" value="/WEB-INF/tiles-config.xml" /> <set-property property="moduleAware" value="true" /> <set-property property="definitions-parser-validate" value="true" /> </plug-in> Action source code The most painful job is to change all your xDoclet tags so that actions forward to a page and not a tile. So you have to change all action classes that are in %ROOT%srcwebmyappwebappaction for example, refering to your tiles-config.xml, change @struts.action-forward name="architectures" path=".architectures" to @struts.action-forward name="architectures" path="/WEB-INF/pages/architectures.jsp" The other problem that you may find is if you have used tiles.Controller. If yes, just change them to struts actions. JSPs First, change your %ROOT%webcommontaglibs.jsp file. Delete <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> and add <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%> <%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%> Layout to decorator You have to copy and rename the Tiles layout from […]

Read More →

An easy way to version your objects

Imagine that you have a Customer object that has an Address and a BankAccount. In other words, John lives in Los Angeles and has the bank account number 123456 (V1.0). Imagine then that John decides to move to New York (V1.1) and several months later changes bank accounts (V1.2). Tired of the city stress, he moves to Alaska (V1.3) where he closes his bank account (V1.4) and starts fishing. How do you keep all this information in your system ? How can you get V1.2 of all your object ? You never delete data, you add version numbers when you make updates, add a timestamp, a version to your class definition (imagine that the Customer class has changed and has different attributes) and, of course, lots of data manipulation and processing to be able to visualise your objects at a certain version. A couple of years ago I worked on a project that had these exact needs : we couldn?t delete any data but instead version it (versioning becomes tricky when there are several layers of associations and inheritance between objects). The other important requirement was that the versioned data was not accessed very often. Because of that we decided to use something not really efficient but easy to develop : JRCS. What we did was very simple : we marshalled the Customer objects (and its relationed Address and BankAccount) into an XML stream (using Castor), we used JRCS to […]

Read More →

Is Ruby an aesthetic language ?

For me, a computing language has to be aesthetic ! Like many IT people, I’ve used several computing languages through my life. With my Comodore 64 I’ve started developing in Basic followed by Assembly. Then I had to do a bit of Cobol for a living and jumped into C and Ada. During the client server era I used Visual Basic and then I had a long and painful period of C++ (‘*’ and ‘&’ are definitely not esthetic). In the meantime I was doing a research project in Prolog (that was cool and beautiful). Then, in 1998 Java arrived and I thought “this is great”. Since then, I have to be honest, I have just focused on Java and I love it. Java is great because of the APIs, the Open Source projects, the JCPs… Java is great because a lot of people are working around it. But I have to say, I love Java because I like the aesthetic side of the language. When it comes to aesthetics, nobody is wrong and nobody is right : I like the blue, you like the red, and that’s it. For many months I’ve been reading blogs and articles about Ruby. Yet another language I thought. But more and more people are using it and talking about it. So, I thought, let’s give it a try. I’ve downloaded Ruby, some documentation, and started typing some Hello World examples to have a […]

Read More →

You Need A Workflow ? Just Use Database Views !

I’m still working for the same massive telecommunication company and trying to understand the tricky architecture of the expensive software they bought and are trying to use, see my previous post Today I’ve discovered how works a new piece of the architecture : the workflow. Their business rules are more or less these ones: managers arrive in the morning and dispatch the work through their team. A worker does the actual work and a supervisor checks that it’s done properly and accepts it or not. I’m simplyfing here but I have to tell you that the entire national team is about 4000 person big and deals with thousands and thousands of request a day. During the meetings, the guys where talking about workflow this and workflow that. So I asked them to show me the workflow engine… which engine?, there is no engine. The workflow is just made of dozens of database views : the supervisors use one view (this view is a view of a view of 2 views, because the business rules are too complicated to describe in one single SQL statement), the worker use several views depending on the work he does, and the same for managers. Oh, I forgot to tell you that one of their problems is performance. Some table have 20 millions entries, and of course, running all these views several times a minutes brings Oracle down. I might go and change the workflow […]

Read More →

How thick is a rich thin client ?

Long time ago, client machines were so thin that they didn’t even have a hard drive or a floppy disk. The screen was black and green and all the work (even the display) was made on the server. Hardware became cheap, memory, hard drive… let’s put less pressure on the server and develop thick clients. VB, Power Builder and so on arrived. Internet arrived a bit later with a stateless protocol carrying HTML to be displayed on browsers. That was thin and colorful (forget the black and green)… but java said, “hey, let’s write some thick applets”. Now companies and software editors are re-developing their thick applications so they can become thin again. I am working at the moment for a big telecommunication company who purchased a very expensive CRM tool (Customer Relationship Management). This tool is massive : 4 CD of source code developed in Java/J2EE but also with a bit of C++. This tool (sorry, I don’t want to say the name) was written in VB and the company decided now to move to Java using a thin architecture. But of course, thin is thin, not thick so it doesn’t do the same think that a good old VB application. Well, let’s make our thin client rich then !!! These guys are using 15Mo of javascript into their pages. Of course, to make it easier to read, not all the scripts are nicely isolated in .js files but […]

Read More →