Leon van Tegelen

Leon van Tegelen

(0 comments, 37 posts)

This user hasn't shared any profile information

Posts by Leon van Tegelen

Steve Muench on improving ADF performance

Yesterday we had a technical session at Amis on ADF. In one discussion a concern was raised on how all the ADF metadata and the abstractionlayers would affect performance. Quite coincidently Steve Muench posted a presentation on Improving ADF performance he gave at Oracle Open World yesterday. A very good read, not only for people working with ADF, but also for those only working with the business components.

Oracle JDeveloper 10.1.3 Developer Preview is here …

The Oracle JDeveloper release 10.1.3 Developer preview release can be downloaded from OTN. See JDeveloper Homepage
“The Oracle JDeveloper 10g (10.1.3) release adds many new features, including a new look and feel, a greatly improved coding environment, extensive refactoring options, J2EE 1.4/J2SE 5.0 support, and visual JSF development.”

I took it for a very quick spin today. I must say I like the new look and feel. If you look at some of the new features such as the refactoring (thank you) , the cvs support and the easy maximizable editor tabs (double click on a title to get the editor fullscreen and vice versa) it is not hard to see were they get some of their inspiration.

Much to my surprise they have left ADF out. Makes you wonder. Is ADF undergoing major revisions? If yes where is the focus? Extension of the out-of-the-box support for dataproviders? New Wizards? Drag and drop Editable Tables in JSP ( :-) )? Drag and drop support for JSF and ADF Faces? Application templates?
We will have to wait until Oracles releases another preview including ADF as they plan somewhere in 2005.

As for Toplink this release does not contain the 10.1.3 Toplink Developers preview. You’ll have to download the standalone version if you want to testdrive the JAXB and O – XML mapping features. Again in this JDeveloper release it is not possible to export the project to Java source, you can in the standalone version. Seems like a small thing to me to get it in …..

Even the startup icon has been revamped. In my opinion it looks more like a cappucino now…

Putting SPELs on ADF Code

There is a simple way to use the Expression language you use in JSTL expressions in your JSP’s, in ADF’s DataAction. Actually anywhere you can get hold of a LifeCycleContext (or any subclass) you can use SPEL. What you need is the class oracle.adf.controller.lifecycle.Evaluator.
You can obtain one like this
. (more…)

JDeveloper bug – ClassNotFound

Every once in a while for no apparent reason a JDeveloper ADF/Struts project gets corrupted. When compiling the project I get an error that a certain class cannot be found. Most of the time it ‘s a struts HTML tag class. When I check my libraries and paths everything seems in perfect order. Very annoying.
One ( ) workaround is to disable automatic compiling before running the web-app. Compile the project by hand and run the web-app, ignoring the errors. But this does not really do the trick. There are other processes in JDeveloper which rely on successfull compilation (for example creating a DataControl).

On the OTN JDeveloper forum Steve Muench suggested backing up the JDEV_HOMEjdevsystem9.0.5.2.1618 directory and then removing it all together. This directory stores user preferences. Apparently something is corrupted there. The directory will be recreated automatically

I took this approach and all seem to be working OK again. Of course I had to re-add all my workspaces again to JDeveloper for them to appear in the navigator. I keep the old directory backed-up just in case

Toplink's Object to XML mapping

On OTN there is an excellent online seminar (replay) on the TopLink Object-to-XML support.

This feature, which will be available in the upcoming 10.1.3 release, allows converting XML files into Java objects and vice versa. For those allready working with TopLink’s Object-relational mapping, the following will sound very familiar.

It is built on the JAX-B 1.0 specification. This is one one way of using the TopLink workbench, based on an XML schema the workbench can generate Java Classes using its built-in JAX-B compiler. Toplink also generates mapping metadata. These metadata provide a definition of how a certain XML element corresponds to a certain Java element. In this way a buffering layer is created between your object model and the XML-schema. Changes in a XML schema don’t not have to lead to changes in your object model. The changes will be done in the mapping metadata.
This also means you can connect your existing object model to an XML schema . Just import the classes into the mapping workbench, specify the schema and make the mappings. You can also specify transformation rules, for example in your XML-schema gender is represented as F and M , but in Java you want it to be Female and male.

In your application the TopLink runtime will use the metadata to marshall and unmarshall you XML documents.

There is a lot of extra info (and a Developer preview) on the TopLink product page on OTN

A nice sideline question is whether JDevelopers ADF will have out of the box support for O-X Toplink projects

Quick and easy SSL in OC4J Standalone

During development it is sometimes necessary to able to run your webapplication under SSL. To obtain a test certificate from verisign can sometimes take a little too much time and effort. Especially when there is a bug waiting to be fixed.

This post describes an easy way to create a certificate yourself using SUN’s keytool and configure OC4J to use it. It originates almost one to one from the Oracle Application Server Containers for J2ee Stand Alone User’s Guide (how about that for a title).

I assume that you have at least JDK 1.3 installed and setup correctly. Make sure that the you set the PATH to include the JDK’s bin directory.

(more…)

