Hello,
I'm porting our Application from jboss 2.4.10 to jboss 3.2.3.
In jboss 2.4.10 we have implemented reading of datasource attributes (e.g. URL,
dbusername, dbpassword) using RMIConnector on the MBean.
I tried to change the implementation using RMIAdaptor as described in the jboss for
pay docu.
This seams to work for the sample (access JNDIView MBean), but if I try to access my
datasource I always get a NoSuchMethodException.
I can invoke the same method manually in the web-console.
If I list the methods using MBeanInfo I see this method as well
What's wrong ?
Is it still possible in jboss 3.2.3 to read attributes of the datasource configuration
?
Is it possible to add additional attributes to the configuration (in jboss 2.4.10 we
added "Properties" attribute)
Any ideas appreciated.
Annegret
Access to the MBean:
public class MBeanSupport
{
...
public static Object invoke (String MBeanDomainName,
String MBeanName,
String methodToCall,
java.lang.Object[] params,
java.lang.String[] signature ) throws SupportException
{
InitialContext jndiContext = new InitialContext();
RMIAdaptor server = (RMIAdaptor) jndiContext.lookup("jmx/rmi/RMIAdaptor");
ObjectName objectName = new ObjectName(MBeanDomainName + ":" + MBeanName);
returnObj = server.invoke( objectName,
methodToCall,
params ,
signature);
...
return returnObj;
}
public class JDBCSupport
{
...
java.lang.Object[] params1 = new java.lang.Object[1];
java.lang.String[] signature1 = new java.lang.String[1];
params1[0] = new String("ConnectionURL");
signature1[0] = params1[0].getClass().toString();
String dbUrl = (String) MBeanSupport.invoke("jboss.jca",
"name=HOTi33,service=ManagedConnectionFactory",
"getManagedConnectionFactoryAttribute", params1, signature1);
...
}
server.log
listed operations:
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] ObjectName :
jboss.jca:name=HOTi33,service=ManagedConnectionFactory
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] got MBeanInfo
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] got
MBeanOperationInfo
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] + void start(
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] +
java.lang.Object createConnectionFactory(
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] + void
create(
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] +
javax.resource.spi.ManagedConnection createManagedConnection(
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO]
javax.security.auth.Subject javax.security.auth.Subject
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO]
javax.resource.spi.ConnectionRequestInfo javax.resource.spi.ConnectionRequestInfo
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] + boolean
equals(
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO]
java.lang.Object java.lang.Object
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] + void
setManagedConnectionFactoryAttribute(
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO]
java.lang.String java.lang.String
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO]
java.lang.Class java.lang.Class
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO]
java.lang.Object java.lang.Object
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] + void stop(
2004-03-22 16:22:51,437 ERROR [STDERR] [22.03.04 at 16:22:51:437] [INFO] + int
hashCode(
2004-03-22 16:22:51,468 ERROR [STDERR] [22.03.04 at 16:22:51:468] [INFO] +
java.lang.Object createConnectionFactory(
2004-03-22 16:22:51,468 ERROR [STDERR] [22.03.04 at 16:22:51:468] [INFO]
javax.resource.spi.ConnectionManager javax.resource.spi.ConnectionManager
2004-03-22 16:22:51,468 ERROR [STDERR] [22.03.04 at 16:22:51:468] [INFO] + void
destroy(
2004-03-22 16:22:51,468 ERROR [STDERR] [22.03.04 at 16:22:51:468] [INFO] +
javax.resource.spi.ManagedConnection matchManagedConnections(
2004-03-22 16:22:51,468 ERROR [STDERR] [22.03.04 at 16:22:51:468] [INFO] java.util.Set
java.util.Set
2004-03-22 16:22:51,468 ERROR [STDERR] [22.03.04 at 16:22:51:468] [INFO]
javax.security.auth.Subject javax.security.auth.Subject
2004-03-22 16:22:51,468 ERROR [STDERR] [22.03.04 at 16:22:51:468] [INFO]
javax.resource.spi.ConnectionRequestInfo javax.resource.spi.ConnectionRequestInfo
2004-03-22 16:22:51,468 ERROR [STDERR] [22.03.04 at 16:22:51:468] [INFO] +
java.lang.Object getManagedConnectionFactoryAttribute(
2004-03-22 16:22:51,468 ERROR [STDERR] [22.03.04 at 16:22:51:468] [INFO]
java.lang.String java.lang.String
Exception:
2004-03-22 16:22:51,468 ERROR [STDERR] ReflectionException: null
Cause: java.lang.NoSuchMethodException: Unable to locate MBean operation for:
getManagedConnectionFactoryAttribute(class java.lang.String)
2004-03-22 16:22:51,468 ERROR [STDERR] at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:288)
2004-03-22 16:22:51,468 ERROR [STDERR] at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
2004-03-22 16:22:51,468 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2004-03-22 16:22:51,468 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2004-03-22 16:22:51,468 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2004-03-22 16:22:51,468 ERROR [STDERR] at
java.lang.reflect.Method.invoke(Method.java:324)
2004-03-22 16:22:51,468 ERROR [STDERR] at
org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:249)
2004-03-22 16:22:51,468 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2004-03-22 16:22:51,484 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2004-03-22 16:22:51,484 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2004-03-22 16:22:51,484 ERROR [STDERR] at
java.lang.reflect.Method.invoke(Method.java:324)
2004-03-22 16:22:51,484 ERROR [STDERR] at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
2004-03-22 16:22:51,484 ERROR [STDERR] at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
2004-03-22 16:22:51,500 ERROR [STDERR] at
org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
2004-03-22 16:22:51,500 ERROR [STDERR] at
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
2004-03-22 16:22:51,500 ERROR [STDERR] at
org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor.invoke(InvokerAdaptorClientInterceptor.java:58)
2004-03-22 16:22:51,500 ERROR [STDERR] at
org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
2004-03-22 16:22:51,500 ERROR [STDERR] at
org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:55)
2004-03-22 16:22:51,500 ERROR [STDERR] at
org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
2004-03-22 16:22:51,500 ERROR [STDERR] at $Proxy22.invoke(Unknown Source)
2004-03-22 16:22:51,500 ERROR [STDERR] at
com.tenovis.oam.i33.as.util.MBeanSupport.invoke(MBeanSupport.java:111)
2004-03-22 16:22:51,500 ERROR [STDERR] at
com.tenovis.oam.i33.as.coco.JDBCSupport.<clinit>(JDBCSupport.java:90)
2004-03-22 16:22:51,500 ERROR [STDERR] at
com.tenovis.oam.i33.as.sv.JobServiceImpl.getJobServiceState(JobServiceImpl.java:732)
2004-03-22 16:22:51,500 ERROR [STDERR] at
com.tenovis.oam.i33.as.sv.JobServiceImpl.run(JobServiceImpl.java:93)
2004-03-22 16:22:51,500 ERROR [STDERR] at java.lang.Thread.run(Thread.java:534)
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user