After running a J2EE analysis user can observe in analysis log a warning of type: "class ‘XXXX’ is not visible - one dependency is missing".
2017-10-23 16:18:52.642381 Information Job execution Parsing file (resolve declarations) : S:\Sources\App_Name\Analyzed\SomeJavaFile.java 2017-10-23 16:18:52.746482 Warning Job execution class 'com.something.service.rule.RuleSyncSome' is not visible - one dependency is missing [S:\Sources\App_Name\Analyzed\interface\lib\rule-sync-some.jar]\com\something\service\rule\RuleSyncSome.class 2017-10-23 16:18:52.756491 Warning Job execution class 'com.something.service.rule.RuleSyncSomeOther' is not visible - one dependency is missing [S:\Sources\App_Name\Analyzed\interface\lib\rule-sync-someother.jar]\com\something\service\rule\RuleSyncSomeOther.class
Typically this message is preceded by the information message “Parsing file (resolve declarations) : ‘’XXXX.java” or "Parsing Java file: ‘’[XXXX.jar]/yyyy.class” . Depending on the type of file that is referred in the information message:
- The Java analyzer is trying to resolve references of a .class file SomeClass.class in a .java file that belongs to an analysis unit A and the corresponding SomeClass.java file has already been analysed in an analysis unit B. In this case the warning informs that there is no dependency from A to B as described in CMS Dependencies Rules tab
- The Java analyzer is trying to resolve references towards a .class file that has already been analyzed and is found inside a JAR archive which is declared in J2EE Environmental Profiles or is part of the Class Paths of the Application or an Analysis Unit
Release | Yes/No |
---|---|
8.3.x | |
8.2.x | |
8.1.x | |
8.0.x |
RDBMS | Yes/No |
---|---|
Oracle Server | |
Microsoft SQL Server | |
CSS3 | |
CSS2 |
Step by Step scenario
- Package and deliver the application.
- Set as current version.
- Run the analysis.
- Open the analysis log file
- You can find warnings of type "class ‘XXXX’ is not visible - one dependency is missing"
Perform the below actions
- Identify in the analysis log the file that is being parsed and is the root cause the warning message. Since there can be several consecutive "class ‘XXXX’ is not visible - one dependency is missing" warnings, browse the analysis log messages from bottom to top until you find the first information message of type "Parsing file (resolve declarations)" or "Parsing Java file". The objective is to detect the type of the culprit file(.java file or .class file inside a JAR file).
Examples :
Information: Job execution Parsing Java file (phase 2) : [S:\Sources\App_Name\Analyzed\JAR\Some.jar]\com\server\Someclass.class - the file is a class file inside a JAR
Information Job execution Parsing file (resolve declarations) : S:\Sources\App_Name\Analyzed\SomeJavaFile.java - the file is a java file- In the case of a .class file inside a JAR file, classes in JAR files are EXTERNAL objects, which means that the analyzer will not draw any links starting from them. These warnings have no consequences on links and transactions and should be ignored. From version 8.2.8 onwards, this functionality has been improved and this kind of messages no longer appear for classes found in JAR files as can be seen in Changes in results post upgrade - 8.2.8
In the case of a .java file, the warning is thrown because there are missing dependencies between the parsed .java file and the .java source file which corresponds to the .class file mentioned in the warning.
Let's consider the following example:Information Job executionParsing file (resolve declarations) : S:\Sources\App_Name\Analyzed\SomeJavaFile.java Warning Job execution class 'com.something.service.rule.RuleSyncSome' is not visible - one dependency is missing [S:\Sources\App_Name\Analyzed\interface\lib\rule-sync-some.jar]\com\something\service\rule\RuleSyncSome.class
The above messages mean that SomeJavaFile.java has been analyzed in an analysis unit A and RuleSyncSome.java has been analyzed in an analysis unit B and there is no dependency between the analysis units A and B.
Check if SomeJavaFile.java file belongs to a Maven or Eclipse project, by examining the corresponding pom.xml or .project +.classpath files of analysis unit A- If SomeJavaFile.java belongs to a Maven or Eclipse project, missing dependencies between analysis units are the result of incorrect packaging of the application, when using the Delivery Management Tool . For Maven and Eclipse projects that contain pom.xml and .project+.classpath files respectively, checking the relevant options in the package configuration will automatically create the correct dependencies between the analysis units. More information on how to package a J2EE application can be found in Delivery Manager Tool - Information - How to Package Java applications using the Delivery Manager Tools
- If SomeJavaFile.java does not belong to a Maven or Eclipse project, the missing dependencies between analysis units are not automatically discovered during packaging phase, because the project descriptors are not supported (for example ANT build) or because the classes are not declared in the Maven or Eclipse project descriptors. In this case the Delivery Management Tool mechanism does not have the necessary information to create the dependency automatically. In this case you have 2 options:
- In the case of a large number of warnings and analysis units involved, you can use the Dependency Injector Tool
- In the case of a limited number of warnings and analysis units involved you can add the dependencies manually. For the above example:
- Search in Windows Explorer in which folder RuleSyncSome.java is located.
- Go to Current Version, and sort the analysis units by Root Folder
- Based on this, lookup in which analysis unit belongs RuleSyncSome.java. This is the Target AU the dependency
- In the analysis log file, look what was the last "Parsing file xxxxx" message and note the file name. in our example this is SomeJavaFile.java and the path is 'S:\Sources\App_Name\Analyzed\'
- Based on the path of the file, lookup the list of Analysis Units sorted by root path and find out which analysis unit it belongs : this is the Source AU of your dependency
- Add the dependency from the Source AU to the Target AU
- If the above steps do not solve your issue contact CAST Technical Support. with the Relevant Input to reproduce issue.
Tickets #10304, 10341, 10394, 10538, 10540, 10638, 11024, 11196
Specify pages indirectly related to this topic.(eg:side- effects)