DAS: JMX/AMX createJDBCResourceConfig() dosent work, creates only 2 mbeans

Hello, I have a problem when using createJDBCResourceConfig() to create a jdbc resource from my application on the Sun App Server via DAS.'

After it gets created on the server it dosent get enabled and dosent have the necessary mbeans attached to it.

I do the following:

Map<String, String> opt = new HashMap<String, String>(); opt.put(ResourceConfigKeys.ENABLED_KEY, Boolean.TRUE.toString()); jdbcrc = domainroot.getDomainConfig().createJDBCResourceConfig("jdbc/newdbcon","derby_netPool", opt);

And that result in a jdbc resource on the server, but its missing alot of MBeans, that result in an unmanageable resource, cant delete , enable or modify it.

(ObjectName, ClassName):

com.sun.appserv:type=jdbc-resource,jndi-name=jdbc/newdbcon,category=config

com.sun.enterprise.admin.config.BaseConfigMBean

amx:j2eeType=X-JDBCResourceConfig,name=jdbc/newdbcon

com.sun.appserv.management.config.JDBCResourceConfig

But should be like this:

amx:X-StandaloneServerConfig=server,j2eeType=X-ResourceRefConfig,name=jdbc/shbs

com.sun.appserv.management.config.ResourceRefConfig

amx:j2eeType=X-JDBCResourceConfig,name=jdbc/shbs

com.sun.appserv.management.config.JDBCResourceConfig

amx:J2EEServer=server,j2eeType=JDBCResource,name=jdbc/shbs

com.sun.appserv.management.j2ee.JDBCResource

com.sun.appserv:type=jdbc-resource,jndi-name=jdbc/shbs,category=config

com.sun.enterprise.admin.config.BaseConfigMBean

com.sun.appserv:j2eeType=JDBCResource,name=jdbc/shbs,J2EEServer=server,category=runtime

com.sun.enterprise.admin.runtime.BaseRuntimeMBean

com.sun.appserv:type=resource-ref,ref=jdbc/shbs,server=server,category=config

com.sun.enterprise.admin.config.BaseConfigMBean

Then I tried to make the MBeans manually via:

ObjectName objn = new ObjectName("com.sun.appserv:j2eeType=JDBCResource,name=jdbc/newdbcon,J2EEServer=server,category=runtime");

//MBSC is MBeanServerConnection

mbsc.createMBean("com.sun.enterprise.admin.runtime.BaseRuntimeMBean", objn);

But that only results in exceptions where it stats it not an MBean etc.

Im stumped and the AMX / DAS information I can find dosent seem to cover this any good, so please help if you can, and thanks for all the help in advance.

Please help,

Kevin

[2386 byte] By [kvatna] at [2007-11-26 19:49:39]
# 1

'Solved' Found out what I need to do now as a workaround for my current problem of creating a JDBC Resource on the fly to the sever by adding a @Resource annotation to my EJB / EAR.

But I still cant add and register MBeans with the server for more low level config.

I Dont seem to get the MBeanServer that I need , I get the MBeanServerConnection, but that has no means for registering new MBean's.

What I need it an MBean server , I tried to use MBeanServerFactory to get my MBeanServer.

Useing this code to find the MBeanServerID / AgentID.

mbsc = acs.getMBeanServerConnection(false);

pf = ProxyFactory.getInstance(mbsc);

System.out.println("MbeanServerID: "+pf.getMBeanServerID());

ArrayList<MBeanServer> mbsl = MBeanServerFactory.findMBeanServer("hostname_1172659261455");

But results in no MBeanServer found, Anyone got any ideas?

-Kevin

kvatna at 2007-7-9 22:38:23 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...