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

Error rendering macro 'redirect'

Invalid URL: "TECHNOS:JEE - Packaging, delivering and analyzing your source code". Please provide a valid URL to redirect to.

On this page:

Summary: This section describes how to package, deliver and analyze your JEE application source code using the CAST Delivery Manager Tool.

Packaging and delivering your source code

Once the extension is installed, no further configuration changes are required before you can package your source code and run an analysis. The process of packaging and delivering your source code is as follows:

Using the CAST Delivery Manager Tool:

  • create a new Version
  • create a new Package for your JEE application source code using the Files on your file system option:

  • Define the root folder of your Application source code (click to enlarge):

  • Run the Package action (click to enlarge):

  • On completion, check the Package Content tab to see how the CAST Delivery Manager Tool has discovered and interpreted your JEE application:
  • You need to pay particular attention to the following items (click to enlarge):
    • Content State: displays the current state of the source code - if any alerts are listed, then this means that the CAST Delivery Manager Tool was not able to find all the application's source code based on configuration files such as pom.xml or .project
    • Projects Found: all projects found that are listed as Selected will be transformed into an Analysis Unit in the CAST Management Studio when you deliver the source code. Any that are marked as Ignored will not be automatically transformed into Analysis Units
    • Packaging Alerts: as stated above, if any alerts are listed, then this means that the CAST Delivery Manager Tool was not able to find all the application's source code based on configuration files such as pom.xml or .project. You should remediate this as explained below before you deliver the source code

  • When you are happy that the Package Content tab accurately reflects your JEE application source code, deliver the Version:

Discovery - how does it work?

Discovery is a process whereby the CAST Delivery Manager Tool will attempt to automatically identify projects (for example: an Eclipse Java project) within your application using a set of predefined rules. When the Package action is complete, you can view the projects that have been identified in the Package Content tab.

When a successfully Packaged application is subsequently deployed in the CAST Management Studio, an Analysis Unit will be created for each project that has been identified during the Discovery process and is not excluded by a rule or filter.

How does it work for JEE applications?

Supported project typeNotesSource Package configuration
Eclipse project support (all versions greater than 3)Configures a project for each Eclipse Java project (.project with Java nature) identified
  • Application root path:
    • using WEB-INF/web.xml grand parent folder if it exists
  • Source folders configured in .classpath
  • Class path configured in .classpath
  • Java language & environment (1.1 to 8.0) according to .classpath and project settings
  • XML files found in project folder (excluding files in Eclipse .settings folders and output class folders)
  • PROPERTIES files found in project folder (excluding files in output class folders)
  • Libraries according to jar names in the project classpath: JUnit, Log4J, Commons logging, DOM4J, JSF, MX4J, Hibernate, Struts, Spring
Maven project simplified support (versions 2 and 3)Configures a project on each folder that contains a pom.xml file except when the type of packaging declared in the pom.xml is "pom".

Note that project inheritance and project aggregation is supported

  • Java language and environment (1.1 to 8.0).
  • Application root path:
    • Standard MAVEN path (src/main/webapp) when "war" packaging is declared in pom.xml
    • otherwise folder containing POM
  • Source folders configured in standard maven paths:
    • src\main\java
    • src\test\java
  • Libraries according to artifact ids in the pom.xml dependencies declaration: JUnit, Log4J, Commons logging, DOM4J, JSF, MX4J, Hibernate, Struts, Spring etc.

Note that any Maven project whose type is set to "eclipse-plugin" will be ignored by the Maven discoverer. An "eclipse-plugin" project means that an associated Eclipse project also exists and therefore should be handled by the Eclipse discoverer. In this siutation, CAST highly recommends that you tick the following exclusion rule in the CAST Delivery Manager Tool:

Managing packaging alerts

If any alerts are listed during the packaging action, then this means that the CAST Delivery Manager Tool was not able to find all the application's source code based on configuration files such as pom.xml or .project. You should remediate these alerts as explained in the following video:

Analyzing your source code

Using the CAST Management Studio:

  • Accept and deploy the Version in the CAST Management Studio. Any projects that were discovered in the CAST Delivery Manager Tool will be transformed into Analysis Units:

  • You should now check and edit (if necessary) the default automated analysis configuration settings that have been set for you during the package deployment:

  • When you are satisfied that you have configured your analysis correctly, we suggest that you run a test analysis at Application level before you generate a new snapshot (no results will be saved to the CAST Analysis Service):

  • On completion, you should check the test analysis log file and then clear up any warning or error messages that have been returned by reconfiguring the analysis - see JEE Analyzer - Analysis messages for more information about log messages:

  • When all issues and problems have been resolved, you can then use the Run Analysis only option to perform an analysis AND save the results in the CAST Analysis Service:

  • When using the Run Analysis only option, you can specify various analysis debug options, specific to JEE - note that these are for advanced debugging of analysis and are normally not required:

OptionDescription
Keep Generated Files from JSPWhen you select this option, generated .JAVA files for the JSP Implementation Classes will be stored in the LISA folder.
Please note that for all these options, any generated files will be stored in the LISA folder as follows:

<Unique_Application_ID>\<source_code_folder>\J2EEGenerated files

See Preferences > CAST General in the CAST Management Studio for more information about the location of the LISA folder.

Keep Generated Files from Java AnnotationsWhen you select this option, XML Annotation files generated when an Environment Profile (that includes detection of Java annotations) is used, will be stored in the LISA folder. I.e. intermediate files that are generated from Java annotations and that are used by XML query files to manage Java annotation semantic (i.e. create objects and links induced by annotations) will be copied into the LISA folder.
Keep Generated Files from EJB
When you select this option, generated files for EJB will be stored in the LISA folder.
Keep Generated Files from Web Service
When you select this option, generated files for Web Services will be stored in the LISA folder.
Keep Generated CAST Script from XML and AnnotationsThis option enables you to choose a location to store the .castscript files that are generated following an analysis (via Environment Profile) that uses the XQuery/Zorba processing mechanism. This can be particularly useful if you are receiving errors during the analysis and you want to modify your XQuery file so that it outputs syntax that can be understood by the JEE Analyzer.

If this option is deactivated, .castscript files will still be generated, but they will not be retained after the analysis.

Activate CAST Scripts traces

When the checkbox is selected, all Log messages with DEBUG level called in .castscript files will be logged in the analysis log as an information message with the prefix "DEBUG: ", for example:

log("this is a debug message", DEBUG) will generate Information "DEBUG: This is a DEBUG message" in the Log.

This information can help you refine and tune your .castscript function so that they work as expected. See also Manage XML configuration files.

  • No labels