Thank you for visiting! If you liked the site, please add a bookmark, else add a critical comment! Would you like to visit Greece? Traditional Greek flag Αεροπλάνα - Καράβια - Ξενοδοχεία The holy mountain

Friday, 24 February 2012

EJB 3 Deployment guide for WebLogic Server Version:

Apart from setting up a domain with the jrf libraries and data sources, presently the books and developer guides for  ADF 11g development do not delve into deployment troubleshooting details, as the prior ADF 10g documentation did. Moreover, the older docs included deployment directions for Tomcat, JBoss, etc, which is currently missing from the 11g versions. This rough guide is a supplement to the docs presenting solutions, workarounds, tips and hints to avoid exceptions during deployment. The following hints and tips about deployment apply to the versions below: Build JDEVADF_11.
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)

The full version of the guide is available as a personalized pdf file for sale upon request. My contact details can be found at the "About me " page.

 EJB 3 Model security setup

 A primer to ADF security which focuses mainly on Oracle Business Components is given here:
Security for Everyone, By Frank Nimphius at:
Besides the usual web.xml entries etc, the EJB 3 model project may require more security entries in weblogic-application.xml, as java standard edition clients, ie junit testing ones, require that extra step. Since some people allege isCallerInRole(“”) always returns false, it seems that @RolesAllowed annotation only does not do the job.

private static Context getInitialContext(String user, String password) throws NamingException {
Hashtable env = new Hashtable();
// WebLogic Server 10.x connection details
env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
env.put(Context.PROVIDER_URL, "t3://");
env.put(Context.SECURITY_PRINCIPAL, user);
return new InitialContext( env );

 Stand alone server deployment errors

When I tried the application on my integrated WLS, it worked fine. However, the standalone misbehaved:

Weblogic Server Exception: weblogic.application.ModuleException: Failed to load webapp: '...'
Caused by: java.lang.ClassNotFoundException: javax.faces.webapp.ConverterELTag
Solution: add jsf 1.2 library

java.faces.webapp.facesservletNotfound  Exception, 

It is raised when migrating an application to newer or older, versions of JDeveloper,
check the viewController project for the proper jsf version library. Is it jsf 1.2, or is it not?

Caused by: java.lang.ClassNotFoundException: oracle.adfinternal.controller.util.LogUtils
Solution: add adf controller runtime library

When I added some more ADF faces run time related jars in JDev I got a new one:
Caused by: java.lang.ClassNotFoundException: org.apache.myfaces.trinidad.webapp.UIXComponentELTag

SOLUTION: In my particular case, ADF & EJB 3, I managed to get away with only:

log4j-1.2.15 in META-INF/lib

On the other hand the CAT Conflicts Summary:
There are potential conflicts detected and they do not seem to have been resolved. Please review the potential solutions below.
  • 121 classes are in conflict
  • Those classes are found in the following main packages:
    • oracle.adf.model.*
    • oracle.jbo.client.*
    • oracle.xml.xsql.*
Suggested Solution:

"DataBindings.cpx" descriptor appears in the application classpath more than once:
SOLUTION: You might do a clean build if you face this error, or delete the remains of the application from
JDeveloper\system11.1.1.\o.j2ee\drs folder for the integrated server.

oracle.jbo.NoDefException: JBO-25002: Definition actionbazaar.DataControls of type null is not found.
Caused by: oracle.mds.core.MetadataNotFoundException: MDS-00013: no metadata found for metadata object "/.../DataControls.dcx"
SOLUTION: restore DataControls.dcx if deleted.

Next the worst of all, might force one to redevelop the application from scratch:
at oracle.adf.model.binding.DCIteratorBinding.getSortCriteria(
at oracle.adf.model.binding.DCInvokeMethod.setAssociatedIteratorBinding(
at oracle.adf.model.binding.DCIteratorBinding.cacheRefOnOperation(
at oracle.jbo.uicli.binding.JUMethodIteratorDef$JUMethodIteratorBinding.getActionBinding(
at oracle.jbo.uicli.binding.JUMethodIteratorDef.isRefreshable(
at oracle.adf.model.binding.DCExecutableBindingDef.isRefreshable(
at oracle.adf.model.binding.DCBindingContainer.refreshExecutables(
at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(
at oracle.adf.model.binding.DCBindingContainer.refresh(
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareModel(
at oracle.adf.controller.v2.lifecycle.Lifecycle$2.execute(
at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(
at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.access$400(
at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.startPageLifecycle(
at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$1.after(
at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(
at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(
at javax.faces.webapp.FacesServlet.service(
at weblogic.servlet.internal.StubSecurityHelper$
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
at weblogic.servlet.internal.ServletStubImpl.execute(
at weblogic.servlet.internal.TailFilter.doFilter(
at weblogic.servlet.internal.FilterChainImpl.doFilter(
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(
at weblogic.servlet.internal.FilterChainImpl.doFilter(
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(
at weblogic.servlet.internal.FilterChainImpl.doFilter(
at Method)
at weblogic.servlet.internal.FilterChainImpl.doFilter(
at oracle.dms.servlet.DMSServletFilter.doFilter(
at weblogic.servlet.internal.FilterChainImpl.doFilter(
at weblogic.servlet.internal.RequestEventsFilter.doFilter(
at weblogic.servlet.internal.FilterChainImpl.doFilter(
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(
at weblogic.servlet.internal.WebAppServletContext$
at weblogic.servlet.internal.WebAppServletContext.securedExecute(
at weblogic.servlet.internal.WebAppServletContext.execute(

An experienced eye would notice the missing “Caused by...” clause due to log truncation. One must dig the full domain log to investigate further. This one is related to missing or corrupted pageDef files. Especially for EJB 3 model projects it might relate to failure of loading beans via jndi or perhaps a malfunctioning Datasource, not created correctly or strangely losing the password. Using local EJB 3 interfaces rather than remote, is recommended for web applications. Some reported that building the application from scratch had been their only workaround. So much for Rapid Application Development (RAD); some others only edited the problematic pages:

1) In the Overview Tab of the page definition file for the problematic page, remove all items (method actions, iterators, trees, etc) in Bindings and Executables, except for the variables entry.

2) In the Application Navigator, rebuild the EJB Session Beans used for this page definition file. Then select these EJB Session Beans (right click) and choose Create Data Control.

3) In the Data Controls window, make sure to click the refresh button.

4) Delete the forms/ tables on the problematic page.

5) Recreate (Click and drag) the forms and/ or tables from the Data Controls for the page in question. And also redefine the method action and other items on your page definition file.


One only hopes when the time comes for deployment to the production application server, it won't be necessary to start development from the beginning. This rarely has been the case for good, old OC4J stand alone server deployments. Perhaps avoiding use of the integrated server and deploying from the early stages of development to the stand alone one is preferable. So much for increasing developer productivity! Finally, one could consult for more tips the resources below.

 References by René van Wijk

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Post a Comment