• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

WebSphere ND 6.0.2 Jacl : WebContainer custom property addition:

Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to add a custom property to a app-server�s webcontainer . The custom property is KeepContentLength and it�s value is true.

Here are the steps I am doing:

set serverId [$AdminConfig getid /Node:tstNetwork/Server:server1/]

set webcontainer [$AdminConfig list WebContainer $serverId]

set name [ list name KeepContentLength ]
set required [ list required false ]
set type [ list type "java.lang.String" ]
set value [ list value true ]
set custom1 [ list $name $required $type $value ]
set custom2 [ list $custom1 ]

set propSet [$AdminConfig showAttribute $webcontainer properties]

# this would return { } as there is no custom property so far

$AdminConfig create properties $propSet $custom2

# The above command is giving me exception as

WASX7015E: Exception running command: "$AdminConfig create properties $propSet $custom2"; exception information:
com.ibm.ws.scripting.ScriptingException: WASX7077E: Incomplete config id: need closing parenthesis in "{}"

So, after doing some research, I found that some-one says about the same error but for DataSource

The underlying problem with the script you originally sent is based on the premise that the propertySet for the DataSource already exists. This is actually not the case. The propertySet is only created if 1) you explicitly create the propertySet after creating the DataSource in your script, or 2) you go into the Admin Console and create a property, which, under the covers creates the propertySet object, then adds your property.

Therefore, when the first time running the script for the new DataSource, the following line will not work:
set propSet [$AdminConfig showAttribute $newds propertySet]

Since the propertySet does not exist, you will get a null value for "propSet", then when you use this in the line:
$AdminConfig create J2EEResourceProperty $propSet $custom1
the null value will cause the error WASX7077E: Incomplete config id: need closing parenthesis in ""

Replacing your "set propSet" line with the following should do the trick

set propSet [$AdminConfig create J2EEResourcePropertySet $newds {}]

The link is : http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?message=1996702&cat=7&thread=30842&treeDisplayType=threadmode1&forum=199#1996702

So, I changed accordingly i.e. create a empty property:

set propSet [$AdminConfig create properties $webcontainer {}]

which is giving me exception as:

WASX7015E: Exception running command: "set propSet [$AdminConfig create properties $webcontainer {}]"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7129E: Cannot create objects of type "properties" in parents of type "WebContainer"

The exception itself is quite obvious but I don�t know how to work around this.


Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic