[Messaging, JMS & JBossMQ] - Re: Frustration with basic client and broken examples.
by dbs
I have gotten the example to successfully run, but I'm not 100% -why- it runs now and didn't before. Here's the updated code, hopefully someone can validate whether this should be put into the wiki or not:
Do we really need the direct references to the Spy* classes?
| package com.areteinc.queue;
|
|
| import java.util.Properties;
|
| import javax.jms.Message;
| import javax.jms.Queue;
| import javax.jms.QueueConnection;
| import javax.jms.QueueConnectionFactory;
| import javax.jms.QueueReceiver;
| import javax.jms.QueueSession;
| import javax.jms.Session;
| import javax.jms.TextMessage;
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import org.jboss.mq.SpyQueueSender;
|
| public class QueueExample
| {
|
| // @Resource(mappedName="queue/A")
| // static SpyDestination queue;
| public static void main(String[] args) throws Exception
| {
| log.info("Creating jndi context - alternatively use a jndi.properties");
| Properties properties = new Properties();
| properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
| properties.put(Context.PROVIDER_URL, "localhost");
|
| InitialContext ctx = new InitialContext(properties);
|
| log.info("Looking up queue");
|
| Context remoteCtx = new InitialContext(properties);
| Queue queue = (Queue)remoteCtx.lookup("queue/A");
|
| log.info("Looking up connection factory");
| QueueConnectionFactory qcf = (QueueConnectionFactory) ctx.lookup("UIL2ConnectionFactory");
|
| log.info("Creating connection");
| QueueConnection qc = qcf.createQueueConnection();
| try
| {
| log.info("Creating session");
| QueueSession qs = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
|
| log.info("Creating sender");
| SpyQueueSender sender = (SpyQueueSender)qs.createSender(queue);
|
| log.info("Creating message");
| TextMessage message = qs.createTextMessage("hello");
|
| log.info("Sending message");
| sender.send(queue,message);
|
| log.info("Creating receiver");
| QueueReceiver receiver = qs.createReceiver(queue);
|
| log.info("Try to receive message, it will not work");
| Message received = receiver.receiveNoWait();
| if (received != null)
| throw new RuntimeException("Should not get a message if the connection is not started!");
|
| log.info("You have to start the connection before receiving messages");
| qc.start();
|
| log.info("This receive will work");
| received = receiver.receiveNoWait();
|
| log.info("Got message: " + received);
| }
| finally
| {
| qc.close();
| }
| }
|
| public static class log
| {
| public static void info(String message)
| {
| System.out.println(message);
| }
| public static void error(String message, Throwable t)
| {
| System.err.println(message);
| t.printStackTrace();
| }
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983568#3983568
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983568
19Â years, 6Â months
[Clustering/JBoss] - DeploymentException
by somejunk
Hi,
I have two instances of JBoss 4.0.2 on two different machines in a cluster.
Two instances are recognizing each other and every thing is fine. But I get this exception. I posted the exception stack trace for two of the files but it shows the same deployment exception for 6-7 files. Any idea on what this could be?
Thanks
2006-11-06 15:25:44,859 DEBUG [org.jboss.deployment.MainDeployer] The manifest entry in file:/D:/jboss-4.0.2/server/bbw/tmp/deploy/tmp18877bbw.ear-contents/bbw.war references URL file:/D:/jboss-4.0.2/server/bbw/tmp/deploy/tmp18877bbw.ear-contents/JTurbo.jar which could not be opened, entry ignored
org.jboss.deployment.DeploymentException: url file:/D:/jboss-4.0.2/server/bbw/tmp/deploy/tmp18877bbw.ear-contents/JTurbo.jar could not be opened, does it exist?
at org.jboss.deployment.DeploymentInfo.(DeploymentInfo.java:175)
at org.jboss.deployment.MainDeployer.parseManifestLibraries(MainDeployer.java:1070)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:840)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:848)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:765)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy52.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
at org.jboss.ha.framework.server.FarmMemberService.deploy(FarmMemberService.java:375)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
at org.jboss.ha.framework.server.FarmMemberService.startService(FarmMemberService.java:157)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:418)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:956)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:418)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
at org.jboss.Main.boot(Main.java:195)
at org.jboss.Main$1.run(Main.java:463)
at java.lang.Thread.run(Thread.java:534)
2006-11-06 15:25:44,859 DEBUG [org.jboss.deployment.MainDeployer] new manifest entry for sdi at bbw.war entry is cryptix32.jar
2006-11-06 15:25:44,859 DEBUG [org.jboss.deployment.MainDeployer] The manifest entry in file:/D:/jboss-4.0.2/server/bbw/tmp/deploy/tmp18877bbw.ear-contents/bbw.war references URL file:/D:/jboss-4.0.2/server/bbw/tmp/deploy/tmp18877bbw.ear-contents/cryptix32.jar which could not be opened, entry ignored
org.jboss.deployment.DeploymentException: url file:/D:/jboss-4.0.2/server/bbw/tmp/deploy/tmp18877bbw.ear-contents/cryptix32.jar could not be opened, does it exist?
at org.jboss.deployment.DeploymentInfo.(DeploymentInfo.java:175)
at org.jboss.deployment.MainDeployer.parseManifestLibraries(MainDeployer.java:1070)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:840)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983563#3983563
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983563
19Â years, 6Â months
[JBossWS] - TCP/IP settings for Web Service Client?
by tgoepferd
Hello,
I have an application that launches a SOAP request to a .NET web service. My applcation runs on JBoss 4.0.4 on Redhat vLinux 2.6.9-42.ELsmp (i386) with Java 1.5.0_07_b3
The SOAP messages that I send are being broken into two packets. Using TCPDUMP, I see that the two packets are being sent within a couple milliseconds. However, in a few cases, the second packet is not sent for 2 seconds after the first packet is sent. Since our application requires low latency, a 2 second wait just to get the packet on the wire is too long.
Does anyone know of any possible causes for this?
Does anyone know if my application can set any flags or config settings to minipulate the TCP/IP stack behavior?
Our client is so far removed ( which I am very happy about) from the TCP/IP implementation, that I assume we are at the mercy of the OS and how JBoss interacts with it. Never-the-less, this is an important application for us and any help would be appreciated.
Thanks,
Todd Goepferd
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983557#3983557
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983557
19Â years, 6Â months