mardi 14 avril 2009

Deploying an ADF Application to Weblogic : two mistakes to avoid

Last friday I was supposed to demonstrate our application ; you may know that if you follow this blog. Actually we wasn't able to do show anything because of two errors ; I'm sharing with you :

1. Couldn't find jdbc datasource
In this article from Chris Muir is explained how to configure a jdbc datasource for an adf application deployed on weblogic. What's not actually told is what caused us troubles : the jdbc ds should not contain any "_" or "-" or any other special characters like these.
Because of that, the application was not able to resolve in the jndi tree the matching data source, and it was a source of error. Renaiming it in the application and on weblogic solved it.

2. 500 internal server error ; could'nt find faces context
It actually was a tricky one. On the welcome page of the application you have to input a login and a password, then click an action button. Clicking it, and others actions components in the application causes the server to crash due to an "internal error". Checking the logs revealed that the application could'nt find its context. The error in the stack trace pointed to a line of the backing bean action method which invoked a method-binding (with bindings.getOperationBinding("")). And on top of that, just so you know, the application behaved perfectly on integrated weblogic.

What causes the problem ? Check right now your web.xml, welcome-file node : we just had the name of the page :
/login.jspx
Instead, you should have :
/faces/login.jspx

In fact this is a known bug of Jdeveloper inherited from the 10g version. It is generated when you run the viewController project of the application for the first time. JDev asks you to set a default run target, wich is a jsp page, and write it in the web.xml under this welcome node, without /faces/.

But what's unresolved here -for me- is why this error only occured on the remote server, and not on the local integrated one.

Aucun commentaire: