warning: realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/ in /var/www/ on line 287.

Drools drool a lot of shortages.

first of all Drool is a good AI(Artificial Inteligence) rule engine.
But Drools full of shortage:

  1. You can't use generics in the drl file; that if you tried to define java function inside the drl file with the following Signature
    function List getLoans(LoanBO loan) {...}
    it will complains and will give the following error message
    org.drools.rule.InvalidRulePackage: unknown:24:15 Unexpected token '<'
    unknown:24:15 Unexpected token '<'

  2. if your code encountered sentex error, or throw exception or you even forget to import a class that you are using all what drools will dump is the following error message org.drools.rule.InvalidRulePackage: Function Compilation error

JUnit testing with Acegi.

I tried to make my unit tests run after disabling it for long time for some reasons ;)
But whene I attempted to make it run it gives me Access Denied off course this after configuring the required depenedencies.
Oooh I forget to say that this project has Acegi now for authintication and authorization and this was the problem of making unit tests fails.

So what I will write here is what I had done to make my unit test rework again with Acegi.

Making JUnits log messages showen on standard Output.

I'm using Maven as POM. I was missing one configuration file whene loading my unit tests that was required at runtime and here's the output I got when running maven, and maven -X test:

File...... /home/aabdelaziz/.maven/cache/maven-multiproject-plugin-1.3.1/plugin.jelly
Element... maven:reactor
Line...... 217
Column.... 9
Unable to obtain goal [multiproject:install-callback] -- /home/aabdelaziz/.maven/cache/maven-test-plugin-1.6.2/plugin.jelly:133:41: java.lang.NoClassDefFoundError

WOW it is very expressive Error Message.

after searching the web for solution for this problem. I found the solution which is magic line I should add to my file.

Custom JSF Validator

How to Create your custom validator?
suppose that we want to create custome validator that applies some Arithmatic Operation on two fields.

1. Create the ComparisonValidator.2- Create the ComparisonValidatorTag. 3- Create the Validator.tld 4- Register the validator in the faces-config.xml 5- Now in the jsp page you can use it as following:

1. Create the ComparisonValidator.

package com.aliabdelaziz;

* @author aabdelaziz

Hibernate... What you need to know to get the motivation of using Hibernate.

What is Hibernate?

Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java.
Hibernate lets you develop persistent classes following common Java idiom - including association, inheritance, polymorphism, composition, and the Java collections framework.

Hibernate allows you to express queries in its own portable SQL extension (HQL), as well as in native SQL, or with Java-based Criteria and Example objects.
Hibernate supports the EJB 3.0/JSR-220 persistence standardization effort and implements it with Hibernate Annotations and Hibernate EntityManager.

JUnit Getting Started

Testing is very useful and helpful in descovering buges and it reduce the the development time (at least in my point of view) since all you need after modfying some code is to run your test cases which shouled be run also periodically.

The simplest way is as an expression in a debugger. You can change debug expressions without recompiling, and you can wait to decide what to write until you have seen the running objects. You can also write test expressions as statements which print to the standard output stream. Both styles of tests are limited because they require human judgment to analyze their results. Also, they don't compose nicely- you can only execute one debug expression at a time and a program with too many print statements causes the dreaded "Scroll Blindness".

Let's write Java code that adheres to a coding standard.

I think all of us wants to write code as book says.

But most of us didn't knows all the coding standards and what
you think it is good it may not be so.

Even if you read for example the Java coding standared you will forget some things (I'm sure of that).

so we need some persone to review our code and and tell us thats good or thats bad, what if there exists tools that helps you doing that.

I'm using amodule called Checkstyle that I configered it to work
with net beans.

Tomcat Authentication with LDAP

 All you have to do if You want to make Tomcat Authenticat 
 with LDAP for Your WebApplication is.

Follow the following three steps:

1. Copy the ldap.jar:

 copy the ldap jar into 
   /usr/java/tomcat5/common/lib or
 The difference between those two paths is that 
 The First one make the jar accessable to both the webApplication
 and the server.
 The Second one make the jar accessable to the server only.


Powered by Drupal - Design by artinet