March 25th, 2007

You are currently browsing the articles from Java Blog - Java, J2EE, SOA, Spring and Hibernate written on March 25th, 2007.

Dozer - DTO to Business object (Bo) data transfer

Dozer is a powerful, but simple Java Bean to Java Bean mapper that recursively copies data from one object to another.
Dozer supports simple property mapping, complex type mapping, bi-directional mapping, implicit-explicit mapping, as well as recursive mapping. This includes mapping collection attributes that also need mapping at the element level.

This is different from Bean utils, which copies the data recursively for the object which has the same property names. Bean-Utils has a restriction for working with complex data types.

Dozer tool can be found here

here’s some of the key advantages found on Dozer

Recommanded Usage Scenario:

Disadvantages for Dozer

Written by Ravi Nallakukkala on March 25th, 2007 with no comments.
Read more articles on Spring and Tools.

PHP Designer 2007 - Personal is a free IDE for PHP

PHP Designer 2007 - Personal is a free IDE for PHP for both beginner- and professional developers. PHP Designer 2007 is designed to boost your productivity and enhance the process of editing, debugging, analyzing and publishing application- and Websites powered by PHP, HTML, MySQL, XML, CSS, JavaScript, VBScript, Java, C#, Perl, Python and Ruby.

Download PHP Designer 2007 - Personal Edition here

PHP Designer 2007 editor has a good class browser and debuger for PHP, to have the debugger enabled you need have php installed in your machine (tested with PHP Designer 2007 - Personal 5.0.2 and php5.2.1).

Not satisfied with this editor, never mind. Click here for some more list of PHP Editors.

Written by Ravi Nallakukkala on March 25th, 2007 with no comments.
Read more articles on Editors.

Eclipse

Need less to say this is a extreamly popular free java editor, http://www.eclipse.org/

WSAD/ RSA 6.x are based on Eclipse technology.

Please look here for any Eclipse plugins

Written by Ravi Nallakukkala on March 25th, 2007 with no comments.
Read more articles on Editors.

Java 5 For each syntax for arrays

You can use “for each” java syntax for iterating through the arrays, probably you are already aware you can definitely use for each syntax for iterating over classes implementing iterator.

here’s an example for iterating a array using for each syntax

public class test{

public static void main(String[]arg){

String []arr = new String[]{”one”,”two”};

for(String each: arr) System.out.println(each);
}

}

Output:

one
two

Written by Ravi Nallakukkala on March 25th, 2007 with no comments.
Read more articles on Java/ J2EE.

Maven 2 : java.net.URISyntaxException : Illegal character in path at index 18:

Environment Maven 2.0/ Windows XP/ Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)

I had a peculiar problem with Maven 2.0, my builds were working fine and one fine monday morning, I got a problem

Caused by: java.lang.RuntimeException: Not a valid URL: file:/C:/Documents and Settings/rnallakukkala/.m2

/repository/com/dpwn/newops/server/core/model/1.0-SNAPSHOT/model- 1.0-SNAPSHOT.jar
at org.jboss.util.file.ArchiveBrowser.getBrowser(Unknown Source)
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:588)
… 75 more
Caused by: java.net.URISyntaxException : Illegal character in path at index 18: file:/C:/Documents and Settings/rnallakukkala/.m2/repository/com/dpwn/newops/server/core/model/1.0-SNAPSHOT/model-1.0-SNAPSHOT.jar
at java.net.URI$Parser.fail(URI.java:2816)
at java.net.URI$Parser.checkChars(URI.java:2989)
at java.net.URI$Parser.parseHierarchical(URI.java:3073)
at java.net.URI$Parser.parse(URI.java:3021)
at java.net.URI.<init>(URI.java:578)

when trying to look for a dependency jar (this dependency jar is available in my local repository)

Additional Information for this problem

Solution

Configuring your Local Repository

<settings>

  ...
  <localRepository>/path/to/local/repo/</localRepository>
  ...
</settings>

Written by Ravi Nallakukkala on March 25th, 2007 with no comments.
Read more articles on Build.

Hibernate Vs EJB

Advantages:
- Hibernate Beans are easier to implement since you don’t need any interface coding.
- Queries can be dynamic and perform faster (at least on WebLogic and JBoss)
- Hibernate offers a more object-oriented approach. You can map is-a relationships as subclasses.
- For data transfer you can use Hibernate Beans as DTOs if you want (and if it’s applicable). You can even fill ‘custom’ DTOs with query results just with one line of code using the select-new construct.

Disadvantages:
- Hibernate Beans are not automatically ‘locked’ for others while used during a transaction. This can lead to inconsistent data when more clients concurrently modify the same data.
-Object Pooling is an Issue

Written by Ravi Nallakukkala on March 25th, 2007 with no comments.
Read more articles on Hibernate and Java/ J2EE.