Switching the Java Client
for Executing a SAS Stored Process template from using Remote Foundation
Services to Local Foundation Services resulted in a number of files
changing. In addition, a JAAS configuration file needs to be added
to the project so that the Java application that executes the stored
process can be run successfully. The preferred way to update a Java
client in SAS Java Applications projects is to re-apply the stored
process template and create a new Java client. You can either create
a new Java client in a new package, or refactor the original Java
client package and then reuse it for the new Java client.
The classes found in
the support.storedprocess package are automatically updated when a
new Java client is created, and do not need updating. These classes
are used by the Stored Process Java clients found in the project.
For each Stored Process
Java client in the project, follow these steps to create a new Java
client file and then copy your customized code to it:
-
In the Project Explorer,
right-click the existing package (typically
console.app
)
and select
RefactorRename.
The package typically
contains the Java and properties files for the client (
StoredProcessDriver.java
and
StoredProcessDriver.properties
).
-
In the
New
name field, append .old to the existing package. Click
OK and
then click
Continue.
-
In the
old package,
open the
StoredProcessDriver.java
class,
find the STORED_PROCESS_PATH_URL static String, and note the name
of the stored process.
These instructions assume
that you want to run the same stored process as in the original client.
-
From Eclipse, select
FileNewOther.
-
Expand the
SAS
AppDev Studio folder.
-
Select
Add
Template Content to Project, and then click
Next.
-
In the
Project field,
ensure that the project containing the Java client to update is selected.
-
In the Templates tree,
expand
SAS Stored Process, select the
Java
client for executing a SAS Stored Process template, and
click
Next.
-
Select the BI Server
Profile for the SAS 9.3 BI installation that you want the Java client
to run against, and click
Next.
-
Ensure that you are
logged in with the correct Connection Profile.
-
Update the
Package
name and
Class name.
-
For the Stored Process,
click the
Change button, select the stored
process to execute, and then click
OK.
-
Update any other options
and click
Finish.
-
In the new Java file
that is automatically opened, update the stored process prompt values.
Missing values are marked as errors.
-
Copy your customizations
in the old Java file to the new one.
To compare files, select
both the old and new versions of the Java file in the navigator view,
and then right-click on either file and select
Compare WithEach Other.
-
(Optional) Delete the
old,
renamed package.
Adding this template
creates the
jaas.config
and
launchParameters.txt
files
in the root of the project. The
jaas.config
file
contains the needed JAAS configuration, and the
launchParameters.txt
file
contains an example of the Java System property that must be defined
for the Java application to execute.
If you are working in
AppDev Studio 4.4 with maintenance for SAS 9.4, add the JAAS configuration
to the run configuration VM arguments.
-
Right-click
StoredProcessDriver.java
in
the new
console.app
package.
-
Select
Run AsRun Configurations.
-
-
Add the Java VM argument
to the VM arguments section and click
Apply.