Page tree
Skip to end of metadata
Go to start of metadata
Description

While running the analysis you may get warnings related to unresolved objects in the analysis log file. It means that the analyzer is unable to resolve the objects, either because of an ambiguity, or because the object cannot be found.

The purpose of this page is to distinguish between the different cases and offer an action plan to remedy them.

There are different variants of this message :

Analysis log file
Can not resolve 'XXX' as type in package 'aaa.bbb.ccc' from package 'www.yyy.zzz' 
Can not resolve 'XXX' as type in class 'aaa.bbb.ccc' from class 'www.yyy.zzz.TTTT'  
Can not resolve 'XXX' as type in method 'aaa.bbb.ccc(ddd.eeee.fff, ggg.hhh.i)' from method 'jjj.kkkk.lll(mmm.nnn.ooo, ppp.qqq.rrr)'
Observed in CAST AIP
Release
Yes/No
8.3.x(erreur) 
8.2.x(tick)
8.1.x(tick)
8.0.x(tick)
7.3.x(tick)
Observed on RDBMS
RDBMS
Yes/No
Oracle Server(tick)
Microsoft SQL Server(tick)
CSS3(erreur) 
CSS2(tick)
Step by Step Scenario

Below is the step-by-step scenario leading to the problem:

  1. Package and deliver the application.
  2. Set as current version.
  3. Run the analysis.
  4. Check the analysis log file.
  5. Warnings beginning with "Unable to resolve ..." are generated.
Impact of the Problem

The impact of the problem on the analysis or the dashboard is: missing links.

