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]
# 1
Hard to say much except that you have a bug.
DrClapa at 2007-7-10 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks for your reply. In the server logs, Iam getting array out of bond expection in java. util. vector. Do u have any suggestion for this?
sansaja at 2007-7-10 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 3
It would be a good idea to find out why, don't you think?Hard to say much else based on the information you posted. But you have confirmed that you have a bug, so you're moving in the right direction.
DrClapa at 2007-7-10 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 4

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.

sansaja at 2007-7-10 > top of java,Enterprise & Remote Computing,Web Tier APIs...