-
1. Re: Integrates a JMX remote connection to resource adaptor
adrian.brock Feb 14, 2002 1:04 PM (in response to roysun)Perhaps you can show the code segment for startService().
And show the error you get?
If this is configured as a jboss service, maybe you
can post the jboss-service.xml or jboss.jcml?
You could also try wrapping startService with
an exception handler, e.g.
[pre]
public void startService()
throws Exception
{
try
{
// Your code
}
catch (Exception e)
{
log.error("Unexpected error", e);
throw e;
}
}
[/pre]
It is hard to help when you just report it doesn't work. :-)
Regards,
Adrian -
2. Re: Integrates a JMX remote connection to resource adaptor
roysun Feb 14, 2002 3:35 PM (in response to roysun)try
{
lLocalServer.invoke(
lFactoryInstance.getObjectName(),
"start",
new Object[] {},
new String[] {}
);
}
catch(Exception e)
{
log.error("HiveAgentConnection::unexpect exception==",e);
}
I got exception like the following. I still can not explain this.
[15:24:49,360,HiveAgentConnection] HiveAgentConnection::unexpect exception==
javax.management.RuntimeErrorException: Error thrown in operation start -
3. Re: Integrates a JMX remote connection to resource adaptor
roysun Feb 14, 2002 3:49 PM (in response to roysun)I implemented createManagedConnection() method of ManagedConnectionFactoryImpl like:
public ManagedConnection createManagedConnection(javax.security.auth.Subject subject, ConnectionRequestInfo info)
throws ResourceException
{
System.out.println("ManagedConnectionFactoryImpl::createManagedConnection ");
HiveAgentConnection conn = null;
try
{
conn = new HiveAgentConnection();
}
catch(HiveConnectException e)
{
throw new ResourceException("Hive connecting failed: " + e);
}
return new ManagedConnectionImpl(subject, info, conn);
}
The construction calls createRemoteMBeanServer() which is like:
private RemoteMBeanServer createRemoteMBeanServer() throws HiveConnectException
{
RemoteMBeanServer lConnector = null;
System.out.println("HiveAgnetConnection==createRemoteMBeanServer");
try
{
// create a MBeanServer and let it start
final MBeanServer lLocalServer = MBeanServerFactory.createMBeanServer();
System.out.println("HiveAgnetConnection==createRemoteMBeanServer==createMBeanServer() successed");
// register the connector factory
final ObjectInstance lFactoryInstance = lLocalServer.createMBean(
"org.jboss.jmx.connector.ConnectorFactoryService",
new ObjectName( lLocalServer.getDefaultDomain(), "name", "ConnectorFactory" )
);
System.out.println("HiveAgnetConnection==createRemoteMBeanServer==setAttribute");
/** set up notification type to rmi */
int lType = RemoteMBeanServer.NOTIFICATION_TYPE_RMI;
lLocalServer.setAttribute(
lFactoryInstance.getObjectName(),
new Attribute( "NotificationType", new Integer( lType ) )
);
System.out.println("HiveAgnetConnection==createRemoteMBeanServer==invoke start");
System.out.println("HiveAgentConnection==createRemoteMBeanServer==getObjectName: "+ lFactoryInstance.getObjectName());
try
{
lLocalServer.invoke(
lFactoryInstance.getObjectName(),
"start",
new Object[] {},
new String[] {}
);
}
catch(Exception e)
{
log.error("HiveAgentConnection::unexpect exception==",e);
}
......
} -
4. Re: Integrates a JMX remote connection to resource adaptor
adrian.brock Feb 15, 2002 5:31 AM (in response to roysun)Change the exception handling to the following,
[pre]
try
{
lLocalServer.invoke(
lFactoryInstance.getObjectName(),
"start",
new Object[] {},
new String[] {}
);
}
catch(RuntimeErrorException e)
{
log.error("HiveAgentConnection::runtime error==",e.getTargetError());
}
catch(Exception e)
{
log.error("HiveAgentConnection::unexpect exception==",e);
}
[/pre]
Regards,
Adrian