dev@glassfish.java.net

Re: Another AMX Question

From: Anissa Lam <Anissa.Lam_at_Sun.COM>
Date: Mon, 15 Jun 2009 22:34:13 -0700

Hi Jason,
Please print out what exactly is the objectNameStr that you pass to saveBeanAttributes() and the error you are getting.
That objectNameStr should be something like:
v3:pp=/domain/resources,type=connector-connection-pool,name=MyPoolName

You can bring up jconsole or the html adapter  to see if  such object exists.

Anissa.

Jason Lee wrote:
With Lloyd and Anissa's help, I got moving along with my AMX question.  Using the new v3 AMX, I am able to retrieve a list of JMS connection factories.  Trying to create a new one, though, is not working.  Here's how I get the list:

            setPageSessionAttribute(key="objectNameStr" value="v3:pp=/domain,type=resources");
            setPageSessionAttribute(key="childType" value="connector-connection-pool");
            getChildrenTable(objectNameStr="#{pageSession.objectNameStr}" childType="#{pageSession.childType}" result="#{requestScope.listOfRows}");

These JSFTemplating handler calls eventually find their way to org.glassfish.admingui.common.handlers.ProxyHandlers. getChildrenTable(), in case that helps.  When saving, I started off by assuming that the Object Name String and child type would be the same, so I make this call:

    setPageSessionAttribute(key="objectNameStr", value="v3:pp=/domain/resources,type=connector-connection-pool,name=#{pageSession.valueMap['Name']}" );
    saveBeanAttributes(objectNameStr="#{pageSession.objectNameStr}", attrs="#{pageSession.valueMap}");

The code obviously isn't optimal.  That aside, though, I've tried creating the name string as it was in the list command, which failed with an InstanceNotFoundException.  I then changed the type to what you see above, eventually adding the name= qualifier on the end, all resulting in the same Exception.

Any tips/pointers?  My mind is mush at the moment.  Hopefully, morning will bring clarity and an answer. :)

Jason Lee
Senior Java Developer
GlassFish Administration Console

Sun Microsystems, Inc.
Phone x31197/+1 405-343-1964
Email jasondlee@sun.com
Blog http://blogs.sun.com/jasondlee
Blog http://blogs.steeplesoft.com