I didn't find any example of remote RMINotificationListener in adminDevel guide
(nor in wiki's or faq's). However I tried to register the listener as a rmi
service.
So I made my listener extend UnicastRemoteObject and I added this code:
| public TestMain() {
| try{
| /*if (System.getSecurityManager() == null) {
| System.setSecurityManager(new RMISecurityManager());
| }*/
| DistantNotificationClient dnc = new DistantNotificationClient();
| Naming.bind("//138.203.236.159:1098/DistantNotificationClient", dnc);
| String url = "jnp://" + "etbs159" + ":1099";
| String ini = "org.jnp.interfaces.NamingContextFactory";
| String pkgs = "org.jboss.naming,org.jnp.interfaces";
| Hashtable env = new Hashtable();
| env.put("java.naming.provider.url", url);
| env.put("java.naming.factory.initial", ini);
| env.put("java.naming.factory.url.pkgs", pkgs);
| Context ic = new InitialContext(env);
| RMIAdaptor server = (RMIAdaptor) ic.lookup("jmx/rmi/RMIAdaptor");
| ObjectName emitterName = new
ObjectName("osp.smf.test:service=BroadcasterTest");
| server.addNotificationListener(emitterName, dnc, null, new
Long(System.currentTimeMillis()));
| }catch(Exception e){
| e.printStackTrace();
| }
|
| }
|
Now I get the following exception:
anonymous wrote :
| java.rmi.NoSuchObjectException: no such object in table
|
| at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
|
| at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
|
| at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
|
| at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
|
| at java.rmi.Naming.bind(Naming.java:111)
|
| at com.alcatel.osp.mbean.test.TestMain.(TestMain.java:18)
|
| at com.alcatel.osp.mbean.test.TestMain.main(TestMain.java:80)
|
|
I couldn't find info on this exception that matches my problem. I ran my
application from the same machine as JBoss (running Solaris 9).
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3865172#3865172
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3865172
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user