To use the third-party code or code that is available from custom JARs, those custom JARs
need to get deployed in to the system.
Before you begin
If you are deploying custom user .jar files, before you can deploy them, you must write your
Java™ code.
About this task
IBM® Product Master can have the need to use third-party JARs
or custom JARs. These JARs can belong to one of the following categories:
- Third party JARs that are not included with the product.
- Java™ API JAR file, which is included along with the product but not added to the .classpath by
default.
- Custom JARs files that contain user code, developed by users of IBM Product Master. For example, these JARs might contain Web
Services code or Java API extension point implementation classes.
Procedure
- If you are deploying a custom user .jar file, perform the following tasks on your
development environment to produce the custom .jar file. If you are deploying a third-party .jar,
that .jar file should already be available and the following steps are not required.
- Compile your Java file. This generates a
compiled .class file, for example: SearchService.class.
- Add your compiled .class file into a JAR file
:
Type:
jar -cvf /data/jars/AcmeServices.jar SearchService.class
AcmeServices
is the name of the .jar file.
- Store the generated AcmeServices.jar in a directory on the IBM Product Master server.
- On the Product Master server perform the
following tasks:
- Initialize your command-line environment.
- Stop your Product Master server if it is
running by using the following command:
$TOP/bin/go/stop_local.sh
- Add the custom user JAR file. Use either of the following methods:
- Copy the JAR file to the
<install dir>/jars
directory.
or
- Add the paths, one per line, to the custom JAR file to
bin/conf/classpath/jars-custom.txt.
- Save the jars-custom.txt file.
The paths in the
jars-custom.txt file can be absolute or relative to the
<install dir>
directory. If you use a relative path, the
<install
dir>
directory is prepended to the value in the
jars-custom.txt file.
For example,
/opt/ssce/lib/myjar.jar
is an absolute path. When the runtime class
path is assembled, the
/opt/ssce/jars/myjar.jar path is added to the class
path.
Another example of an absolute path is
somedir_under_install_dir/mydir/myjar.jar
. When the runtime class path is
assembled, the <install dir>/somedir_under_install_dir/mydir/myjar.jar path
is added to the class path.
- Run the following script to update the runtime class path:
configureEnv.sh
.
A message displays stating that a .jar file
was added.
If the classpath parameter needs to reflect the latest custom JAR
additions or deletions, ensure you use the $TOP/bin/updateRtClasspath.sh
shell
script to update the classpath parameter only in the
env_settings.ini file without modifying other configuration files in the
$TOP/etc/default directory. All Product Master services start with the
classpath parameter as defined in the
$TOP/bin/conf/env_settings.ini directory. For more information, see updateRtClasspath.sh
script.
- Redeploy the .war file using the following command:
$TOP/bin/yourAppServer/install_war.sh
yourAppServer is
the name of your application server.
If you are running WebSphere® as an alternative approach, you can also add the .jar file
directly from the WebSphere Application Server
administrative console by using the following path:
.
- Restart Product Master using the following
command: