Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:13:13 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

April 2004
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Mar   May

Get Firefox!

Thursday, April 29, 2004

Some JDeveloper 10g users have encountered intermittent JSP page compilation errors like:

  •  java.lang.ExceptionInInitializerError
  •  java.lang.NoClassDefFoundError

while compiling JSP pages. User's complained that sometimes the error would occur, but then after seemingly random things like exiting JDeveloper and restarting, the problem would go away. Working over the last few days with a very helpful customer who had the patience and perseverance to narrow down a set of reproducible steps, we cornered the problem today and traced it to a classloading issue regarding the Jakarta commons-logging libraries and Log4J inside the JDeveloper 10g environment. The problem occurs because JDeveloper includes commons-logging in its base IDE classpath, while Log4J was only part of the customer's project classpath (and they have a dependency on each other when used). We tracked down the "random" problem, where exiting the IDE and restarting would make the problem go away, to the fact that if the JSP Visual Editor was open when you exited JDeveloper, and so it was open again upon restarting JDeveloper 10g the next time, the order of initializing and loading classes changed and the problem then didn't reproduce. We'll include a definitive fix for 9.0.5.2, but in the interim here is the simple solution.

The Solution: Add Log4J to the JDeveloper 10g IDE Classpath

Assuming you have downloaded log4j version 1.2.8 from the Apache logging website, and that you've extracted the distribution into a directory like C:/apache, then to avoid these compilation errors you need to add the log4j jar file to JDeveloper 10g's design time CLASSPATH. This is accomplished by adding a directive to the jdev.conf file as described below:

  1. Exit JDeveloper 10g

  2. After making a backup, edit the JDEVHOME/jdev/bin/jdev.conf file

  3. Add the following line to the end of the jdev.conf file, and save it:

    AddJavaLibFile C:/apache/jakarta-log4j-1.2.8/dist/lib/log4j-1.2.8.jar
  4. Restart JDeveloper 10g

After performing these steps, your Log4J related JSP compilation errors should be no more.

NOTE: Adding this library to jdev.conf only eliminates the classloader issue with the JSP compilation noted above. It does not once-and-for-all include the Log4J library into the classpath of every project that you build. If you import/use Log4J classes in your code, then like any library that you use in your project, you need to still include a library for it in your project properties "Library" list.


6:52:20 PM    



A user writes in asking, "How could I build an ADF Data Control that exposes Lotus Notes data?"

While we don't have a prebuilt example specifically for Lotus Notes, we do provide a couple of useful places to look in order to understand how to develop your own custom data control. The first is the Custom LDAP Data Control sample that is part of our JDeveloper 10g samples bundle (look for  "Custom ADF Data Control" under the Advanced category). The second is the source code for our ToplinkDataControl, which we ship with the JDeveloper 10g product. You can find that in the JDEVHOME/BC4J/src/adfmsrc.zip archive.

Note that if you are in a project that is configured for using the ADF model layer (that is, with the "ADF Model Runtime" library in your project's library list), then you can quickly jump to the source code of the ToplinkDataControl by using the Navigate | Goto Java Class... menu item, or its keyboard shortcut [Ctrl]-[Minus], followed by typing in the first few letters of the name like "ToplinkD".


7:34:31 AM    


Some users on OTN have sporadically encountered an issue in JDeveloper 10g production where performing a drag/drop operation of a custom method from the Data Control Palette onto a DataAction in their Struts page flow diagram does nothing (instead of properly setting up the Struts action properties to support the declarative method invocation.

If this happens to you, until we release the 9.0.5.2 maintenance release where this will be fixed, do the following:

  • Select the DataAction in the page flow diagram that just didn't work for drag/drop.
  • Perform a right-mouse "Bring to Front" (even if it looks like it's already in front!)
  • Retry dragging and dropping the method onto that DataAction again.

That should get it working again. Sometimes the page flow diagrammer gets confused about the kind of node your dropping on and bringing it to the "top" of the Z-order helps it get unconfused.


7:23:46 AM    


Duncan Mills, our main product manager working on our IDE features for Struts, just released a new quick-tip article on OTN called Creating a Databound Drop Down List in Oracle JDeveloper 10g. It takes you step by step through building a JSP page that implements the DepartmentId field as a data-driven combobox, where you pick the name of the department from a list, instead of just a simple text field where you type in the department id number.


7:14:12 AM    


The Oracle Portal extension (a.k.a. "plug-in") is now available for Oracle JDeveloper 10g on the JDeveloper Extension Exchange and provides two wizards - Java Portlet and Oracle PDK Java Portlets for Oracle JDeveloper 10g. Both the wizards allow building and deploying portlets. You can also download it from the Portal Center.

If you work with Oracle Portal, make sure you're subscribed to Tug Grall's blog as well! He's a blogging product manager on our portal team.


5:37:02 AM    


© Copyright 2008 Steve Muench.