Deploying J2EE Apps with Java WebStart
Deploying J2EE Apps with Java WebStart
The Java security model restricts access to system properties and file systems to protect against unauthorized operations, which can interfere with the deployment of web applications that require such access for functionality. To mitigate these challenges, developers may bypass default security managers or use a custom security manager that allows necessary permissions while ensuring application code still runs within JVM's sandbox to prevent threats such as buffer overflow attacks. Additionally, all application JARs need to be signed with a certificate, even if self-signed, to ensure secure deployment .
Deploying the JSC involved dynamically handling classpath settings because the GT4 libraries required were located at unknown paths on client systems. Due to the limitations of Java 1.5, which does not allow dynamic changes to library paths programmatically, the initial approach was to launch a new JVM instance via command line arguments for each required classpath setting, an inefficient solution. Ultimately, the solution involved creating a Java subprocess and using a custom ClassPathUpdater class capable of dynamically loading JARs at runtime, overcoming significant technical obstacles of static classpath requirements .
Packaging the WebstartWrapper code in the Grid Monitor's portal repository presents both organizational and management implications. It implies the wrapper is considered an integral part of the portal, facilitating cohesive project management by logically grouping related components. However, it might also introduce overhead for developers not working with the portal components, although build scripts were adjusted to allow exclusion of the WebStart target. Overall, this decision enhances maintainability while streamlining project components .
The WebStart descriptor file specifies the application's JAR file locations, JRE version required on the client machine, the application's main entry point, and any security permissions needed. This information allows Java WebStart to download the necessary JARs, configure the environment, and launch the application. In an Apache server environment, the mime.types file must be configured to recognize the .jnlp file type associated with WebStart in order to facilitate the deployment properly .
Using a self-signed certificate in Java WebStart applications means that the application doesn't verify its authenticity with a trusted central authority, like VeriSign. This can introduce security risks as users must manually accept the certificate, impacting user trust. During deployment, users are prompted to accept the security warnings before the application is executed, which can add friction and potential for user hesitation .
Prototyping serves as a crucial step in validating various components and their interactions before final deployment. In this case, creating a prototype WebStart application (HelloWorld) helped test the deployment process, validate the function of Java WebStart's dependencies, and identify issues such as WebStart's unique JVM and classpath settings. This allowed developers to make informed adjustments, such as creating the WebstartWrapper class, ultimately impacting and enhancing the development of the final deployment process .
Critical decisions in security management included the creation of a custom security manager to bypass certain security checks that prevent access to the system properties needed by the JSC. This approach ensured the application could function correctly within the confines of Java's security model, affecting the final implementation by providing the necessary permissions without opening significant security vulnerabilities. Consequently, it allowed the deployment to preserve system integrity while still enabling required access .
Deploying the Job Submission Client provided a deeper understanding of JVM internals, such as the class loader processes and the system security model. The necessity to alter the Java classpath dynamically, manage environment variables, and bypass security restrictions highlighted the internal workings of the JVM, particularly regarding how it manages application permissions and runtime dependencies. This experience emphasized the importance of correctly configuring class loaders and understanding security model intricacies for successful web-based deployments .
The WebstartWrapper class was necessary because Java WebStart uses its classpath and JVM options that differ from client machine variables, which did not allow clean propagation of necessary environment variables like GLOBUS_LOCATION or axis.ClientConfigFile required by the JSC. The wrapper facilitated the JSC's deployment by setting these environment variables and establishing the correct classpath dynamically at runtime. This method ensured that the JSC could access the GT4 libraries correctly, overcoming Java's limitations of static library paths and the inability to dynamically change classpaths .
The deployment strategy involved integrating the WebstartWrapper with the Grid Monitor project by modifying the build script to include both compilation and security signing of the WebstartWrapper JAR, as well as adding it to the webstart directory for deployment. This integration was significant because it maintained a “one click build and deploy” environment, which both streamlined the development and deployment cycles, and facilitated simultaneous deployment with the rest of the Grid Monitor web portal, reducing complexity and time in release processes .