-
1. Re: Initial context create issue
jaikiran Oct 4, 2012 3:58 AM (in response to thinksteep)Which exact version of JBoss AS7? Which version of libraries do you have on the client side? What exactly does your client code look like?
-
2. Re: Initial context create issue
thinksteep Oct 4, 2012 9:58 AM (in response to jaikiran)Hi Jaikiran, JBoss7.1.1Final is the version we are using.
I can't post my Standalone app related code here, because it is multiple files.
Here is the STAND ALONE client (which is shorter version of my standalone app) which is throwing "java.lang.RuntimeException: Operation failed with status WAITING". I think this is fine, but same code not working in my STANDALONE APP.
NOTE: Don't worry about coding practices.This is just test code.
public class JMSTest extends Thread {
public InitialContext inCtx;
public QueueSender sender;
public QueueSession session;
public JMSTest(InitialContext initCtx) {
inCtx = initCtx;
try {
QueueConnectionFactory qcf = (QueueConnectionFactory) inCtx.lookup("jms/RemoteConnectionFactory");
Queue que = (Queue) inCtx.lookup("myQueue");
QueueConnection conn = qcf.createQueueConnection("user", "pwd");
session = conn.createQueueSession(false,
QueueSession.AUTO_ACKNOWLEDGE);
sender = session.createSender(que);
} catch (NamingException ne) {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
p.put(Context.PROVIDER_URL, "remote://mymachine:4447");
p.put(Context.SECURITY_PRINCIPAL, "user");
p.put(Context.SECURITY_CREDENTIALS, "pwd");
try {
inCtx.close();
inCtx = new InitialContext(p);
QueueConnectionFactory qcf = (QueueConnectionFactory) inCtx.lookup("jms/RemoteConnectionFactory");
Queue que = (Queue) inCtx.lookup("myQueue");
QueueConnection conn = qcf.createQueueConnection("user", "pwd");
session = conn.createQueueSession(false,
QueueSession.AUTO_ACKNOWLEDGE);
sender = session.createSender(que);
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void run() {
try {
System.out.println("Clietn ID is: " + sender.getDestination());
sleep(5000000);
sender.close();
session.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) throws NamingException {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
p.put(Context.PROVIDER_URL, "remote://mymachine:4447");
p.put(Context.SECURITY_PRINCIPAL, "user");
p.put(Context.SECURITY_CREDENTIALS, "pwd");
final InitialContext iniCtx = new InitialContext(p);
for (;;) {
(new JMSTest(iniCtx)).start();
}
}
}
JARs I have in class path are:
jboss-as-controller-7.1.1.Final.jar
jboss-as-controller-client-7.1.1.Final.jar
jboss-as-protocol-7.1.1.Final.jar
jboss-dmr-1.1.1.Final.jar
.jboss-logging-3.1.0.GA.jar
jboss-logmanager-1.2.2.GA.jar
jboss-marshalling-1.3.11.GA.jar
jboss-remoting-3.2.3.GA.jar
jboss-sasl-1.0.0.Final.jar
jboss-threads-2.0.0.GA.jar
xnio-api-3.0.3.GA.jar
xnio-nio-3.0.3.GA.jar
jboss-client.jar
Any input would be appreciated.
Thanks for your time and help.
-
3. Re: Initial context create issue
thinksteep Oct 8, 2012 11:03 AM (in response to jaikiran)Hi Community,
Could someone help me on this? I am really stuck.
Thanks for your time!
Thank you,
-
4. Re: Initial context create issue
ctomc Oct 8, 2012 11:59 AM (in response to thinksteep)can you try to reproduce this with latest nightly builds?
--
tomaz
-
5. Re: Initial context create issue
thinksteep Oct 23, 2012 5:45 PM (in response to ctomc)Hi Tomaz cerar,
Thanks for your reply!
http://hudson.jboss.org/hudson/view/AS7/job/as7-master-build/
Is this the place from where I can get nightly builds?
Thanks for your time and help.
-
6. Re: Initial context create issue
jaikiran Oct 23, 2012 10:07 PM (in response to thinksteep)thinksteep thinksteep wrote:
Is this the place from where I can get nightly builds?