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 » OutOfBounds Retrieving TCF from LDAP

Post new topic  Reply to topic
 OutOfBounds Retrieving TCF from LDAP « View previous topic :: View next topic » 
Author Message
mpr
PostPosted: Mon Feb 25, 2002 3:22 am    Post subject: Reply with quote

Newbie

Joined: 24 Feb 2002
Posts: 4

I have used the JMSAdmin Tool to store a TCF in an LDAP Directory. When I try to retrieve the TCF in my programm I get an Error Message:
java.lang.ArrayIndexOutOfBoundsException: 10 > 1
at java.util.Vector.insertElementAt(Vector.java:551)
at javax.naming.Reference.add(Reference.java:276)
at com.sun.jndi.ldap.Obj.decodeReference(Obj.java:461)
at com.sun.jndi.ldap.Obj.decodeObject(Obj.java:232)
at com.sun.jndi.ldap.LdapCtx.c_lookup(LdapCtx.java:807)
at com.sun.jndi.toolkit.ctx.ComponentContext.p_lookup(ComponentContext.java:525)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeContext.java:158)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeContext.java:147)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at myproject1.ebi_jms_api.getTopicConnection(ebi_jms_api.java:79)
at myproject1.EBIJMSAPITester.main(EBIJMSAPITester.java:29)

I have more or less copied the examples from the manuals. Any ideas what is causing this problem?
Thanks in advance,
Martin
Back to top
View user's profile Send private message
abmanesh
PostPosted: Mon Feb 25, 2002 11:52 am    Post subject: Reply with quote

Apprentice

Joined: 06 Nov 2001
Posts: 39

Hi Martin,
Could you post the portion of the code that sets up the initial context, and does the look up for TCF from the JNDI namespace.

Back to top
View user's profile Send private message Send e-mail
mpr
PostPosted: Tue Feb 26, 2002 4:22 am    Post subject: Reply with quote

Newbie

Joined: 24 Feb 2002
Posts: 4

Sure:
//initialization, we have the structure /EBI/JMS/Infra/Batch/TCF in the dir
//setup the initial context
static java.util.Hashtable environment;
initialContextFactory = "com.sun.jndi.ldap.LdapCtxFactory";
baseUrl = "ldap://se1d4.csintra.net:20412/";
urlPath = "ou=Infra,ou=JMS,ou=EBI";
urlBatch = "ou=Batch,";
urlOnline = "ou=Online,";
urlTCF = "ou=TCF,";
urlQCF = "ou=QCF,";
tcfName = "EBITCF";
environment = new java.util.Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
environment.put(Context.SECURITY_AUTHENTICATION, "simple");
environment.put(Context.SECURITY_PRINCIPAL, "cn=a252518");
environment.put(Context.SECURITY_CREDENTIALS, "a252518");
environment.put(Context.SECURITY_PROTOCOL, "");
environment.put(Context.REFERRAL, "throw");

//setup URL
String TempUrl = baseUrl;
TempUrl = TempUrl + urlTCF + urlOnline + urlPath;
environment.put(Context.PROVIDER_URL, TempUrl);

TopicConnectionFactory tcf = null;
tcf = (TopicConnectionFactory)ctx.lookup("cn=EBITCF1"); //code crashes here
Back to top
View user's profile Send private message
abmanesh
PostPosted: Tue Feb 26, 2002 7:12 am    Post subject: Reply with quote

Apprentice

Joined: 06 Nov 2001
Posts: 39

Once you set up the environmentment properties, the initial JNDI context is not set up.
Assuming the 'ctx' is of type Context
try ,
after ..
environment.put(Context.PROVIDER_URL, TempUrl);

ctx = new InitialDirContext(environment) // Initialize the dir contex .

Back to top
View user's profile Send private message Send e-mail
mpr
PostPosted: Tue Feb 26, 2002 7:38 am    Post subject: Reply with quote

Newbie

Joined: 24 Feb 2002
Posts: 4

Sorry, I didn't copy all the code.
I am actually doing a:
Context ctx = new InitialDirContext(environment);

Any other ideas?
Thx,
Martin

PS: The OutOfBounds exception seems to be when trying to insert the Broker Version item. This seems to contain two strings "2" and "VER".

[ This Message was edited by: mpr on 2002-02-26 07:58 ]
Back to top
View user's profile Send private message
mpr
PostPosted: Wed Feb 27, 2002 4:59 am    Post subject: Reply with quote

Newbie

Joined: 24 Feb 2002
Posts: 4

Hmmh,
my code works with JDK V1.1.7 and 1.2.2 but not with 1.3.
Incidentally I have found out that the JMSAdmin tool also will not work correctly with JDK 1.3. You can define a tcf but you cannot display or delete it.
regards,
Martin

PS: In the mean time I have out that all works fine with the JDK version 1.3.1 (from Sun) but not with the JDK version that we are officially using which is 1.3.0_02 distributed with Borlands JBuilder.

[ This Message was edited by: mpr on 2002-02-28 01:08 ]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » OutOfBounds Retrieving TCF from LDAP
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.