[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Anyone know how to acesses the datasource connection remotely I am getting the problem with getBinaryStream I kept the use-java-contextfalse/use-java-context in my datasource file View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4055171#4055171 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4055171 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Not really sure why you are getting an error with the getBinaryStream function, but you really should not use this design. It is an anti pattern. Please look at the footnote at the bottom of this wiki article. http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources You definitly want to put a Session facade in front of the db calls. Jay:) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4055299#4055299 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4055299 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Hi Jhowell, Fell pleasure to see your reply thanks for your reply.Actually my application is a desktop application .Ad when I made the mysql connection using datasource nad if I keep use-java-contexttrue/use-java-context then I got the error that the not able to lookup my jndi name. My datasource file isas below :: | | | ?xml version=1.0 encoding=UTF-8? | | !-- $Id: mysql-ds.xml,v 1.3 2004/09/15 14:37:40 loubyansky Exp $ -- | !-- Datasource config for MySQL using 3.0.9 available from: | http://www.mysql.com/downloads/api-jdbc-stable.html | -- | | datasources | local-tx-datasource | jndi-nameDBConnection/jndi-name | use-java-contextfalse/use-java-context | connection-urljdbc:mysql://localhost:3306/millind_demo?autoReconnect=true/connection-url | driver-classcom.mysql.jdbc.Driver/driver-class | user-nameroot/user-name | passwordroot/password | max-pool-size60/max-pool-size | min-pool-size10/min-pool-size | blocking-timeout-millis5000/blocking-timeout-millis | idle-timeout-minutes15/idle-timeout-minutes | !-- correspondinasdg type-mapping in the standardjbosscmp-jdbc.xml (optional) -- | metadata | type-mappingmySQL/type-mapping | /metadata | /local-tx-datasource | | /datasources | | thast why I kept it use-java-contextfalse/use-java-context as I accessed the datasoure from plain pojo.. Everything is fine with this fashion but when I used getBinaryStream on sql resultset it give the errorrs like below:: anonymous wrote : | java.lang.reflect.UndeclaredThrowableException | at $Proxy3.getBinaryStream(Unknown Source) | at in.etp.dim.ui.gfhfghfgh.main(gfhfghfgh.java:57) | Caused by: java.lang.IllegalAccessException: Method=public abstract java.io.InputStream java.sql.ResultSet.getBinaryStream(int) throws java.sql.SQLException does not return Serializable | at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.doResultSetMethod(WrapperDataSourceService.java:478) | at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.invoke(WrapperDataSourceService.java:252) | . I am now going to call it from seesion bean. But not understanding how to create proxy and how to call it from plain pojo... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4055451#4055451 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4055451 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
I am using MDB which able tolisen on only one particular wqueue how will make my single mdb to listen on more than on e queue I am trying it by using the tag of destination-jndi-namequeue/D/destination-jndi-name but iis not working it is working fine with onlye one mdb. If anyone knows it then please tell me how to used for the more than one destination in single md.. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4034859#4034859 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4034859 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
I would like to thanks the way you reply me its pleasurable Well still I am working on the same track as I said previouslly that I am getting the problem with the geMessagecounter() metod that will get soloved as I used inside the session stateless bean.. Well but still I alwayes get the values zero for getScheduledMessage and still didnt know how to count that how many messages receiver acepted.. Rigth now I am working on the notfications ..As soon as the messages comes into the queue I want to do the automatic udpation for statastics of how many shceduled .pending and recived which will then dipalyed to user in the gui.. Well now I am going to used Message Drievrn Bean as I am also not o much familliar with it and want o chech the behaviour of the onMessage Method I think that method itsellf migth give me soloution and tyes there is method og queueMbean.addNotificationListener(). This method I am not able to used because of theire parameters. Well if uyou have any suggestions for the notifcation then please sufggeset me :) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4033888#4033888 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4033888 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
I haven't worked with jms much, so i don't know, but i took a look at MBean attributes, this one monitoring queue, and there are two attributes which are the ones you need: ScheduledMessageCount InProcessMessageCount But i don't know how they work, you must to check them. Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032665#4032665 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032665 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Hello If you really need remote access you need to change one line in your code. Change this line: MBeanServer server = MBeanServerLocator.locateJBoss(); to this one: MBeanServerConnection server = (MBeanServerConnection) ictx.lookup(jmx/invoker/RMIAdaptor); That should help. Best regards. vitor_b P.S. Do you have any experience in working with XML? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031941#4031941 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031941 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
yes ,, hay thanks for ur reply as I get confident from your reply because before reading your reply I did the things which you mentioned but the thing is that only the getQueueDepth is working which is nothing but the tolal number fo the messages in the queue..Other attributes like the getSchedulemessagecount(),getReceiversCount() are giving the values zero ..Still writing this reply I used all thses things only on the receivers side.. I did in the foloowing way while sending the messages and still not on the receivers side... | MBeanServerConnection mbean_server = null; | ObjectName dm = null; | try{ | | | mbean_server =(MBeanServerConnection) ctx.lookup(jmx/rmi/RMIAdaptor); | dm = new ObjectName(jboss.mq:service=DestinationManager); | | String domain = jboss.mq.destination; |String service = service=Queue; |String name = name=queue/C; | | String stringObjectName = domain + : + service + , + name; | | | | | ObjectName queueObjectName = ObjectName.getInstance(stringObjectName); | | org.jboss.mq.server.jmx.QueueMBean queueMBean = | (org.jboss.mq.server.jmx.QueueMBean) MBeanServerInvocationHandler.newProxyInstance( | mbean_server, | queueObjectName, | org.jboss.mq.server.jmx.QueueMBean.class, | false | ); | System.out.println(queue depth is : + queueMBean.getQueueDepth()); | System.out.println(getScheduledMessageCount count is : + queueMBean.getScheduledMessageCount()); | System.out.println(History Limit :+queueMBean.getMessageCounterHistoryDayLimit()); | System.out.println(MAximmum depth :+ queueMBean.getMaxDepth()); | System.out.println(Receiver Count is : +queueMBean.getReceiversCount()); | System.out.println(Redelivery Limit:+queueMBean.getRedeliveryLimit()); | System.out.println(Name is :+queueMBean.getName()); | System.out.println(queue name is :+queueMBean.getQueueName()); | | | Again if I did the org.jboss.mq.server MessageCounter meas []= queueMBean.getMessageCounter(); then I got the exception as=== java.lang.reflect.UndeclaredThrowableException at $Proxy1.getMessageCounter(Unknown Source) at Statstic.Sender_Count.main(Sender_Count.java:220) Caused by: java.io.NotSerializableException: org.jboss.mq.server.MessageCounter at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1224) . Beside the total count of the messages in the queue I also needed how many messages are scheduled(Recived by reciver ) ,pending.If u have idea then please suggest and guide me. Thanks for all your help it is pleasurabel :) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031954#4031954 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031954 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
milind.uc wrote : yes ,, hay thanks for ur reply as I get confidence from your reply because before reading your reply I did the things which you mentioned but the thing is that only the getQueueDepth is working which is nothing but the tolal number fo the messages in the queue..Other attributes like the getSchedulemessagecount(),getReceiversCount() are giving the values zero ..Still writing this reply I used all thses things only on the receivers side.. I did in the foloowing way while sending the messages and still not on the receivers side... | | | | MBeanServerConnection mbean_server = null; | | ObjectName dm = null; | | try{ | | | | | | mbean_server =(MBeanServerConnection) ctx.lookup(jmx/rmi/RMIAdaptor); | | dm = new ObjectName(jboss.mq:service=DestinationManager); | | | | String domain = jboss.mq.destination; | |String service = service=Queue; | |String name = name=queue/C; | | | | String stringObjectName = domain + : + service + , + name; | | | | | | | | | | ObjectName queueObjectName = ObjectName.getInstance(stringObjectName); | | | | org.jboss.mq.server.jmx.QueueMBean queueMBean = | | (org.jboss.mq.server.jmx.QueueMBean) MBeanServerInvocationHandler.newProxyInstance( | | mbean_server, | | queueObjectName, | | org.jboss.mq.server.jmx.QueueMBean.class, | | false | | ); | | System.out.println(queue depth is : + queueMBean.getQueueDepth()); | | System.out.println(getScheduledMessageCount count is : + queueMBean.getScheduledMessageCount()); | | System.out.println(History Limit :+queueMBean.getMessageCounterHistoryDayLimit()); | | System.out.println(MAximmum depth :+ queueMBean.getMaxDepth()); | | System.out.println(Receiver Count is : +queueMBean.getReceiversCount()); | | System.out.println(Redelivery Limit:+queueMBean.getRedeliveryLimit()); | | System.out.println(Name is :+queueMBean.getName()); | | System.out.println(queue name is :+queueMBean.getQueueName()); | | | | | | | | Again if I did the org.jboss.mq.server MessageCounter meas []= queueMBean.getMessageCounter(); then I got the exception as=== | java.lang.reflect.UndeclaredThrowableException | at $Proxy1.getMessageCounter(Unknown Source) | at Statstic.Sender_Count.main(Sender_Count.java:220) | Caused by: java.io.NotSerializableException: org.jboss.mq.server.MessageCounter | at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) | at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1224) | . | | Beside the total count of the messages in the queue I also needed how many messages are scheduled(Recived by reciver ) ,pending.If u have idea then please suggest and guide me. | | Thanks for all your help it is pleasurable :) | View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031958#4031958 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031958 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Hello It looks that reference to this object cannot be sent outside JVM in which this object lives. This is an simple object, not bean, so you cannot access it. Honestly I don't know how to do that. From inside server you could access and use that reference. So... personally i would create session bean working on server, which will expose some methods. These methods would get info about yoour queue via MBean Proxy. You could create MBean proxy in ejbCreate method, and this bean could be stateless. So you would lokup for that bean, call methods on it, and all logic taking info about your queue would be inside that bean methods. It is heavier but I don't know the other way. Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032007#4032007 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032007 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Well I jsut came here now I am going to try it with the ejbs lets see ,,, I tried to serialize the object also but it didnt work . And yes do you have idea that how to find the scheduled and pending message count for the particular queue. As I said that as per our meanserver methods I am getting the onlye no of messages only not how much exactlyy scheduled and pendng View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032302#4032302 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032302 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
milind.uc wrote : milind.uc wrote : Well I jsut came here now I am going to try it with the ejbs lets see ,,, I tried to serialize the object also but it didnt work . And yes do you have idea that how to find the scheduled and pending message count for the particular queue. As I said that as per our mbeanserver methods I am getting the onlye no of messages only not how much exactlyy scheduled and pending View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032304#4032304 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032304 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Thanks for your reply. The problem with my Queue was that described in section 2. I did not call connection.start() method. My mistake. If we talk about books: i haven't seen any good one. I learned from Jboss wiki knowledgebase: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMX If you have any questions just ask, but i'm not an expert, so it is possible that I won't be able to answer to your questions. Anyway, i will try :) Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031511#4031511 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031511 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Dear Victor, Feel happy as ur problem get solved... Well I tried the code sample which you have been written for me but I am getting problem in it. | | String domain = jboss.mq.destination; | String service = service=Queue; | String name = name=testQueue; | | String stringObjectName = domain + : + service + , + name; | | MBeanServer server = MBeanServerLocator.locateJBoss(); | | try{ | ObjectName queueObjectName = ObjectName.getInstance(stringObjectName); | | org.jboss.mq.server.jmx.QueueMBean queueMBean = | (org.jboss.mq.server.jmx.QueueMBean) MBeanServerInvocationHandler.newProxyInstance( | server, | queueObjectName, | org.jboss.mq.server.jmx.QueueMBean.class, | false | ); | | logger.info(queue depth: + queueMBean.getQueueDepth()); | | }catch (Exception e){ | logger.info(cannot get depth of the queue: + e.getMessage(),e); | } After using it I am getting the error like :--- java.lang.IllegalStateException: No 'jboss' MBeanServer found! at org.jboss.mx.util.MBeanServerLocator.locateJBoss(MBeanServerLocator.java:46) So do you have any idea on it View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031515#4031515 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031515 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Hmm... This line: MBeanServer server = MBeanServerLocator.locateJBoss(); should work when calling from non-MBean, for example from EJB session bean in the same JVM. I don't think that you calling it in this way. I have JBoss 4.0.5 GA, but that class was available in version 3.2.7 or even earlier. I tested this code before posting it and it works fine for me. My code was in stateless session bean deployed on JBoss. So try it from the same JVM. Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031583#4031583 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031583 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
yes ,, I think I am doing the mistake while using it actually I am using it fom simple pojo class. | public class Sender_Count | { | | | | | | public static QueueConnectionFactoryfactory = null; | public static QueueConnection connection = null; | public static QueueSession session = null; | public static QueueSender sender = null; | public static Context ctx = null; | public static javax.jms.Queue queue = null; | public static TextMessage message = null; | public static ConnectionMetaDatametadata= null; | public static Queue obj = null; | | //public static JMSQueue queue = null; | | | public static void main(String[] args) | { | | /* | * Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,org.jnp.interfaces.NamingContext); env.put(Context.PROVIDER_URL,jnp://localhost:1099); env.put(Context.URL_PKG_PREFIXES,jboss.naming:org.jnp.interfaces); | */ | | | | Hashtable env = new Hashtable(); | | env.put(Context.INITIAL_CONTEXT_FACTORY, org.jnp.interfaces.NamingContextFactory); | env.put(Context.PROVIDER_URL, jnp://localhost:1099); | env.put(Context.URL_PKG_PREFIXES, jboss.naming:org.jnp.interfaces); | | | | try | { | ctx = new InitialContext(env); | factory = (QueueConnectionFactory) ctx.lookup(UIL2ConnectionFactory); | connection = factory.createQueueConnection(); | session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); | queue = (javax.jms.Queue) ctx.lookup(queue/C); | sender = session.createSender(queue); | connection.start(); | message = session.createTextMessage(); | message.setText(Bajirao_Mastani); | sender.send(message); | | | | | | String domain = jboss.mq.destination; | String service = service=Queue; | String name = name=queue/C; | | String stringObjectName = domain + : + service + , + name; | | MBeanServer server = MBeanServerLocator.locateJBoss(); | | try{ | ObjectName queueObjectName = ObjectName.getInstance(stringObjectName); | | org.jboss.mq.server.jmx.QueueMBean queueMBean = | (org.jboss.mq.server.jmx.QueueMBean) MBeanServerInvocationHandler.newProxyInstance( | server, | queueObjectName, | org.jboss.mq.server.jmx.QueueMBean.class, | false | ); | | logger.info(queue depth: + queueMBean.getQueueDepth()); | | }catch (Exception e){ | logger.info(cannot get depth of the queue: + e.getMessage(),e); | } | | | } | catch (NamingException e) | { | e.printStackTrace(); | } | catch (JMSException se) | { | se.printStackTrace(); | } | catch (ClassCastException ce) | { | ce.printStackTrace(); | } | | } | } | | I think i am doing something wrong by calling it in above fashion from simple pojo class...Iam in trouble because of that locateJboss() so help me. Thanks :) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031870#4031870 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031870 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Hello I have a solution for you. The key is JMX API. As you know there is a MBean which you can view using jboss jmx console. One thing we have to do is to acces that MBean. Here is some code i have written for you: String domain = jboss.mq.destination; | String service = service=Queue; | String name = name=testQueue; | | String stringObjectName = domain + : + service + , + name; | | MBeanServer server = MBeanServerLocator.locateJBoss(); | | try{ | ObjectName queueObjectName = ObjectName.getInstance(stringObjectName); | | org.jboss.mq.server.jmx.QueueMBean queueMBean = | (org.jboss.mq.server.jmx.QueueMBean) MBeanServerInvocationHandler.newProxyInstance( | server, | queueObjectName, | org.jboss.mq.server.jmx.QueueMBean.class, | false | ); | | logger.info(queue depth: + queueMBean.getQueueDepth()); | | }catch (Exception e){ | logger.info(cannot get depth of the queue: + e.getMessage(),e); | } When you have a proxy then you can get all queue properties by calling method: getNameOfAttribute (ex. queueMBean.getQueueDepth();) These three strings set up at the begining are taken from jmx-console page for MBean monitoring Queue. If you have any questions, just ask. As a reward please look at my question (Queue - I can send but cannot receive) i'm going to write right now. Since you are working with queues maybe you will be able to help me. Take care vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031029#4031029 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031029 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user