Problem when running the example: soap_over_http_file_based_custom_username_password_sign_X509_encrypt after being deployed in BW.

Problem when running the example: soap_over_http_file_based_custom_username_password_sign_X509_encrypt after being deployed in BW.

book

Article ID: KB0088048

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Abstract: Problem when running example soap_over_http_file_based_custom_username_password_sign_X509_encrypt after deployed in BW.

Description:
========
The example may be run in Designer successfully, but when running run in BW, problems occur. The most common problem encountered is:

"WS Security Error : 131901"

131901 = Invalid username/password.

This error is due to the FileBasedPasswordLookup class can not find the passwd.txt file.


Environment:
=========
TIBCO BusinessWorks: All


Symptoms:
==========
"WS Security Error : 131901" after enabling tracing in the deployed .tra file.


Cause:
=====
The FileBasedPasswordLookup class can not find the passwd.txt file.


Resolution:
========
Put "config\passwd.txt" into the JAR file and modify FileBasedPasswordLookup.java to use the code to read the password.

            InputStream is=this.getClass().getResourceAsStream("/config/passwd.txt");
            BufferedReader in=new BufferedReader(new InputStreamReader(is));

Designer and the BW engine put JAR files to and read from different directories. The original FileBasedPasswordLookup class reads the passwd.txt by a relative directory such as:

            URL url = this.getClass().getProtectionDomain().getCodeSource().getLocation();
            String projectDir = url.getPath();
            projectDir = projectDir.substring(projectDir.indexOf("/") + 1);
            String customPasswordFilePath = projectDir + RELATIVE_PASSWORD_FILE_PATH;

In the BW engine, there is no concept of a project and such a directory. The passwd.txt file is put into a directory that has no relation with the CustomPasswordLookup.jar. Code in CustomPasswordLookup.jar can not find the passwd.txt file by a relative way.

Issue/Introduction

Problem when running the example: soap_over_http_file_based_custom_username_password_sign_X509_encrypt after being deployed in BW.