X

Technical Articles relating to Oracle Development Tools and Frameworks

  • ADF
    August 30, 2013

Dealing with ADF_FACES-30214

Duncan Mills
Architect

Whilst doing some work on a separate blog entry using the demo Summit application in 12c I noticed a message repeated again and again in the WebLogic log in the console. Nothing annoys me more that constantly repeating messages that obscure the stuff I really want to see (I've wrapped the message to fit here) :

 <Warning> <oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer> 
<ADF_FACES-30214> <The setting to enable version display will be ignored
because the application is running in production mode.>

Switching this message off is super easy, as we'll see, but what does it relate to?

Well, this is all to do with the following context parameter defined in your web.xml file

  <context-param>
<description>Whether the 'Generated by...' comment at the bottom of ADF Faces HTML pages should contain version number information.</description>
<param-name>oracle.adf.view.rich.versionString.HIDDEN</param-name>
<param-value>false</param-value>
</context-param>

This parameter defines if the generated page output contains detailed information about the ADF version. This information is useful in development and QA evironments but is not something that you want in a production environment as it is of potential use to a Hacker. So, to see the version information we need to explicitly include this context paramter and set the value to false so as not to hide the version info.

Now in JSF 2 we have an additional factor come into play to complicate matters, which is the Project Stage (there are several articles on Project Stage that you can find with your favorite search engine, but this one covers the basics). Basically Project Stage is a way that you can define an application as being in Development, Test or Production mode and effect changes accordingly (both in the declarative sense as we have an example of here, but also in terms of code and behaviors). 

Now the problem that all this relates to, the unwanted log message, is a reflection of the fact that if the Project Stage is not explicitly defined then it's going to default to Production mode (hopefully the message begins to make sense now?) . So we kind of have two mutually exclusive settings in this app.  On one hand I'm asking for Development time version information, and on the other hand the app thinks it's in production mode. The result is this message, and, if you look at the actual source of the page in the browser you'll see this:

<!--Created by Oracle ADF (Version information hidden), 
accessibility (mode:null, contrast:standard, size:medium),
skin:skyros-v1.desktop (skyros)-->

The fix?  Well I do want to see the version information so I need to tell the application that it's in Development mode, not Production mode. To do this I just have to add a Project Stage entry into web.xml:

  <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>    
    <param-value>Development</param-value>
  </context-param> 

(Note the value is capitalized "Development")  

Now when the application is re-deployed, the pesky message has gone and the page source contains oodles of version information:

<!--Created by Oracle ADF (ADF RichClient API - ABRAMS (custom: 12.1.2.0.40.66.68) 
/ ADF RichClient Impl - ABRAMS (custom: 12.1.2.0.40.66.68)
/ ADF-Controller{Oracle-BuildSystem=Linux - java - 1.7.0_10-b18,
Oracle-Label-JDEVADF=JDEVADF_12.1.2.0.0_GENERIC_130608.2330.6668,
Oracle-Version=12.1.2.0.40.66.68, Created-By=23.6-b04 (Oracle Corporation),
Oracle-Builder=Official Builder, Oracle-Label=JDEVADF_12.1.2.0.0_GENERIC_130608.2330.6668,
Oracle-BuildTimestamp=2013-06-09 02:39:02 -0700}
ADF-Model{Oracle-BuildSystem=Linux - java - 1.7.0_10-b18,
Oracle-Label-JDEVADF=JDEVADF_12.1.2.0.0_GENERIC_130608.2330.6668,
Oracle-Version=12.1.2.0.40.66.68, Created-By=23.6-b04 (Oracle Corporation),
Oracle-Builder=Official Builder, Oracle-Label=JDEVADF_12.1.2.0.0_GENERIC_130608.2330.6668,
Oracle-BuildTimestamp=2013-06-09 01:58:04 -0700}
ADF-Share{Oracle-BuildSystem=Linux - java - 1.7.0_10-b18,
Oracle-Label-JDEVADF=JDEVADF_12.1.2.0.0_GENERIC_130608.2330.6668,
Oracle-Version=12.1.2.0.40.66.68, Created-By=23.6-b04 (Oracle Corporation),
Oracle-Builder=Official Builder, Oracle-Label=JDEVADF_12.1.2.0.0_GENERIC_130608.2330.6668,
Oracle-BuildTimestamp=2013-06-09 12:47:43 -0700}  / powered by JavaServer Faces - 1.0.0.0_2-1-20),
accessibility (mode:null, contrast:standard, size:medium), skin:skyros-v1.desktop (skyros)--> 

Next time I show how you can use a WebLogic Deployment Plan to update the Project Stage as you deploy your application 

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha