Saturday, November 22, 2008

iReport logging

I have been using the iReport IDE for Jasper Reports template creation. One strange thing about this report of iReport: I do not see a way to see a compilation or a runtime error/message log. If an error occurs, by default the report simply does not run.

A friend of mine finally figured out a way to get some messaging out by using log4j: here was the note he sent to me:

I found a way to get iReport to log. If you start iReport from the .bat file supplied in the bin directory, you can add log4j configuration to JVM command; i.e., in the bin/startup.bat file, add the following to the java command: -Dlog4j.configuration=file:C:\bea\domains\oppenDomain\config-oppen\log4j.xml

(make sure you’re pointing to a valid xml file!

Thanks,

Ayman

p.s. the full command should look something like:

java -cp "%IREPORT_CLASSPATH%" -Dlog4j.configuration=file:C:\bea\domains\oppenDomain\config-oppen\log4j.xml -Direport.home="%IREPORT_HOME%" -Djava.security.policy="%IREPORT_HOME%/policy.all" -Xms128m -Xmx512m it.businesslogic.ireport.gui.MainFrame %*

Wednesday, November 5, 2008

Polymorphism work

I have recently started to study polymorphism more. My goal is to continue to improve my ability to think in Java. For example, with polymorphism if you have a cascading series of if statements which is meant to branch out like a case/switch statement and call the different methods that basically do the same type of things, you probably should refactor it to take advantage of polymorphism. I read the following article and it helped me create a solution to such a refactoring problem which was fresh and useful: http://www.javaworld.com/javaworld/javatips/jw-javatip30.html

I hope you find this example useful also. The syntax of this person's examples is not perfect, but the concepts are there, and there are enough parts of the example to put together some refactoring of your own as I described above.

Saturday, November 1, 2008

iBATIS

I mostly wanted to check in because I am job hunting now and I want to keep things flowing.

I have been starting to work on the RMOUG site redeaux ;-) (with members-only site).

As I am looking for jobs I keep getting hit with jobs which want JSON, DWR, Prototype, and Dojo. I better get on the ball with these great tools.

At any rate, I worked with iBATIS caching. It is working very well. iBATIS seems so stable...I am sure there are bad things about it, but I cannot think of too many. :-)

Have a great one.