Restarting of tomcat server while using jsp
hi,
Iam using a jsp page on tomcat server. It actually sends message to a phone, after that it comes back to the same jsp using the same url.
But after it comes back, the jsp is not working properly. I have to restart tomcat server each time for it to work.
As iam redirecting it back to the same jsp , i expect it to work properly as nothing is being changed. Its not practical to restart the server each time.
Can anyone help me with this?
Thanks in advance
san
[509 byte] By [
sansaja] at [2007-9-23]

Hi,
Iam getting error at this particular point in the code
DirContext ctx = new InitialDirContext(env);
The function contains the following code
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL,
"ldap://" + ldapServer + ":" + String.valueOf(ldapPort) + "/" + rootDn);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, ldapUserId);
env.put(Context.SECURITY_CREDENTIALS, ldapPassword);
DirContext ctx = new InitialDirContext(env);
//at this point its gives array out of bound , java.util.vector error
Attributes matchAttrs = new BasicAttributes(ignoreCase);
if (matchRules != null) {
Iterator attrIter = matchRules.keySet().iterator();
while (attrIter.hasNext()) {
String key = (String) attrIter.next();
String value = (String) matchRules.get(key);
matchAttrs.put(new BasicAttribute(key, value));
}
}
response = ctx.search(searchBase, matchAttrs, returnAttrs);
lastResult = new Vector();
while (response.hasMore()) {
HashMap attrMap = new HashMap();
SearchResult sr = (SearchResult) response.next();
Attributes attrs = sr.getAttributes();
NamingEnumeration attrsEnum = attrs.getAll();
while (attrsEnum.hasMore()) {
Vector values = new Vector();
Attribute attr = (Attribute) attrsEnum.next();
for (int i = 0; i < attr.size(); i++) {
values.add(attr.get(i));
}
attrMap.put(attr.getID(), values);
}
lastResult.add(attrMap);
First time when i run it runs fine, but the second time , it gives error.