Wednesday, October 28, 2009

Pros and Cons of JDeveloper 11g and ADF from begginers Point of View

I have started to use JDeveloper 11g and ADF for one of my enterprise level project. I didn't use any part of ADF before. Its now one month and i want to share with world what i found in ADF with JDeveloper 11g.

Pros:
- It is based on MVC pattern and cleanly separates your business logic from presentation layer.
- It has built in support for AJAX
- Very rapid development because most of the development one can do declaratively by just drag and drop components on pages and like that
- Most important and exciting feature from me was very good support of LOV. LOV is required in almost every business application and with ADF i don't have to do any code for LOV just a query and some very small configurations and that's it.
- Rich Tables supporting LOV, combo box and others.
- It provides good hooks to develop own framework or utility classes to suit development e.g. I want to extend all entities from my own class and i can do it very easily.
- One of the unique feature of ADF 11g is ADF Task flow which faciliates developer to define reusable navigation and avoid cluttering of all navigation rules in one file which happens in JSF

Cons
Now we discuss cons of ADF and JDeveloper 11g
- JDeveloper is buggy and crashes many times espeically when one does refactoring or deleting some resources
- You will have to spend good time to learn ADF if you didn't have prior experience with Oracle technologies
- Query component in ADF Faces which is used to build criteria does not have option to change the layout of fields like grouping etc.
- LOV which are generated are also buggy. I am still facing one problem and no one still gave me solution for that.
- You will have to do lot of hit and trials to understand the behaviour of layout components

Thursday, October 8, 2009

ADF Error timezone region not found

When i deploy/run adf applications, i receive error:
timezone region  not found

In order to solve this, right click on Model project and select Project properties. In "Run/Debug/Profile" select "Edit" in "Run Configurations" and add "-Duser.timezone=UTC" in JavaOptions. Repeat same steps for ViewController Project.

Tuesday, October 6, 2009

JDeveloper11g Startup error

I installed JDeveloper11g Studio Edition with no JDK bundle but when i tried to start JDeveloper, it gave me error

Unable to start Java Virtual Machine located at ....

In order to fix this type of error, go to installation_directoy\Middleware\JDeveloper\jdev\bin folder
and edit file jdev.conf.
Locate line "AddVMOption -XX:MaxPermSize=256M".
Now add another line just below this line:

AddVMOption -Xmx256M

Saturday, October 3, 2009

Persistence Unit for Toplink Essentials

Minimum configurations required for persistence unit in case of Toplink essentials is given below:

<?xml version="1.0" encoding="windows-1252" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="Model" transaction-type="RESOURCE_LOCAL">
<provider>
oracle.toplink.essentials.PersistenceProvider
</provider>
<class>org.engineers.adf.hrdemo.model.Departments</class>
<class>org.engineers.adf.hrdemo.model.Employees</class>
<properties>
<property name="toplink.logging.level" value="INFO"/>
<property name="toplink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="toplink.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<property name="toplink.jdbc.password" value="password"/>
<property name="toplink.jdbc.user" value="user"/>
</properties>

</persistence-unit>

</persistence>

JPA with Toplink Essentials Error Code: 17002

From this post, I am going to start to post solution for different problems or errors in java technologies which i face during development so that others also could get help from my research and don't waste time on that now.

Error is given below:

Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.1 (Build b52-fcs (09/24/2008))):
oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Io exception:
Invalid number format for port number
Error Code: 17002

Cause Was: I just copied url from a web site and then pasted to persistence. Probably it appended some hidden characters due to which provider game an error about port format. I just rewrite the port number again and error resolved.

Second Error which i faced was:

Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.1 (Build b52-fcs (09/24/2008))):
oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException:
Io exception: The Network Adapter could not establish the connection
Error Code: 17002

Cause Was: wrong port number, ip address or network disconnection