Purpose

This page describes how to deal with the warning JAVA044: Syntax not  recognized or JAVA052: Syntax not  recognized while performing a Java analysis.

2018-11-15 13:23:15.935923	Warning	MODULMSG ; Job execution	JAVA044: Syntax not  recognized :

			finally {

				if (rs!=null) {

					rs.close;

-------------^

				}

				if (is!=null) {

					is.close;
S:\Sources\Analyzed\Some.java


For more information refer to JEE - Analysis messages

Observed in CAST Extension

Release

Yes/No

JEE 1.2.x(tick)
JEE 1.1.x(tick)
JEE 1.0.x(tick)
Applicable RDBMS
RDBMS
Yes/No
Oracle Server(tick)
Microsoft SQL Server(tick)
CSS3(tick)
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. Validate analysis log file.
  5. Warnings beginning with "JAVA044: Syntax not  recognized: " or "JAVA052: Syntax not  recognized" are generated.
Action Plan

This kind of warning message is raised when the java analyzer is unable to recognize the syntax of a java file.

This can happen because:

  • The java version that has been set in CAST-MS does not correspond to the java version of the file.
  • The file that is being analysed is a .class file that has been wrongly de-compiled.
  • The file that is being analysed is the java part of a .jsp which has been wrongly generated. 
  • The JEE analyzer does not follow the correct syntax standard for the selected Java version.
  • This is a genuine java syntax error and the file cannot be compiled with any version of java.

The steps to follow are

  1. Locate the file path and the source line/column, by checking the details of the syntax error message. Open the detail view of the analysis log and retrieve the relevant information




  2. Check if the .java file is a CAST generated file
    1. If the file path points to the LISA folder then this file has been generated by the JEE analyzer. There are 2 different cases when the Java analyzer is creating .java files:
      1. The .java file is de-compiled from a class file or a .jar file that has been added in the application as part of the JEE Classpath or from a .jar file that is provided from CAST in an Environmental Variable. In this case the de-compiled .java file will be located in \JavaExtractedFiles\Classes folder.
        1. Locate the original file that has been used to create the de-compiled file. Open the analysis log and search with the same name to find the reference
        2. File can 
          1. belong to a .jar or .class that is part of the application Parsing Java file (phase 2) :[api-somthing.jar]\com\somthing\v1\preferences\SomeClass.class 
          2. belong to a .jar or .xml that is provided by CAST Parsing Java file (phase 2) : [C:\ProgramData\CAST\CAST\Extensions\com.castsoftware.jee.1.2.6-funcrel\EnvProf\J2EE\JSE\JSE 1.8\rt.jar.header.xml]\java\lang\Boolean.class
        3. Use any of the available java de-compilers (for instance http://jd.benow.ca/) to decompile the file
          1. If file is in .class format, compare the de-compiled file with the one in LISA folder
            1. If they are the same then proceed to step 'Check if the Java file can be compiled'
            2. If not then this is an issue of the CAST JEE de-compiler. If this is the issue then contact CAST Technical Support with the following Relevant Input to reproduce the issue.
          2. If file is in .xml format (so originating from an Environmental Profile) then this can be due to a malformed .xml or a problem in CAST JEE de-compiler. Files provided by CAST are from public libraries:
            1. Locate the .class file or .java file on the Web. If it is a class file use any of the available java de-compilers (for instance http://jd.benow.ca/) to de-compile the file
            2. Compare the .xml file method signature with the .java file method
              1. If they are the same then proceed to step 'Check if the Java file can be compiled'
              2. If not, either:
                1.  Edit the .xml file to have the correct signature(this is not possible in all cases)  compared with the one in the decompiled .class. 
                2. Add the .class or .jar file that has been retrieved from the Web in the classpath on the application level:
                3. if none of a or b works, contact CAST Technical Support with the Relevant Input to reproduce issue
      2. The .java file is created as the java part of a .jsp file. In this case the .java file will be located in \WebLayers older. Proceed to next step
  3. Check if the Java file can be compiled.
    1. Open CAST-MS and check the Java version used to analyze the source code file
      1. Go to 'Current Version' tab and sort the analysis units by Project Path
      2. Locate the analysis unit where this source code file belongs, by referring to the project path. For user defined Analysis Units the Project path value is set as 'User Defined' and the source codes included for analysis can be retrieved by opening the analysis unit and checking the path value in Source setting→Sources:
      3. Open the Analysis Unit→Analysis tab and check the java version
      4. Check if the syntax error is genuine or if the Java version selected in the analysis unit is not correct
        1. You can use one or several of the below resources to validate the syntax and Java version where this syntax has been introduced
          1. Use Java documentation pages Java Official Documentation
          2. Use online or offline java syntax checkers for example https://www.compilejava.net/ or http://www.beanshell.org/
          3. Use an IDE like Eclipse IDE, and try to compile the file
        2. If the syntax is correct for some Java version then select the correct version in the AU or application level.
          1. For user defined AU this is expected behavior since this an option manually selected and so the correct Java version should be verified during JEE - Application qualification specifics
          2. For automatically created  AU, then this may be a problem during application delivery, please check DMT and any alerts using Delivery Manager Tool - Package - Validation
        3. If the syntax error is genuine for the , this is an expected behavior.
        4. If the syntax error is not genuine, contact CAST Technical Support with the Relevant Input to reproduce issue, for root cause investigation.
Notes/comments


Related Pages