Wednesday, July 07, 2010

jPitfalls - log4j adding through maven

One of the first thing a developer want to add is logging. Without logging there is no development. And i mean it... no development.. seriously!

Therefore i looked up in the net which logging Facility i should use and ended up with log4j. (And because all the Tutorials and Books i looked up used it as well). It's really great and flexible. (Enough advertising.)

But being not accustomed to Maven and Dependency Management and everything automatic, i had to learn another hard lesson.

The Thing with log4j is, there are several ways the output can be collected. Console, File, Database, you name it. The Thing with Maven and log4j is, if you add a plugin, it's automatically included and you don't even have to do much more work.

Being accustomed that every little peace has to be configured by hand i was unprepared for the *automaticallywedoeverythingforyou* world. Adding more than one log4j plugin i ended up with no output at all.

Nothing worked and i was starting to gave up my hopes. Fortunately a colleague of mine helped me out (we were sitting together, no clue at all) and found the reason for the misbehavior.

Use only the one output you need, no more than that and everything worked like a charm.

So today's Mantra is "Only use what you need, no more than that" (young grasshopper)

Thanks again

PHP Programmers Way to Java Heaven .. or jPitfalls

That's a nice Title.. or "Typical Java Pitfalls if your a PHP Programmer" or something like that .. in short Java Pitfalls or jPitfalls. (That's a nice short word!)

In short: i started programming in java/eclipse a while ago and decided to write all my troubles down so it might help someone else getting a clue what's happening...

And because my college urged me to do it over half a year.. so here it comes. A complete Series about all my troubles with the Name jPitfalls.

Now i need to tell you a little about the environment of the project i am working on. It's a typical WebShop with Database connectivity serving a handful of people so it's not a big deal. But this are my first baby steps into the wonderful world of compilation, debugging and so much more.

Without any help it's not as easy as it sounds when you need to find the right peace of software for your work. Frameworks, Database Connection, Template System... learn everything from scratch. So i worked my way through Struts 1,2, Spring, Hibernate, Plugins for that Frameworks and of course Eclipse and it's Plugins, unsure where it ends.

Also there was/is the question where will it be hosted. Finding a decent and pricable Hoster isn't easy if you know what technology you are working for. But now it's also a Question if you want an EJB 3 Container or not. Is Tomcat enough or do we need something more extravagant. (Glassfish?)

I ended up in several discussions with myself about the way i should go. (I am still having these discussions, but man, i have gone a long road already) For example the Framework: First i decided to use Struts1 because i thought it's old, so you find a lot of helpful information and it's really complete, nothing beta.

After working hard on the project for several weeks i thought that upgrading to Struts2 would be a good Idea, but not yet. Don't change something important as the Framework in the middle of the implementation cycle. Remember: You want to complete the project asap.

But then some Problems occurred which led to the decision to refactor everything and use Struts2 instead. (It was after all the right decision). In the meantime i use Spring for some parts (as they really work great together) and Hibernate as Database Layer.

My Intention was always to keep it as small as possible and as simple as possible. And for christs sake: Get the job done, will you!

Thursday, January 07, 2010

Could not open the Visual Page Editor: No more handles [Could not detect registered XULRunner to use]

If you have installed the struts tools from the jboss development update site in eclipse under windows and get hit by that error you might want to check if you also installed the xul runner from the jboss update site.

Might save you a lot of troubles and hours of searching what's been happening.

cheers