Setting up Oracle JNDI Datasource on Tomcat

In one of the projects I’m involved in we have to make use of specific Oracle JDBC features. The application runs on Tomcat 5.0.27 and connects to the database using a JNDI datasource setup to use connection pooling . When setting this up based on info I found in Steve Muench ‘sBC4J Toy Story example I ran into some problems .

For some reason I got the following error:

“java.sql.SQLException: User credentials doesn’t match the existing ones”.

It really drove me nuts. Checking parameternames over and over, checking username and password … But together with Martijn Hinten of Cumquat I managed to track down the problem. This error only occurs if you specify the minLimit parameter, used to specify the minimum number of pooled connections the pool should have. If you ommit it everythings fine .. This is the minimum context file we needed to get the OracleConnectionCacheImpl working

<?xml version='1.0' encoding='utf-8'?>
<Context displayName="udo" docBase="C:/development/appservers/jakarta-tomcat-5.0.27/webapps/myContext" path="/myContext" workDir="workCatalinalocalhostmyContext">
  <Resource name="jdbc/myDataSource" type="oracle.jdbc.pool.OracleConnectionCacheImpl"/>
  <ResourceParams name="jdbc/myDataSource">
    <parameter>
      <name>factory</name>
      <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>****</value>
    </parameter>
    <parameter>
      <name>url</name>
      <value>jdbc:oracle:thin:@localhost:1521:***</value>
    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
      <name>user</name>
      <value>local_user</value>
    </parameter>
  </ResourceParams>
</Context>

Place this file under the name myContext.xml in tomcat_home/conf/Catalina/localhost. Now you should be able to use this Datasource from within the “myContext” web -application using the following code

InitialContext context = new InitialContext();
envContext = (Context) context.lookup("java:comp/env");
ds = (DataSource) envContext.lookup("jdbc/myDataSource");

CSS editor in JDeveloper

Last year I spent a lot of time on a project using Eclipse as IDE. I like it very much. I allways call it a real developers tool. It works intuitiveally, has great features ( refactoring is much better supported ). As java IDE I ‘ve found JDeveloper lagging. Well if I read the signs right JDeveloper’s upcoming release will make up some ground

Recently I’ve been working with JDeveloper 10g a bit more (researching ADF). I was very pleasantly surprised with the CSS editor. It has code insight/completion (comes very handy when pondering questions like “was it align-right or right-align?”. And also it has a color picker making it very eay to choose a color for attributes that take a color.

Another thing when working in the JSP editor was the awareness when working in an image tag. when i type the src attribute JDeveloper automatically starts a file dialog allowing you to pick a file from the filesystem

They seem trivial, but sometimes it is these small things which make a tool really enjoyable

Profiling in Eclipse

Profiling makes it possible for developers to track down in what code their application spends its time.
Check out this Eclipse plugin for profiling Java applications. Looks really good. Remote profiling for example on Tomcat is also possible.
See here for installation notes and screenshots

At first glance it works quite well, allthough I didn’t get the Thread Call Graph working. But the comment by Birch below solved that!

Of course I have to mention that JDeveloper has out of the box Profiling ( see here)

Toplink 10.1.3 developer preview 3

On OTN the new Toplink 10.1.3 Developer Preview 3 can be downloaded. See here for a list all the new features . And here for the release notes .

Next to numerous bug/feature fixes, I noticed the following highlights when quickly scanning the documents.

Object Relational

  1. Toplink now uses JDK 1.4 logging
  2. Support for returning clause
  3. Support for bulk updates
  4. Support for Case stament in the expression builder
  5. Support for XMLType
  6. Support for flashback queries, new Historical Session object
  7. Several changes to make the API more consistent (Hurrah!)

On the logging issue, I wonder why Oracle didn’t opt for Jakarta commons logging. In that case the developer/maintainer of an application can configure what logging the application should use, JDK1.4 logging or for example log4J logging, making it easier to integrate Toplink’s logging with other parts of the application.

All in all there seems to be a move towards making Toplink benefit more from specific Oracle Database features. When using an Oracle database that is a very good thing. It does not mean you cannot use other databases, you just can’t use these special Oracle Features. I wonder if there will similar efforts for DB2 features ;-)

Toplink also supports mapping Objects to XML. Some big enhancements have been made. Toplink strives to be JAXB compliant, but with this release it is not yet complete. On the other hand there are some mapping features beyond typical JAXB

The mapping workbench has also been upgraded.

  1. Finally you can edit the sessions.xml in the mapping workbench
  2. Support for Object – XML projects and mappings

I suppose these enhancements wil also be taken up in the Mapping Workbench/ Toplink support integrated into JDeveloper in the upcoming JDeveloper release . It will be interesting to see if you will be able to generate your Project to Java Source from within JDeveloper in the upcoming JDeveloper release. You could from the standalone Mapping workbench, but not from JDeveloper ….

Hopefully I will be able to spend some time on this Toplink version the coming weeks. I’ll post my findings. To be continued.

Leon van Tegelen's RSS Feed
Go to Top