• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to run XML within JACL

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May be you can help me with the below.

I did create some JACLs for creation of JDBCProvider,DataSource,ConnectionPool etc. All the inputs were provided as arguments to the script for the time being. But this is not the process to follow.

I have to put all these values in an XML file and build it so that the JACL can access the inputs from this XML file. I ran the ws_ant command to build the file but it throws an error.

Can you suggest me a step by step process to build it as my JACL is unable to find the variables?

Immediate assistance will be much appreciated.Thanks
 
Marshal
Posts: 28141
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have some JACL code which is trying to access data from an XML file? From my 30 seconds of research, I don't think that would work.

Or do you have some other process which is trying to generate JACL code from XML? Your post is unclear.

Anyway, I think we should start with what you have and try to work with that, so please provide details of your problem. Asking us to write a tutorial for you is a bit excessive.
 
P Praveena
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul. Hope you can assist me with the below.
I did try to use a properties file(JDBCTest.properties) for the attributes instead of an xml file. This worked.

But there seems to be a problem when i try to create custom properties for the JDBCProvider, URLProvider and MailProvider.Below is the createCustomProperty Script for the URLProvider.

proc createURLCustomProperty {} {
global AdminConfig
global clusterName urlprovidername urlname urlcp urlpropertySet


# Set the Required Parameters for the URLProvider

set ucp [list name $urlcp]
set ups [list propertySet $urlpropertySet]
set urlAttrs [list $ucp $ups]

# Get the Cluster Config ID

set clusterid [$AdminConfig getid /ServerCluster:$clusterName/]

puts "Validating Cluster Details..."
if {[llength $clusterid] != 0} {
puts "$clusterName exists"
}

set urlnnn [$AdminConfig getid /ServerCluster:$clusterName/URLProvider:$urlprovidername/URL:$urlname/]

if {[llength $urlnnn] == 0} {
puts "$url doesn't exist"
}

# Create a J2EE Resource Property Set

set propSet [$AdminConfig showAttribute $urlnnn propertySet]
puts $propSet (######No value displayed when i run the script######)
# Create a J2EE Resource Property
#######Script fails here####################
set ps [$AdminConfig create J2EEResourceProperty $propSet $urlAttrs]

if {[llength $ps] != 0} {
puts "CustomProperty with name $ps created"
}

# Saving the Configuration

$AdminConfig save

}


proc parsePropFile {props} {

puts stdout ">parsePropFile"
global AdminConfig clusterName urlprovidername urlname urlcp urlpropertySet
set clusterName [string trim [$props getProperty clusterName]]
set urlprovidername [string trim [$props getProperty urlprovidername]]
set urlname [string trim [$props getProperty urlname]]
set urlcp [string trim [$props getProperty urlcp]]
set urlpropertySet [string trim [$props getProperty urlpropertySet]]

}

######################################################################################################
#
# loadProperties
#This is the procedure to load a property file. Java's Properties class is used to load the
#property file name passed in as input paramenter
#
######################################################################################################

proc loadProperties {propFileName} {
java::import java.io.FileInputStream
java::import java.util.Properties

set fileprop [java::new Properties]
set fileStream [java::new FileInputStream $propFileName]

$fileprop load $fileStream
return $fileprop
}


#####################################################################################################
#
# Main procedure
#
#####################################################################################################

if {[lindex $argv 0] == {}} {
puts stdout "\nPlease provide property file. "
exit
}
global AdminConfig clusterName urlprovidername urlname urlcp urlpropertySet
set propFile [lindex $argv 0]
set props [loadProperties $propFile]
$AdminConfig save
parsePropFile $props
createURLCustomProperty
-----------------------------------------------------------------

The exception when i run it is:
/opt/WebSphere/6.0/AppSrv01/profiles/wp_profile/bin>./wsadmin.sh -f createURLCustomProperty.jacl JDBCTest.properties
WASX7209I: Connected to process "dmgr" on node ingptl01CellManager01 using SOAP connector; The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as argument that is stored in the argv variable: "[JDBCTest.properties]"
>parsePropFile
Validating Cluster Details...
CLUSTER_VIK_PORTAL exists
xxxxxxxxxxxxxxxxxx
WASX7017E: Exception received while running file "createURLCustomProperty.jacl"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7077E: Incomplete config id: need closing parenthesis in ""


Can you help me out here please.
 
P Praveena
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paul, Is it that the script is failing just because the value of "propSet" is null.
 
Paul Clapham
Marshal
Posts: 28141
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally, I would go with what the error message actually says.

WASX7077E: Incomplete config id: need closing parenthesis in ""


To me that means you haven't matched up the parentheses in your script. I don't see how you interpret it to mean that a certain variable is null at all.
 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are correct. "WASX7077E: Incomplete config id: need closing parenthesis in "" is displayed when propSet is null.
 
P Praveena
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. That works.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic