[JBoss-user] [Clustering/JBoss] - Re: How to access HA Singleton MBean clusterwide via EJB
It seems that JBoss gys recocnized this functional gap at last and published a interim solution, see: http://www.jboss.org/wiki/Wiki.jsp?page=JBossHASingletonRemoteAccess Thorsten View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3846990#3846990 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3846990 --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047alloc_id=10808op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Clustering/JBoss] - Re: How to access HA Singleton MBean clusterwide via EJB
Thanks Nicholas for your Answer. But what do you exactly mean by Stub? Yesterdy I tryed to bind the service itself into JNDI with no success. Excerpt from MBeans startSingleton(): | Name n = context.getNameParser().parse(service/mbean/MyService); | NonSerializableFactory.rebind(n, this, true); | A lookup on the client (EJB) returned a javax.naming.Reference. So I tryed | MyService s = (MyService) PortableRemoteObject.narrow(o, MyService.class); | which results in ClassCastException. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3845403#3845403 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3845403 --- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Clustering/JBoss] - How to access HA Singleton MBean clusterwide via EJB
Hello! I'm trying to access a HA Singleton MBean from session EJBs but experiencing a problem which really makes me ill. First the EJB looks up the RMIAdaptor: | Properties properties = new Properties(); | properties.put(Context.INITIAL_CONTEXT_FACTORY, org.jnp.interfaces.NamingContextFactory); | properties.put(Context.URL_PKG_PREFIXES, org.jboss.naming:org.jnp.interfaces); | properties.put(Context.PROVIDER_URL, jnp://localhost:1100); | try | { | Context context = new InitialContext(properties); | Object o = context.lookup(jmx/invoker/RMIAdaptor); | mbeanServer = new RMIConnectorImpl((RMIAdaptor) o); | } | catch (NamingException e) | { | handleException(e); | } | Then I test wheter the singleton service is registered before invoking methodes on the service: | ObjectName name = new ObjectName(myDomain:service=MyService); | Boolean ok = mbeanServer.isRegistered(name); | if (ok) | { |Object result = mbeanServer.invoke(...); | } | The problem is on the nodes which are currently not master. As expected isRegistered() returns false and I can't invoke the MBean. On the node which is master everything works fine. And now, most incomprehensible to me is that nearly the same code put in a simple test class works really ok: | String port = 1100; | String[] clusterMembers = {192.168.2.10, 192.168.2.25, 192.168.2.30}; | ObjectName name = new ObjectName(myDomain:service=MyService); | RemoteMBeanServer server = null; | int i = 0; | while (i hosts.length) | { | properties.put(Context.PROVIDER_URL, jnp:// + hosts + port); | Context context = new InitialContext(properties); | Object o = context.lookup(jmx/invoker/RMIAdaptor); | server = new RMIConnectorImpl((RMIAdaptor) o); | if (server.isRegistered(name)) | { | System.out.println(i + + clusterMembers + + server.isRegistered(name)); | System.out.println(server.getAttribute(name, MasterNode).toString()); | } | i++; | } | For every loop the isRegistered() returns true and MasterNode is also true. The conclusion to me is that for the EJB I get somthing like a local RMIAdaptor with the HA singleton service available only on the master node. For the test class, started in another VM, I always get something like a global RMIAdaptor with the HA singleton service available. Is that correct? Or do I completely mixed something up. And most importantly: What is the safe way to access HA singleton MBean from EJBs. (Please note that all the nodes really build ONE cluster, i.e. they find each other and I can see messages on the console telling me that too.) Thanks a lot for your answers. Oh, I forgot to say that I use V3.2.6RC1. Thorsten View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3845358#3845358 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3845358 --- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Management, JMX/JBoss] - Re: Asserting start and deployment success
Yes you can do that: | Boolean started = (Boolean) getServer().getAttribute(new ObjectName(jboss.system:type=Server), Started); | As soon as JBoss has completely finished start up started is true. The implementation of getServer() depends on how you want to access the server: within an MBean, any class within the VM JBoss runs or remote. For example if you want to get a reference remotely via RMI: | InitialContext context = new InitialContext(properties); | Object o = context.lookup(jmx/invoker/RMIAdaptor); | RemoteMBeanServer mbeanServer = new RMIConnectorImpl((RMIAdaptor) o); | Thorsten View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3842838#3842838 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3842838 --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721alloc_id=10040op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Management, JMX/JBoss] - EJB - HA singleton MBean communication
Hello! What is the recommed way to lookup an HA singleton MBean from (clustered) EJB? Should I use the RMIAdaptor like this: | Context context = new InitialContext(); | Object o = context.lookup(jmx/invoker/RMIAdaptor); | RemoteMBeanServer mbeanServer = new RMIConnectorImpl((RMIAdaptor) o); | mbeanServer.invoke(...) | I just want to make sure that I get the reference to the singleton MBean from any node of the cluster regardless if the node is master or not. Thanks, Thorsten View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3842841#3842841 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3842841 --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721alloc_id=10040op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Clustering/JBoss] - HASingleton as XMBean
Is it possible to implement an HASingleton service bean as an XMBean? It seems to me that it isn't possible at the moment, so the next question to me is: Are there any plans to extend this in the near future? Thanks Thorsten View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3840601#3840601 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3840601 --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Management, JMX/JBoss] - Dependency check not working for HA Singleton MBean
Hello! Based on JBoss 3.2.4 I'm developing a HA singleton MBean which is packed together with some Entity Beans to a SAR laying in deploy-hasingleton. Because of the Entity Beans dependency to a datasource I added: depends optional-attribute-name=ConnectionManagerjboss.jca:service=LocalTxCM,name=fupDS to jboss-service.xml. But every time JBoss starts it does not wait for the datasource being deployed before deploying the Entity Beans. On the console I see these exceptions (excerpt): | 16:50:47,484 INFO [EjbModule] Deploying ProcessEJB | 16:50:47,765 WARN [EjbModule] Could not load the org.jboss.resource.connectionmanager.CachedConnectionInterceptor interceptor for this container | javax.management.InstanceNotFoundException: jboss.jca:service=CachedConnectionManager is not registered. | at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:462) | at org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:426) | | ... | | 16:50:48,953 INFO [ServiceConfigurator] Problem configuring service FuP:service=ProcessManagementService | org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute: name=ConnectionManager value=jboss.jca:service=LocalTxCM,name=fupDS on mbean FuP:service=ProcessManagementService; - nested throwable: (javax.management.AttributeNotFoundException: not found: ConnectionManager) | at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:490) | at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:375) | at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:160) | at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:114) | at org.jboss.system.ServiceController.install(ServiceController.java:198) | | ... | | 16:50:52,390 ERROR [EntityContainer] Starting failed jboss.j2ee:jndiName=de.fup.server.ejb.entity.ProcessHome,service=EJB | org.jboss.deployment.DeploymentException: Error: can't find data source: java:/fupDS; - nested throwable: (javax.naming.NameNotFoundException: fupDS not bound) | at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:143) | at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:428) | at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:365) | at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:147) | at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:337) | at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271) | at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221) | | ... | | 16:51:18,656 INFO [fupDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=fupDS to JNDI name 'java:/fupDS' | | Any help greatly appreciated. Thanks, Thorsten View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3838342#3838342 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3838342 --- This SF.Net email is sponsored by the new InstallShield X. From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Clustering/JBoss] - Two questions: failover, persistent distributed state
Hello! I started to implement a HA singleton service. After some first failover tests I recognized that it takes about 3 minutes until the new master node is elected. It seems to me that JBoss first trys to migrate the whole JMS stuff which also lays in directory deploy-hasingleton (I use the 3.2.4 source snapshot from 26. May 2004). There are some exceptions on the console, see below. Btw, my service hasn't any dependency to a JMS Queue or Topic. Is the delay caused by these exceptions and does JBoss migrate singleton services sequentially where one has to wait until the one before was migrated. The second question is about the DistributedState. I looked at the code of DistributedStateImpl and it seems to me that everything which is stored there is not persistent. Are there any plans for the future to implement a persistent distributed state? Regards, Thorsten | 09:27:36,140 WARN [Connection] Connection failure: | org.jboss.mq.SpyJMSException: Exiting on IOE; - nested throwable: (java.net.SocketException: Connection reset) | at org.jboss.mq.Connection.asynchFailure(Connection.java:429) | at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILService.java:145) | at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.java:398) | at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:332) | at java.lang.Thread.run(Thread.java:534) | Caused by: java.net.SocketException: Connection reset | at java.net.SocketInputStream.read(SocketInputStream.java:168) | at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) | at java.io.BufferedInputStream.read(BufferedInputStream.java:201) | at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:67) | at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133) | at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2313) | at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2380) | at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2452) | at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2601) | at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845) | at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:279) | ... 1 more | 09:27:36,156 WARN [JMSContainerInvoker] JMS provider failure detected: | org.jboss.mq.SpyJMSException: Exiting on IOE; - nested throwable: (java.net.SocketException: Connection reset) | at org.jboss.mq.Connection.asynchFailure(Connection.java:429) | at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILService.java:145) | at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.java:398) | at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:332) | at java.lang.Thread.run(Thread.java:534) | Caused by: java.net.SocketException: Connection reset | at java.net.SocketInputStream.read(SocketInputStream.java:168) | at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) | at java.io.BufferedInputStream.read(BufferedInputStream.java:201) | at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:67) | at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133) | at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2313) | at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2380) | at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2452) | at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2601) | at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845) | at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:279) | ... 1 more | 09:27:36,187 INFO [JMSContainerInvoker] Trying to reconnect to JMS provider | 09:27:46,187 ERROR [JMSContainerInvoker] Could not stop JMS connection | org.jboss.mq.SpyJMSException: Cannot disable the connection with the JMS server; - nested throwable: (java.io.IOException: Client is not connected) | at org.jboss.mq.Connection.doStop(Connection.java:1278) | at org.jboss.mq.Connection.stop(Connection.java:711) | at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStop(JMSContainerInvoker.java:832) | at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl.onException(JMSContainerInvoker.java:1265) | at org.jboss.mq.Connection.asynchFailure(Connection.java:439) | at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILService.java:145) | at