ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » MQServer with JMS without using Application Server

Post new topic  Reply to topic
 MQServer with JMS without using Application Server « View previous topic :: View next topic » 
Author Message
murugaanandam
PostPosted: Mon May 24, 2004 11:31 pm    Post subject: MQServer with JMS without using Application Server Reply with quote

Novice

Joined: 22 Apr 2004
Posts: 19

Dear all,

i have one doubt, like
i want to commiunicate MQServer with JMS without using Application Server.

for example,

QueueConnection conn = null;

try
{
InitialContext ctx = new InitialContext();

QueueConnectionFactory qcf = (QueueConnectionFactory) ctx.lookup(qcfName);
Queue senderQ = (Queue) ctx.lookup(queueName);

conn = qcf.createQueueConnection();
conn.start();
QueueSession session =
conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
TextMessage message = session.createTextMessage(msg);
QueueSender sender = session.createSender(senderQ);
sender.send(message);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
if(conn != null)
{
try
{
conn.close();
conn = null;
}
catch (javax.jms.JMSException je)
{
je.printStackTrace();
}
}
}
}

my doubt is

its possible to create initialcontext object without passing PROVIDER_URL

plz explain me
thanx in advance

regards
muruganandam
Back to top
View user's profile Send private message
fschofer
PostPosted: Tue May 25, 2004 12:13 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

Hi,
you do not have to use WAS as JNDI provider, you can also use the filesystem or a LDAP server.

There are also some samples for using JMS without JNDI included in the MQ installation (at least in the windows version).
For example take a look at <MQ Install>/Tools/Java/jms/PTPSample01.java

Greetings
Frank
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue May 25, 2004 4:02 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Also, there are specific steps outline in the Using Java manual for building a QCF and etc at runtime - without using JNDI at all.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue May 25, 2004 5:27 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I use JMS all of the time without being in an Application Server environment. There are plenty of JMS samples at:

http://www.developer.ibm.com/tech/sampmq.html
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
murugaanandam
PostPosted: Wed May 26, 2004 1:12 am    Post subject: Can't find SerialContextProvider Reply with quote

Novice

Joined: 22 Apr 2004
Posts: 19

dear all

i run my java application
i got some exception

javax.naming.CommunicationException: Can't find SerialContextProvider
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav
a:63)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120
)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at JMSTester.main(JMSTester.java:19)


how to resolve this prblm

plz help me solve the pbm
Back to top
View user's profile Send private message
JLRowe
PostPosted: Wed May 26, 2004 5:13 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

You have no naming service.

You need to decide whether you want to:

1) Create the JMS objects within the code, this will tie your code down to the JMS provider - MQSeries.

2) Use a naming service such as fscontext which allows you to store managed objects in the file system, you will need to use the JMS admin tool to setup the managed objects. This approach isolates your code from the JMS implementation.

I would suggest you muddle your way through (1), and then decide what to do. The MQSeries programming with Java manual gives *plenty* of details and some example code.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQServer with JMS without using Application Server
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.