Action Plan
  1. Check if the unresolved object is present in the Knowledge Base
    1. Check if from the warning message you can find the canonical name of the unresolved class as shown below : in both cases, the canonical name of the unresolved class is : aaa.bbb.ccc.XXX

      Canonical name

      can not resolve 'XXX' as type in package 'aaa.bbb.ccc' from package 'www.yyy.zzz'

      can not resolve 'XXX' as type in class 'aaa.bbb.ccc' from class 'www.yyy.zzz'

      If yes, use the following query on table objfulnam as shown below.

      Is unresolved object present in KB (first case)
      SELECT idobj 
      FROM   objfulnam 
      WHERE  fullname = 'aaa.bbb.ccc.XXX' 

      If this query gives a result, then the object is present in KB and the result is its ID. If it is present, then proceed to Identify the analysis units of the calling object and the unresolved object. If it is not present, then proceed to Look for the object in the source code


    2. If the warning message does not allow you to find out the canonical name of the unresolved class,use the simple name (XXX) as shown in the below example

      Example: in the third case, the canonical name of the unresolved object cannot be found : just use the simple name (XXX)

      can not resolve 'XXX' as type in method 'aaa.bbb.ccc(ddd.eeee.fff, ggg.hhh.i)' from method 'jjj.kkkk.lll(mmm.nnn.ooo, ppp.qqq.rrr)'

      If the warning message does not allow you to find out the canonical name use the following query on the table keys

      Is unresolved object present in KB (second case)
      SELECT idkey 
      FROM   keys 
      WHERE  keynam = 'XXX' 
             AND objtyp IN ( 100, 104 ) 

      If this query gives a result, then the object is present in KB and the result is its ID. If it is present, then proceed to Identify the analysis units of the calling object and the unresolved object. If it is not present, then proceed to Look for the object in the source code

       

  2. Identify the analysis units of the calling object and the unresolved object

    1. Find-out the ID of the calling object in local base :
      1. First case : the warning message is : can not resolve 'XXX' as type in package 'aaa.bbb.ccc' from package 'www.yyy.zzz'
        The calling object is a Java package, use the below query

        Find-out the ID of the calling Java package
        SELECT k.idkey
        FROM   objfulnam ofn 
               JOIN keys k 
                 ON k.idkey = ofn.idobj 
        WHERE  k.objtyp = 99 
               AND fullname = 'www.yyy.zzz' 
      2. Second case : the warning message is : can not resolve 'XXX' as type in class 'aaa.bbb.ccc' from class 'www.yyy.zzz.TTTT'
        The calling object is a Java Class, use the below query :

        Find-out the ID of the calling Java Class
        SELECT k.idkey 
        FROM   objfulnam ofn 
               JOIN keys k 
                 ON k.idkey = ofn.idobj 
        WHERE  k.objtyp = 100
               AND fullname = 'www.yyy.zzz.TTTT' 
      3. Third case : the warning message is :can not resolve 'XXX' as type in method 'aaa.bbb.ccc(ddd.eeee.fff, ggg.hhh.i)' from method 'jjj.kkkk.lll(mmm.nnn.ooo, ppp.qqq.rrr)''
        The calling object is a Java Method, use the below query :

        Find-out the ID of the calling Java Method
        SELECT k.idkey 
        FROM   objfulnam ofn 
               JOIN keys k 
                 ON k.idkey = ofn.idobj 
        WHERE  k.objtyp = 102
               AND fullname = 'jjj.kkkk.lll' 
    2. Identify the analysis units of the calling object and the unresolved object :
      1. If the version of CAST AIP is 8.2.3 or newer, then use the following query (it implies both Management Base and Local Base)

        Find-out analysis units (CAST AIP Version >= 8.2.3)
        SELECT DISTINCT pso.object_id, 
                        cja.object_id, 
                        cja.object_name 
        FROM            <MNGT>.cms_j2ee_analysis cja 
        JOIN            <MNGT>.cms_dynamicfields cdf 
        ON              cdf.object_id = cja.object_id 
        JOIN            <LOCAL>.pmc_subsets ps 
        ON              ps.subset_name = 'CMS_AU_FULL__' 
                                        || cdf.field_value 
        AND             cdf.field_guid='entry' 
        JOIN            <LOCAL>.pmc_subset_objects pso 
        ON              pso.subset_id = ps.subset_id 
        WHERE           pso.object_id IN (<CALLING_OBJECT_ID>, 
                                          <UNRESOLVED_OBJECT_ID)
      2. If the version of Cast AIP is older than 8.2.3, use the following query instead :

        Find-out the analysis units (CAST AIP Version < 8.2.3)
        SELECT DISTINCT pso.object_id, 
                        cja.object_id, 
                        cja.object_name 
        FROM            <MNGT>.cms_j2ee_analysis cja 
        JOIN            <LOCAL>.pmc_subsets ps 
        ON              ps.subset_name = 'CMS_AU_FULL__' 
                                        || cja.object_id 
        AND             cdf.field_guid='entry' 
        JOIN            <LOCAL>.pmc_subset_objects pso 
        ON              pso.subset_id = ps.subset_id 
        WHERE           pso.object_id IN (<CALLING_OBJECT_ID>, 
                                          <UNRESOLVED_OBJECT_ID)
    3. At this step, you know the analysis unit of the calling object, and the analysis unit of the unresolved object. If both analysis units are the same, then contact CAST Technical Support and provide the Relevant Input to help CAST Technical Support team investigate and solve your problem. Else, proceed to Remedy the missing dependency

  3. Remedy the missing dependency
    In CAST-MS, add a dependency from the analysis unit of the calling object (source of the dependency) to the analysis unit of the unresolved object (target of the dependency) and relaunch analysis. If there already was such a dependency configured in CAST-MS, or if adding it and relaunching analysis did not make the warning disappear, then contact CAST Technical Support and provide the Relevant Input to help CAST Technical Support team investigate and solve your problem

    NB : If you have many warnings, you may want to use a Support Tool called dependency_injector, in order to add the missing dependencies automatically

    If you have discovered your source code using the Maven discoverer, then you could also use script MAINT_CompleteMavenDependencies.sqltxtin order to add Maven transitive dependencies.

    1. Close CAST Management Studio
    2. Run the Script in PGAdmin, on the Management base (do a set search_path to Management_DB)
    3. Run the function select MAINT_CompleteMavenDependencies(); (The optimized MAINT_CompleteMavenDependencies() function is defined in the attached SQL Script)
    4. Open CAST Management Studio, check the dependencies,
    5. Run analysis

  4. Look for the object name in the source code, If unresolved object is not present in the KB,search using Notepad++ with option "Search in Files" in *.java files on the unresolved object name.
    If you find the object in the source code, then Check the analysis log file for syntax errors related to the file containing the unresolved object. If you do not find the object in the source code then Check the classpath configuration.

  5. Check the analysis log file for syntax errors related to the file containing the unresolved object. If there is one, then this is the root cause of the issue : the file was not completely parsed, so the object was not created. You must solve the Syntax error first. Refer to CMS Snapshot Analysis - Run Analyzer - Warnings - JEE with Core CAST AIP - JSP - Syntax not Recognized. If there is no syntax error when parsing the file containing the unresolved object, then contact CAST Technical Support and provide the Relevant Input to help CAST Technical Support team investigate and solve your problem.

  6. Check the classpath configuration
    Since the unresolved object is not present in Knowledge Base, and you did not find the object in the *.java files from the source code, it is likely to be present in the jar files delivered with the source.
    1. If you have some knowledge of the unresolved object, and recognize which API it is part of (example : JmsQueueSender is part of the JMS framework)., then you can directly look for the appropriate jar file (in this example, jms-x.y.z.jar).
      1. Look for the jar in the deploy folder. If you do not find it, then contact development team for missing source code.
      2. If you find it, then in CAST-MS, open the analysis unit containing the calling object and check in Analysis tab that the folder containing the jar is included in the classpath configuration. Either directly included as a classpath entry, or included by recursive (if a parent folder is present with the "Recursive" checkbox checked)
      3. If it is not the case, add it to the classpath configuration and relaunch analysis. If issue persists, then contact CAST Technical Support and provide the Relevant Input to help CAST Technical Support team investigate and solve your problem.
    2. If you do not know which jar file could contain the unresolved object, use a global approach. First check that all the jar files delivered are included in the classpath configuration.
      1. Do a Windows Search on *.jar in the deploy folder. It will give you all the folders that contain jar files.
      2. In CAST-MS, open the analysis unit containing the calling object and check in Analysis tab that each of these folders are included in the classpath configuration, either directly included as a classpath entry, or included by recursive (if a parent folder is present with the "Recursive" checkbox checked).
      3. If it is not the case, add the missing jar folders to the classpath configuration.
      4. Now check that all the classpath folder entries configured in CAST-MS exist and are not empty. For this you can use a Support Tool called classpath_checker. If you find that some of these entries do not exist or do not contain jar files, then there probably is a problem with the source code. Check with development team if every jar file was delivered.
      5. If the classpath configuration is correct, then you need to contact development team and ensure that you have all the source code. If they say you have all the source then contact CAST Technical Support and provide the Relevant Input to help CAST Technical Support team investigate and solve your problem.
Notes/comments
 
  • No labels