uCosminexus Application Server, Web Service Development Guide
The apt command is a JDK command that interprets annotations, generates additional Java code, and compiles by including the basic Java code. You use the apt command for the development of a Web Service starting from SEI. The apt command interprets the annotation (coded in compliance with the JAX-WS 2.2 specifications) coded in the Web Service Implementation Class, adds the required JavaBean class and generates the Java code.
For details about the format, argument, and options of the apt command, see JDK documentation. This subsection describes the contents that are not defined in the JDK documentation and the precautions for executing the command.
In the argument of the apt command, specify a Web Service Implementation Class and SEI (if SEI is referenced) respectively. If you specify two or more Web Service Implementation Classes, an error message will output in the log and an error message is returned to the apt command (KDJW61002-E). However, when only SEI is specified and the Web Service Implementation Class does not exist, a warning message is output in the standard error output and log and the processing continues (KDJW61001-W). In this case, the JavaBean class is not generated.
For details about the notes related to SEIs and Web Service Implementation Classes other than the above, see the 16.1 Default mapping of Java to WSDL and 16.2 Customized mapping of Java to WSDL sections.
The following warning is displayed in the apt command if EJB Web Service Implementation Class with the javax.ejb.Stateless annotation is specified in the argument.
| Warning: annotation type without processor: javax.ejb.Stateless |
To execute the apt command, specifying the -classpath option, -J-Dcosminexus.home option and -factory option is mandatory. The values of each option are as follows:
> "%COSMINEXUS_HOME%\common\bin\gethntr2conf.exe" HNTR2INSTDIR |
> "%COSMINEXUS_HOME%\common\bin\gethntr2conf64.exe" HNTR2INSTDIR |
The following table describes the files generated when the apt command is executed:
Table 14-5 List of files generated for the apt command
| No. | Java code | Contents |
|---|---|---|
| 1 | Request bean class | This is the JavaBean class for the request message. Output for the wrapper style. |
| 2 | Response bean class | This is the JavaBean class for the response message. Output for the wrapper style. |
| 3 | Fault bean class | This is the JavaBean class corresponding to the fault. Output when the wrapper exception class is defined in the specified Java code and when the fault bean does not exist. |
If a negligible error that allows processing to continue is detected in the middle of the processing, a warning message is output and the processing continues.
Note that sometimes log is not output depending on the specified output level (importance). For details on the settings for the output level of a log, see 10.1.2 Settings for the common definition file.
If an error occurs during the execution of the apt command, an error message is output and the processing ends.
If an error message is output, remove the cause of the error that is output and re-execute the apt command. Remove the causes of each of the displayed errors and repeatedly execute the apt command until the command terminates normally. If the file is already generated, delete the files generated before the apt command is executed.
Note that sometimes log is not output depending on the specified output level (importance). For details on the settings for the output level of a log, see 10.1.2 Settings for the common definition file.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.