Future Edge IT

The future is the place we live in tomorrow

I’ve just been working getting working in our project. We are using Spring and Maven.
continue reading…

A little problem i’ve stumbled upon was the wish to use a web.xml context parameter to configure the location of a property file to use in a PropertyPlaceholderConfigurer.

Reading the documentation of Spring i found the ServletContextPropertyPlaceholderConfigurer. However that didn’t work out of the box.

continue reading…

Using ADF it is possible to create declarative components. However following the ADF documentation, it is necessary to create them in a separate project and package them to a JAR you include in your web application.

With a little hacking it is entirely possible to create those declarative components within your web project and use them there. (We use this proces in our ADF 11.1.1.4.0 project, but it still works in ADF 11.1.2.0.0 (a few changes are needed)

continue reading…

Ever found yourself needing a JSF validator and thinking: ‘Well i could do that check in EL easily….’?
I have and couldn’t find an easy solution, so we thought up one: wouldn’t it be great if we had a validator that checked an EL value for true or false?

The main thing to worry about, is how you get the data you need to validate to the EL expression. We fixed that by putting it (a little messy, but functional) on the request scope map.

continue reading…

An update on one of the problems we had during our upgrade to ADF 11.1.2 (SR 3-4526222751). When you use an <af:table> element on a view and also make that view <bookmark>-able it will reload constantly.

A viable workaround (for us at least) is to set the contentDelivery to ‘immediate’ and set the fetchSize to at least the number of records expected (so the table does not do a ‘postback’ to retrieve more data).

So only one service request remains at the moment (SR 3-4526222765: Page as displayed to webcrawler crashes due to <bookmark>). Unfortunately i haven’t had *ANY* reaction on that for more than three weeks… not even a confirmation that the testcase reproduces or not… grrrrr…

For our ADF application that we are upgrading to ADF 11.1.2 we encountered a real gotcha! We usually generate our libraries from the dependencies expressed in the project POMs (as we use maven on the build server to build, qa and deploy our application), but during an upgrade all ADF libraries are changed (at least in version number) so i usually copy all ‘external’ JAR dependencies to a directory and include them as JAR dependencies to our jDeveloper projects.

We are using a custom JAAS login module to authenticate and authorize our users. That JAAS module is packaged using extensive packaging mechanisms (creating mbeans, descriptors, etc) so it can be used in our Weblogic server. However because we use some classes to get account information from the JAAS principals we also need to include that JAR file in our web application.

No problems so far. Until we started our migration to ADF 11.1.2. Very strange class loading problems started to happen. The principals couldn’t be found anymore in our application and everything with authentication and authorization went hay-wire.

What seemed to be the problem? Classloading… If you use a JAR file as a dependency in your project the ‘export’ checkbox doesn’t seem to work the same as when you create a library to add that JAR file as a dependency. A lot of searching revealed that the JAAS module (added as a JAR file but not exported) was actually being deployed to the server in the WEB-INF/lib directory. Now the classloading problems made sense.

The fix was to define a library for it and not export that, but it is weird it works differently.

Just an update about the upgrade to ADF 11.1.2. Search Engine Optimalization was announced in this article. I was kind of elated because SEO is a pet peeve of mine when talking about the ADF framework. To get our website working in SEO we needed a lot of hacks (such as these). My main aggrevation was from the assumption all clients of your site will accept, understand and follow javascript redirects (Think RSS reader, we implemented an RSS stream in a JSF phaselistener …). So i got my hopes up when reading that article title.

Unfortunately nothing useful was solved… You can use EL to detect if a crawler is reading your page. Whooptiedoo, good going… especially if the crawler is never going to see that page as it will break over the javascript initially sent….

I’ll be checking and updating our hacks and will let you know if they need major changes to get them working again.

I made a mistake in claiming the loopback script was not changed for webcrawlers. Unfortunately we still had a couple of workarounds in place that rewrote bots to the gecko user-agent. It seems the loopback script is actually not sent to the webcrawler. We are still experiencing a redirect for the adf.ctrl-state but i must amend my first observation. It seems something wonderful is happening as i had hoped in the first place!

Update (2): ignoring the redirect for the _adf.ctrl-state for now leaves us facing another bug relating to the <bookmark> of a view. If you render a page (using a webcrawler agent) and an <af:commandLink> has an ‘action’ that navigates to a view that has <bookmark> enabled, it will crash with a new NullPointerException.

java.lang.NullPointerException
	at com.sun.faces.application.view.MultiViewHandler.addViewParameters(MultiViewHandler.java:554)
	at com.sun.faces.application.view.MultiViewHandler.getFullParameterList(MultiViewHandler.java:530)
	at com.sun.faces.application.view.MultiViewHandler.getBookmarkableURL(MultiViewHandler.java:350)
	at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:211)
	at javax.faces.application.NavigationCase.getBookmarkableURL(NavigationCase.java:206)
	at oracle.adfinternal.view.faces.renderkit.rich.GoLinkRenderer._getDestinationForCrawler(GoLinkRenderer.java:259)
	at oracle.adfinternal.view.faces.renderkit.rich.GoLinkRenderer.encodeLink(GoLinkRenderer.java:210)
	at oracle.adfinternal.view.faces.renderkit.rich.GoLinkRenderer.encodeAll(GoLinkRenderer.java:167)
	at oracle.adfinternal.view.faces.renderkit.rich.CommandLinkRenderer.encodeAll(CommandLinkRenderer.java:170)

After looking into the source the NPE is caused by an empty ViewMetaData element. That element is retrieved from the ViewDeclarationLanguage that is eventually represented by com.sun.faces.application.view.JspViewHandlingStrategy. However JspViewHandlingStrategy contains:

public ViewMetadata getViewMetadata(FacesContext context, String viewId)
{
  return null;
}

Nice, eh? This will also become a SR, i’ll keep you updated on progress.

Update (3): Created a SR (3-4526222765), now waiting for a response

Upgrading to ADF version 11.1.2 is proving to be quite a bit of work. No so much from changes in the framework but more so from changes in everything else.

We are encountering a lot of problems due to naming. We had a declarative component with a property named ‘for’. That resulted in an invalid generated .java file. We have a general purpose bean to lookup string values called ‘resource’. However in JSF 2.0 that seems to be a bean that is used by the framework :( . First count resulted in 2015 occurences to replace…

Just a little message about an error that gave us lots of headaches.

org.hibernate.HibernateException: Errors in named queries

During an upgrade of another library we removed all dependencies from our project to solve some JAR clashes. It seemed we forget to add ANTLR back when adding the hibernate libraries. Unfortunately Hibernate gives a very strange error when the ANTLR library is missing, not that a library is missing but that named queries in entities have errors!

In the process of upgrading our ADF application from version 11.1.1.4.0 to version 11.1.2.0.0 we stumbled upon problem using declarative components. In our version 11.1.1.4.0 application we ‘worked around’ having to declare declarative components in a separate project by writing our ‘own’ Tag classes and tag library. This was mainly because JDeveloper 11.1.1.4.0 generates those files only when deploying the project and we don’t want the separation of those components into another project.
continue reading…