Relative Paths in GenJava, GenNet and GenService |
|
Contents
- SYMPTOMS
- CAUSE
- RESOLUTION
SYMPTOMS
When selecting an assembly for GenJava, generation will fail if the path is not located on the GenService machine. Similarly, when specifying the output path in GenNet, generation will fail if the path is not located on the GenService machine.
CAUSE
There is a source of confusion when it comes to specifying relative paths using our GenNet or GenJava tool. This confusion has to do with the role that GenService plays and which tool creates the proxies. This is different (depending on whether GenJava or GenNet is invoked) and obviously implies where the proxies will be output to (either on the GenService machine or the GenJava/GenNet machine). Of course, things are simplified considerably when GenService and GenJava/GenNet are installed on the same machine.
GenService is a .NET component hosted as a Windows Service. Its function is two-fold, depending on whether GenJava or GenNet is invoked.
GenJava
GenService's function is to read a .NET assembly and send back a XML description of the assembly, so that GenJava can parse this XML description and construct Java proxies. Thus, the location of the target assembly is relative to GenService and must be a directory located on the same machine that GenService is installed on. The output path, however, is relative to GenJava, and must be a directory located on the same machine that GenJava is installed on. This is because GenJava creates the Java proxies.
GenNet
GenService's function is to generate .NET proxy code (in C#) from specified Java classes. GenNet first generates an XML description of the specified Java classes and passes this string to GenService, which parses and constructs the proxies. Thus, the location of the Java classes is relative to GenNet and must be in the classpath of where GenNet is installed on. The output path, however, is relative to GenService, and must be a directory located on the same machine. This is because GenService creates the Java proxies.
RESOLUTION
To avoid any confusion, an absolute path should be specified for the location of the .NET assembly, or the location of the output path. Furthermore, to summarize the above explanation, these absolute path locations are relative to GenService when it comes to specifying a .NET assembly (GenJava), or specifying an output directory (GenNet).
Status
There may be future enhancements to make this easier especially when GenService is installed on the same machine as GenNet/GenJava.