Try just "Library" as the attributeName. //Stephen
This is a discussion on Creating Shared Libraries using WebSphere JMX - Websphere ; I Am trying to create a shared library in WAS using JMX . I am trying to add a new library in APP_SERVER_HOME/profiles/AppSrv01/config/cells/jamesbondNode01Cell/nodes/jamesbondNode01/libraries.xml . I tried using - ArrayList arraylist = new ArrayList(); arraylist.add("/opt/info/lib/capture.jar"); arraylist.add("/opt/info/lib/features.jar"); ConfigServiceHelper.setAttributeValue(attrList, "name", "testlibrary"); ConfigServiceHelper.setAttributeValue(attrList, "classpath", ...
I Am trying to create a shared library in WAS using JMX .
I am trying to add a new library in
APP_SERVER_HOME/profiles/AppSrv01/config/cells/jamesbondNode01Cell/nodes/jamesbondNode01/libraries.xml .
I tried using -
ArrayList arraylist = new ArrayList();
arraylist.add("/opt/info/lib/capture.jar");
arraylist.add("/opt/info/lib/features.jar");
ConfigServiceHelper.setAttributeValue(attrList, "name", "testlibrary");
ConfigServiceHelper.setAttributeValue(attrList, "classpath", arraylist);
ConfigServiceHelper.setAttributeValue(attrList, "description", "sample description");
configService.createConfigData(session, node, "libraries:Library", "Library", attrList);
configService.save(session, false);
On ececuting this i get the exception
Exception in thread "main" com.ibm.websphere.management.exception.InvalidAttr ibuteNameException: ADMG0005E: The attribute name is not valid.
javax.management.ObjectName createConfigData(Session session,
javax.management.ObjectName parent,
java.lang.String attributeName,
java.lang.String type,
javax.management.AttributeList attrList)
throws ConfigServiceException,
ConnectorException
Parameters:
session - the seesion id.
parent - the id of the parent config data.
attributeName - the name of the relationship or attribute between the parent and child config data.
type - the type of created config data. The type can be the type of the attribute specified in the attribute meta info, it can also be one of the subtypes listed in the attribute _ATTRIBUTE_METAINFO_SUBTYPES in the meta info of the ttribute.
attrList - the AttributeList of created config object.
Here i believe the parameters like session , node , type - "Library" and the AttributeList parameters passed are ok .
But i am not able to figure out what the "attributeName" name would be here .
Can anyone please help me in figuring out the attributeName that has to be passed for creating a shared library in WAS .
Thanks in Advance ...
Try just "Library" as the attributeName. //Stephen
Thanks for the reply Stephen ,
While creating a shared Library via Admin console , my $WAS_HOME/profiles/AppSrv01/config/cells/jamesbondNode01Cell/nodes/jamesbondNode01/libraries.xml
The structure in libraries.xml looks like
/opt/lib/Capture.jar
/opt/lib/audit.jar
So in the JMX code i tried with AttributeName as "Library" and got the exception -
Exception in thread "main" com.ibm.websphere.management.exception.InvalidAttr ibuteNameException: ADMG0005E: The attribute name is not valid.
And with AttributeName's as "libraries:Library" ,libraries, null ,"" - too i get the same exception .
Also ,pls let me know if the approach which am following is also the right way . Is there any specific MBEAN or a Helper class that can be used for Shared Library creation in JMX .
Thanks,
Gowri
I don't know of a different approach. The attributeName of "Library" should be correct.
The following statement in wsadmin works
$AdminConfig create Library $node {{name x}{description y}{classPath {opt/a/b.jar opt/c/d.jar}}} Library
The error message is not necessarily about attributeName. It's about an attribute name='blank'.
I do see you've written classpath which should be classPath. You may also want to try specifying the classPath as a simple string "opt/a/b.jar;opt/c/d.jar" rather than ArrayList.
It may be possible to tell more from the stack trace of the exception.
//Stephen
Thanks for the reply Stephan,
set attrs[list[list name $libName][list classPath "$classPathList"][list description $desc] ]
$AdminConfig create Library $node $attrs
The above jacl script works fine for me too . But am facing problems in creating Shared Libraries in JMX .
Am attaching the code and the log file that i had used for creating shared libraries.
Please have a look at those and help me on this .
Thanks,
Gowri
I used your code and got it working. I needed to use the ArrayList version of classPath and spell the attribute classPath. Otherwise I only added some extra properties to set up security for the SOAP connection which I'm guessing may not apply in your case.
How are you compiling and executing this class?
Are you using an Eclipse IDE environment or direct from the command line - what's the classpath setting etc?
Did you say what versions of WAS you're using?
//Stephen
I finally got it working too , i had the 'classPath' misspelt and the log message "attribute name is not valid" was misleading .
Thanks for ur help Stephan
regards,
Gowri