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

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.

Similar Messages

  • How can i upload a image file to server by using jsp or servlet.

    Hi,
    I m gurumoorthy. how can i upload a image file to server by using jsp or servlet without using third party API. pls anyone send me atleast outline of the source code.
    Pls send me anyone.
    Regards,
    Gurumoorthy.

    I'm not an applet programmer so I can't give you much advice there.
    If you want to stream the file from the server before it's entirely uploaded, then I don't believe you can treat it like a normal file. If you're just wanting to throw it up there and then listen to it, then you can treat it like a normal file.
    But again, I'm not entirely certain. You might be able to stream the start of the file from the server while you're still uploading the end of it, but it probably depends on what method you're using to do the transfer.

  • Do we need to restart the Tomcat server each time when we modify servlets?

    Hi Friends,
    Do we need to restart the Tomcat server each time when we modify servlets. Or is there any otherway to achieve the functionalitly?
    Thanks and Regards,
    JG

    JamesGeorge wrote:
    Hi kajbj,
    Java guys are mostly using TOMCAT,so for me it seems to be the best place.That's not correct. Most people who are writing stuff for the web might be using Tomcat, but there are lots and lots of Java applications that aren't for the web.
    Is there any other reason behind your question.Yes, this forum is named "New to Java" and Tomcat questions shouldn't be asked here, even if people knows the answer to you question. You will probably get better and more detailed answers in a Tomcat forum. All othe guys there are actually using Tomcat, and they know the small differences between the different versions, and how they behave on different operating systems. They do also know if you need to make configurations changes, and where you should make them.
    So in future, please ask questions in a forum that is specific to the product that you are using.

  • Tomcat server administration and jsp

    hai,
    1)what is the default username and pwd of the tomcat server administration page
    2)How can i set the virtual path in Tomcat server
    3)where i have to save java files
    3)Where i have to store all my .jsp,.html files.
    4)how to call these .jsp files from the browser.
    5)how can i call my java files in my jsp pages.
    Thanks

    in the following site you can get good idea about tomcat and configuration.
    http://www.archive.coreservlets.com/
    Please look at Chapter 1 and click on
    installation and configuration information link

  • How to fecth the contents of a mail from the server by using jsp

    hi
    Can any body tell me how to fetch the contents of mail from the server by using javamail api...please send me code if some one have
    bye.

    hi
    Can any body tell me how to fetch the contents of mail from the server by using javamail api...please send me code if some one have
    bye.

  • Problem encountered  while using jsp tablib in flex

    Hi all,
    We are used jsp tab libs embbed in Flex2.0 and iam using
    jdeveloper .
    .plz help me in this regard
    Getting the error:
    Error(2): java.io.FileNotFoundException :
    D:\jdevstudiobase1013\jdev\mywork\testtaglib\testtaglib\public_html\FlexTagLib
    (The system cannot find the file specified)
    1. Flex.jsp
    <%@ taglib uri="FlexTagLib" prefix="mm" %>
    <mm:mxml>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns="*">
    <mx:Text label="Flex World">
    </mx:Application>
    </mm:mxml>
    2.we copied the jar file into the particular dir
    <app-dir>\WEB-INF\lib\
    flex-bootstrap.jar
    flex-boorstrap-jsp.jar
    AND
    <app-dir>\WEB-INF\flex\jars:
    flex-webtier.jar
    flex-webtier-jsp.jar
    3. we copied the taglib into the web.xml
    The WEB-INF\web.xml contains:
    <taglib>
    <taglib-uri>FlexTagLib</taglib-uri>
    <taglib-location>/WEB-INF/lib/flex-bootstrap-jsp.jar</taglib-location>
    </taglib>
    plz help me very urgent sorry for my poor
    english...................
    thanks..

    Hi!
    Can you tell me how you set the Classpath? I have the same problem but i dont know how to set correctly the path variables.

  • Can I use my 3G iPhone as iTunes server while using the free remote app from another iOS device

    Can I use my 3G iPhone as iTunes server and use the remote app
    with another iOS device

    You should be able to set up numerous IMAP accounts on your iPhone with no problems.
    IMAP will not sync contacts and calendars in your local copy of Outlook.

  • Can i do it without restart the tomcat server?

    Hi, guys
    I need your help. I'm making a chat application using Http Tunneling technique. The ChatClient is an applet, and the ChatServer is a servlet. They communicate through the http tunneling. When i code them at home, it's all work.But when i deployed them, on the web (internet), i encounter a problem. When i try to connect and communicate to the ChatServer, the ChatClient(applet) throw an IOException says that the destination server is not found. After some try at my own machine, i found out that the webserver where i put the ChatServer(servlet) must be restarted first. The problem is that i deployed my Chat Applet on web server (tomcat) that i could not restart (because it's a hosting service). Could any body give me some solution?
    You can see the chat applet through : http://www.webappcabaret.com/sudirman/ChatRedirector.jsp
    Please somebody give me your help

    Why do you feel that restarting Tomcat would make the servlet not give you the very same exception?

  • Error while using jsp scriptlet or expression with JSPDynpage default jsp

    Hi everyone,
    I am getting the following error while trying to use any kind of jsp scriptlet or expression within the default jsp page that is created with JSPDynpage application:
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : Navroz_JSPDynPage_JCo_BAPI_FLCUST.FlightCustJSP
    Component Name : Navroz_JSPDynPage_JCo_BAPI_FLCUST.FlightCustJSP
    Error occurs during the rendering of jsp component.
    Exception id: 08:50_05/10/06_0032_17543050
    See the details for the exception ID in the log file
    For example if I try to use even simple syntax like:
    <% if(true) { %>
    display htmlb tableviewcomponent
    <% } %>
    or
    <hbj:tableView
         id="myTableView"
         model="flightCustomer.model"
         design="ALTERNATING"
         headerVisible="true"
         footerVisible="true"
         fillUpEmptyRows="true"
         navigationMode="BYLINE"
         selectionMode="SINGLESELECT"
         headerText="Flight Customer List"
         onNavigate="Navigate"
         visibleFirstRow="<%=flightCustomer.getVisibleFirstRow()%>"
         visibleRowCount="5"
         rowCount="16"
         width="500 px"
         />
    here also the <%=flightCustomer.getVisibleFirstRow()%> line gives the above mentioned error. If I remove such scriptlets or expression then it works fine.
    What could be the problem. Are jsp scriptlets or expressions incompatible with portal applications?

    hi Navroz,
    check this
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90e8e837-cc15-2a10-8db1-a87e2d29e9c9
    Re: Defining HTMLB tags in jsp file of JspDynPage component
    Re: JSPDynPage does not work in EP6.0
    bit more
    JspDynPage with Client Side Eventing and Database
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b3c1af90-0201-0010-c0ac-c8d802d264f0
    let me know u need any further info
    bvr

  • Invalid server: while using wlan after upgraded to...

    After upgraded to the new firmware (520007). While connect using wlan my phone shows that Invalid server and some times not replying. I goggled my problem and found that most are facing the same problem; is there any solution for it?  Advance thaks.

    Try deleting your wlan settings and key in a new setting after rebooting the phone. It may help...
    blitZkid
    Nokia C7: Running on Nokia Belle
    "If I'm helpful in anyway, a click of appreciation on the star would be nice"

  • Internal Tomcat Error while running JSP

    Hi,
    I was running a jsp page on Sun One Studio and here is what I am getting, any help would really appreciate.
    C:\Sun\AppServer\jdk\jre\bin\java -classpath "C:\Sun\studio5u1_se\jwsdp\bin\bootstrap.jar";"C:\Sun\AppServer\jdk\lib\tools.jar" -Dcatalina.home="C:\Sun\studio5u1_se\jwsdp" -Dcatalina.base="C:\Documents and Settings\sjoy\studio5se_user\jwsdp_base" org.apache.catalina.startup.Bootstrap "start"
    Starting service Tomcat-Netbeans
    Java Web Services Developer Pack/1.0_01-fcs
    Thanks

    Hi,
    Maybe I am missing something but it does not appear your post below includes your error.

  • Brand new iMac i7 restarts for no reason while using FCP

    I have had my iMac i7 for less than a month. I am having the same issue... The computer blanks and restarts with no warning whatsoever.
    This is happening while editing/playing back video in Final Cut Pro 6.0.6. It is a multicam edit – 5 streams of 1280x1080 HD footage. I know this is very taxing on the machine, however, I am monitoring the system stats and it doesn't appear to be redlining.
    Regardless... If it were too taxing on the machine, I could see FCP crashing, but the restart thing is weird. I'm ready to send this thing back to Apple.
    All RAM is factory-installed Apple RAM. No modification have been made. All system and app updates are current.
    If anyone has any suggestions, please let me know!!
    Thanks,
    Matt

    Hi maooley
    Reset the SMC (System Management Controller) > http://support.apple.com/kb/HT3964
    +1. Shut down the computer.+
    +2. Unplug the computer's power cord.+
    +3. Press and hold the power button for 5 seconds.+
    +4. Release the power button.+
    +5. Attach the computers power cable.+
    +6. Press the power button to turn on the computer.+
    Then restart resetting the PRAM > http://support.apple.com/kb/HT1379
    +Restart holding the Command-Option-P-R keys before the gray screen appears and hold the keys down until the computer restarts and you hear the startup sound for the second time.+
    This is also a good time to check for any loose power connections and/or replace an old surge protector.
    Then if *"the computer blanks and restarts with no warning whatsoever"* it is likely a hardware problem and you will need to contact Apple Support. > http://www.apple.com/support/contact/
    Dennis

  • Unable to connect wireless print server while using wireless modem to ISP

    Unable to connect an HP Laserjet 1320 thru the JetDirect ew2400 External Print Server to an imac G5 that uses the 2WIRE352 modem for ISP access thru ATT. Either the ISP is connected and works, or the printer works but no internet access. HP (after 1hr 15 min.) said I need to change/access the "infrastructure" in the OSX. Is that correct? & if so, how do I do this? Do I need to hire Apple Tech Support to do this? How much will that cost. I'm ready to send the Print Server back to HP for a refund.

    I would post your issue in the Printing & Faxing forum area. More chance for some of the gurus like Greg Sahli to respond.

  • Error while using Jsp Beans

    Hi, i just have written my first bean but i'm getting this erro message:
    java.lang.ClassNotFoundException: Unable to load class userinfo.FormBean
    Can somebody pls help me out.
    Thanks in advance
    JBP
    Below are my codes for the bean and my jsp codes
    Bean:
    package userinfo;
    import java.io.*;
    public class FormBean implements Serializable
    private String name;
    private String email;
    public FormBean()
    name = "test";
    email = "test";
    public void setName(String name)
    this.name = name;
    public String getName()
    return name;
    public void setEmail(String email)
    this.email = email;
    public String getEmail()
    return email;
    Jsp Codes:
    <html>
    <head>
    <title>Login</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <jsp:useBean id="formbean" class="userinfo.FormBean"/>
    <jsp:setProperty name="formbean" property="*" />
    <body bgcolor="#FFFFFF" text="#000000">
    <% if (request.getParameter("name")==null
    && request.getParameter("email"==null)
    { %>
    <form name="form1" method="post" action="process.jsp">
    Name:
    <input type="text" name="textfield">
    <br>
    <br>
    Email:
    <input type="text" name="textfield2">
    <br>
    <br>
    <input type="submit" name="Submit" value="Process">
    </form>
    <% } else {%>
    <p>
    <b>you have provided the following info</b>
    <p>
    <b>Name</b>:<jsp:getProperty name="formbean" property="name"/>
    <p>
    <b>Email</b>:<jsp:getProperty name="formbean" property="email"/>
    <p>
    <%}%>
    </body>
    </html>

    Hi!
    I tried ur bean in my program on javawebserver.
    It didn't work.
    gave error:
    java.lang.ClassNotFoundException: Unable to load class userinfo.FormBean
    then I just added
    import java.io.Serializable;
    in ur bean and tried.
    It gave me error:
    D:\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_examples\_jsp\_samples\_Brand__new\_mail1.java:19: '}' expected.
    static char[][] jspxhtml_data = null;
    I think the problem with bean is solved.
    U check for the same.
    check the settings of server and classpath .
    write whether it works,
    bye,
    Samir

  • Topic: error occuring while use jsp

    code:
    Parsing of JSP File '/view.jsp' failed:-------------------------------------------------------------------------------- /view.jsp(18): "mybean" is not a defined bean variable on this pageprobably occurred due to an error in /view.jsp line 18:value="<jsp:getProperty name="mybean" property="firstname"/>"/>
    this is the error i am getting while accesing the view.jsp.
    here below is my view.jsp and mybean.java codes.
    view.jsp
    code:
    <jsp:useBean id="mybean" class="mvc.beans.mybean" scope="request"/ ><html><head><title>MVC View</title></head><body><h2>MVC Architecture View<h2><form method="post" action="myservlet"><table> <tr> <td>     First Name:     </td> <td>     <input type="text"           name="form first name"                    value="<jsp:getProperty name="mybean" property="firstname"/>"/>                                   </td>     </tr>      <tr>     <td>          Last Name:          </td>          <td>          <input type="text"               name="form last name"                    value="<jsp:getProperty name="mybean" property="lastname"/>"/>     </td>     </tr>      <tr>     <td>          E-mail:          </td>          <td>          <input type="text"               name="form mail"                    value="<jsp:getProperty name="mybean" property="email"/>"/>     </td>     </tr>      <tr>     <td>     <input type="submit"          value="submit"/>          <td>     <tr> </table></form></body>      <pre>     <jsp:getProperty name="mybean" property="message"> </pre></html>
    mybean.java
    code:
    package mvc.beans; public class mybean{ private String firstname; private String lastname; private String email;  public String getFirstname()     {       return fixNull(this.firstname);    } public String getLastname()     {      return fixNull(this.lastname);    } public String getEmail()     {       return fixNull(this.email);    } public void setFirstname(String firstname)     {      this.firstname=firstname;     } public void setLastname(String lastname)     {      this.lastname=lastname;     } public void setEmail(String email)     {       this.email=email;    } private String fixNull(String in){        return (in == null) ? "" : in;    }      public String getMessage()     {      return "\nFirst Name:" +  getFirstname() + "\n"              +"Last Name :" +  getLastname()  + "\n"                      +"email     :" +  getEmail()     + "\n";     } };
    please clarrify my error.

    Are u putting the bean in the request scope????

Maybe you are looking for