Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How do i debug "ADFc view scope" errors

DrHoneybearJun 13 2022

Getting lots of these as we navigate through our app at run-time. Everything seems to work but it's challenging to find 'real errors' when hundreds of these logs are posted in an hour or so.

<oracle.adf.model> <SaveStateTokenListener> <afterPhase> <ADFc: ViewScope not available in this environment, cannot save State-token.> 
<oracle.adf.view> <FacesPageLifecycle> <getToken> <ADFc: ViewScope not available in this environment, cannot restore State-token.> 

I've no idea where to start debugging as I didnt write the app, a team of 5 did, it's huge, and I am an ADF/Jdeveloper N00b.

Help / advice please?

This post has been answered by Timo Hahn on Feb 6 2023
Jump to Answer

Comments

odie_63
Answer
Are you working with something like this?
<?xml version="1.0" encoding="WINDOWS-1252" ?>
<report name="MODULE1" DTDVersion="9.0.2.0.10">
  <xmlSettings xmlTag="MODULE1" xmlPrologType="text">
  <![CDATA[<?xml version="1.0" encoding="&Encoding"?>]]>
  </xmlSettings>
  <data>
    <systemParameter name="MODE" initialValue="Default"/>
    <systemParameter name="ORIENTATION" initialValue="Default"/>
  </data>
  <layout>
  <section name="main">
    <body>
      <image name="B_1">
        <geometryInfo x="0.00000" y="0.00000" width="8.31250" height="6.25000"
        />
        <visualSettings fillPattern="transparent" fillBackgroundColor="black"
         linePattern="transparent" lineBackgroundColor="black"/>
        <points>
          <point x="0.00000" y="0.00000"/>
          <point x="8.31250" y="6.25000"/>
          <point x="0.00000" y="0.00000"/>
          <point x="8.31250" y="6.25000"/>
        </points>
        <binaryData encoding="hexidecimal" dataId="image.B_1">
          
FF8DFF0E 0001A464 94640010 10100006 00060000 FFBD0048 0001B0C0 E0C0A001
E0D0E021 11013181 82A18161 61811332 52D182A3 33D3C393 33837304 84C5E404
44755473 8305D615 75F52676 8676E3D4 17970746 87C55676 36101121 21815181
F2A1A1F2 36248324 36363636 36363636 36363636 36363636 36363636 36363636
36363636 36363636 36363636 36363636 36363636 36363636 3636FF4C 102A0000

[...]

D29681A8 4EB94557 F3D8D588 912F1FCE A2478278 4E157FE8 D3B2F257 A1906D14
A809D102 9F646EFF 007CA66A B08C98EF 2E5344BB 4978EEAD 55093F75 6A4E8D29
345ECCA0 4F537A2C 9CB424CB 8DDE0D7D 53D4D002 D3E32E6D 1942F70F 5D29740C
7CF15A56 1A469E72 F449A09D 918DE7CF 5F9F877A 17106FEF 474C484E 6F41C067
0D1338AF 1D06311A 4E6608F0 F4C40540 859FBFE7 579924E1 495C31FF 9D
        </binaryData>
      </image>
    </body>
  </section>
  </layout>
  <webSource>
  <![CDATA[<%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %> 
<%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp" session="false" %>
<%@ page contentType="text/html;charset=ISO-8859-1" %>
<!--
<rw:report id="report"> 
<rw:objects id="objects">
</rw:objects>
-->

<html>

<head>
<meta name="GENERATOR" content="Oracle 9i Reports Developer"/>
<title> Your Title </title>

<rw:style id="yourStyle">
   <!-- Report Wizard inserts style link clause here -->
</rw:style>

</head>


<body>

<rw:dataArea id="yourDataArea">
   <!-- Report Wizard inserts the default jsp here -->
</rw:dataArea>



</body>
</html>

<!--
</rw:report> 
-->
]]>
  </webSource>
  <reportPrivate versionFlags2="0" templateName="rwbeige"/>
  <reportWebSettings>
  <![CDATA[]]>
  </reportWebSettings>
</report>
Image data is encoded in hexadecimal format (base16) but the hex digits are reversed compared to the original byte sequence.
For example, the first eight bytes in the source are :
FFD8FFE0 00104A46
but appears as
FF8DFF0E 0001A464
in the XML file.

You'll need a small program to read the file, extract the hex binary stream, process it and write back the data to a file.

Example in PL/SQL (tested on db version 11.2.0.2) :
DECLARE

 fid     utl_file.file_type;
 len     PLS_INTEGER := 1024;
 buf     RAW(512);
 
 module_name VARCHAR2(260) := 'MODULE1';
 dir_name    VARCHAR2(30) := 'TEST_DIR';

BEGIN

  for r in (
    /* extract all image elements */
    select img_name
         , regexp_replace(img_data, '\s+') as img_data
    from xmltable('//body/image'
          passing xmltype(bfilename(dir_name, module_name||'.xml'), nls_charset_id('WE8MSWIN1252'))
          columns img_name varchar2(30) path '@name'
                , img_data clob         path 'binaryData'
         )
  )
  loop
    /* output file */
    fid := utl_file.fopen(dir_name, module_name || '_' || r.img_name || '.jpg', 'wb', 32767); 

    for i in 0..trunc((dbms_lob.getlength(r.img_data) - 1 )/len)
    loop
      
      /* read 1k of hex data and convert to binary */
      buf := hextoraw(
               regexp_replace(
                 dbms_lob.substr(r.img_data, len, i*len + 1)
               , '(.)(.)'
               , '\2\1'
               )
             );
      
      utl_file.put_raw(fid, buf);
      
    end loop;
    
    utl_file.fclose(fid);
  
  end loop;

END;
/
Marked as Answer by 971919 · Sep 27 2020
971919
Odie,

This was what I was looking for!

I now wonder why I didn't notice that it was this simple!

Regards, Herman
1 - 2

Post Details

Added on Jun 13 2022
12 comments
428 views