Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jython code not working for Horizontal Clustering  RSS feed

arvind pai
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the foll error when working on Websphere NW Dmgr and 2 custom profile nodes with the WAS Version being :

WASX7017E: Exception received while running file ""; exception information: exception from Jython:
Traceback (innermost last):
File "", line 184, in ?
File "", line 156, in addSSLSignerCertsFromPropfile
rk.CommandException The keyStores name NodeDefaultTrustStore and scopeName (cell) mgr01Cell01 is not found

The 2 functions involved but do not know why it is asking for Dmgr node when actually the certs have to be put in Cluster created eg "TESTCLUSTER" and not on single server instances.
Kindly have a look and suggest what could be the issue, I tried removing the nodename and adding the cluster name instead in the code but still the same error.

1st Function :
def addSSLSignerCertsFromPropfile(pfile, nodeName=None):
"""Adds signer certs as defined in properties file on a node.
If node is empty, this is WAS base, single node and it needs not be specified."""
iter = pfile.getPropertyGroupIterator("signercert")
while iter.hasNext(): ("Adding signer certificate from group %s" \
% iter.getCurrentPrefix())
alias = iter.getCurrentProperty("alias")
file = iter.getCurrentProperty("file")
if file==None or file=="" \
or alias==None or alias=="":
scriptlog.error ("Certificate alias (alias)"+\
" and full path to certificate file (file) must both be specified for a Signer Certificate")
raise ValueError ("Incomplete Signer Certificate specification")

# convert file name to full path
dirname = os.path.dirname(file)
if dirname == None or dirname == "":
# file name only, no dir; prepend current dir
file = os.path.abspath(os.path.join (".", file))
scriptlog.debug ("File name is %s" % file)

if not os.path.exists(file) and os.path.isfile(file):
scriptlog.error("File %s does not exist" % file)
raise ValueError ("Signer Certificate file does not exist")

# to guard against quote expansion, replace backslash with forward slash
file = file.replace("\\", "/")
wsadmin_funcs.addSignerCertificate("NodeDefaultTrustStore", file, alias, nodeName)

2nd Function:
def addSignerCertificate(keystorename, certfile, alias, nodeName=None, isBase64="false"):
"""Adds a signer certificate from a certificate file to a key store.
If node name is specified, it is the scope.
For ND, node name must be specified."""
keystorestring = "-keyStoreName " + keystorename
if nodeName!=None and nodeName!="":
cellName = getCellName()
keystorestring += " -keyStoreScope '(cell):%s node):%s'" % (cellName, nodeName)
debug ("checking if cert alias is already in store")
# check if this alias already exists in store;
certlist = filter(None, AdminTask.listSignerCertificates(keystorestring).split(lineSeparator))
debug ("cert list obtained")
for cert in certlist:
# we need to find [alias xxxx]
wordlist = cert.split()
if wordlist.count("[alias")>0:
indexx = wordlist.index("[alias")
debug ("[alias is item # %d" % indexx)
old_alias = wordlist[indexx+1]
# chop off trailing "]"
if old_alias[:-1]==alias:
# if exists, delete alias
warning \
("Signer certificate alias %s already exists and will be deleted"\
% alias)
(keystorestring + " -certificateAlias " + alias)
info ("old certificate deleted")
if isBase64 !="true":
isBase64 = "false"
command = keystorestring + \
" -certificateFilePath '%s' -certificateAlias %s -base64Encoded %s" \
% (certfile, alias, isBase64)
debug ("about to execute AdminTask command: " + command)

[ September 03, 2008: Message edited by: arvind pai ]

[ September 03, 2008: Message edited by: arvind pai ]
[ September 03, 2008: Message edited by: arvind pai ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!