Tomcat application undeploy problem

Hi all,
I have a problem using JavaMail in a web application using Tomcat 5.5.9 under Windows XP SP2. I can correctly send mails, both with and without attachments, but when I try to undeploy the app the mail.jar library remains "occupied" and Tomcat is unable to delete the app folder and undeploy it cleanly. The result is that I can't deploy new versions of the app until I stop the web server, delete the folder manually, and restart the server.
The library is located in the WEB-INF/lib folder of the application (togheter with the activation.jar library).
Doing some tests I noticed the problem is when I call the saveChanges() on a MimeMessage object, but only when I call the setText() method or the setContent() method adding a Multipart content to the message. If I only set recipients, subject and from field of the MimeMessage all goes well. I also tried to call the writeTo() method and save the message to a file instead of sending it, but the behaviour is the same.
Here is the piece of code I use to send e-mails...if anyone has any suggestion or solution it is very appreciated :) Thanks for any help!
Properties props = System.getProperties();
props.put("mail.smtp.host", smtp);
if(smtpAuth) props.put("mail.smtp.auth","true");
Session session;
Authenticator pwdAuth = null;
if(smtpAuth)
     pwdAuth = new SMTPAuthenticator(user,pwd);
session = Session.getInstance(props, pwdAuth);               
Address[] rec = new Address[recipients.size()];
int i = 0;
for(Iterator it = recipients.iterator();it.hasNext();) {
     String d = (String)it.next();
     try {
          rec[i++] = new InternetAddress(d);                         
     } catch(AddressException e) {
try {
     Transport tran = session.getTransport("smtp");
     if(smtpAuth)
          tran.connect(smtp,user,pwd);
     else
          tran.connect();
     MimeMessage message = new MimeMessage(session);
     String mitt = this.emailAddress;
     if(nick!=null)
          message.setFrom(new InternetAddress(sender,nick));
     else
          message.setFrom(new InternetAddress(sender,senderAddress));
     message.addRecipients(MimeMessage.RecipientType.TO,dest);
     message.addHeader("X-Mailer","RT E-Mailer");
     message.addHeader("X-Priority",priority);
     message.setSubject(subject);
     if(attach == null) {
          message.setText(text);
     } else {
          Multipart multipart = new MimeMultipart();
          MimeBodyPart messageBodyPart = new MimeBodyPart();
          messageBodyPart.setText(text);
          multipart.addBodyPart(messageBodyPart);
          for(int j = 0; j < attach.length; j++) {
               Attachment a = attach[j];
               messageBodyPart = new MimeBodyPart();
               DataSource source = new FileDataSource(a.getFilename());
               messageBodyPart.setDataHandler(new DataHandler(source));
               messageBodyPart.setFileName(new File(a.getFilename()).getName());
               multipart.addBodyPart(messageBodyPart);
          message.setContent(multipart);
     message.saveChanges();
     tran.sendMessage(message,dest);
     tran.close();
     ret = true;
} catch(SendFailedException e) {
     ret = false;
} catch (Exception e) {
     ret = false;
}

Hi,
I have also the same problem. please help me if you find any way to resolve this issue.
Thanks,
Prasad.N

Similar Messages

  • Calling external programs from within a Tomcat application

    I've got a fairly complex existing Tomcat application (which is packaged and built as a .war file) which I'm trying to edit so that it calls a Perl script part way through the processing, which will generate an XML file used later on. I think I've worked out how to call external scripts from within Java, but at the moment when I try and access the application via Tomcat the application either hangs or bails out (I don't know which, as the log files unhelpfully don't give any error messages).
    The code which is causing the problem looks like this:
    System.err.println("Calling runtime...");
    Runtime runtime = Runtime.getRuntime();
    System.err.println("Executing process...");
    Process process = runtime.exec("/path/to/ysearch.pl 'News' '\"search query\"' 'file");
    System.err.println("Waiting for process...");
    int exitVal = process.waitFor();
    System.out.println("Exited with error code: " + exitVal);The code gets as far as "Executing process..", beyond that there is nothing in the log file so I presume the runtime.exec() call is where the problem is. I'm not interested in reading the output from the script (there shouldn't be any), so that's not an issue, and the permissions on it allow anyone to read or execute ysearch.pl so I don't think there's a problem in that area.
    Does anyone have any suggestions which I could try to get this to work? I've only been using Tomcat for a week (I'm picking up on someone else's code) so I might have made a beginner's mistake. I'm using Tomcat 5 on Fedora Core 7, and Java 1.5.0_01 (I can't easily change any of those).

    I'm not sure, but I thing that overhead caused by calling du cannot be big enough to matter even on older machines.
    But, when calling du from Perl script you are also invoking shell, and this can be a little bit more 'heavy'.

  • Tomcat application creates new session on page reload

    We have a tomcat application which works fine in IE7/8 and Firefox. The only browser we are having issues with (that we care about at this point) is google Chrome. Users can navigate to the application fine and log in and do whatever they need to do in Firefox and IE. However, when trying to log in with Chrome, the session is apparently lost immediately after log in and when the authenticated user tries to navigate to another page they are bumped back to the log in page. This happens consistently.
    I have seen other entries here and elsewhere that suggest that the context path might be to blame. I have tried setting a ProxyReverseCookiePath but that does not fix the problem.
    Our virtual host configuration is as follows:
    <VirtualHost xxx.xxx.xxx.xxx:80>
        ServerAdmin [email protected]
        ServerName subdomain.example.com
        DocumentRoot /var/www
        ProxyRequests Off
        <Proxy *>
            Order deny,allow
            Allow from all
        </Proxy>
        ProxyPass /context/ ajp://127.0.0.1:8009/context/
        ProxyPass / ajp://127.0.0.1:8009/context/
        #ProxyPassReverse /context/ http://127.0.0.1:8009/context/
        #ProxyPassReverse / http://127.0.0.1:8009/context/
        #ProxyPassReverseCookiePath /context/ /
    </VirtualHost>There is another application deployed on the same instance of tomcat at the ROOT context. I have looked at the JSESSIONID that is set in the cookie, which is sent back to Chrome and it changes on every request, while it does not for IE and Firefox.
    I am at a loss here. Any ideas are welcome!

    We have a tomcat application which works fine in IE7/8 and Firefox. The only browser we are having issues with (that we care about at this point) is google Chrome. Users can navigate to the application fine and log in and do whatever they need to do in Firefox and IE. However, when trying to log in with Chrome, the session is apparently lost immediately after log in and when the authenticated user tries to navigate to another page they are bumped back to the log in page. This happens consistently.
    I have seen other entries here and elsewhere that suggest that the context path might be to blame. I have tried setting a ProxyReverseCookiePath but that does not fix the problem.
    Our virtual host configuration is as follows:
    <VirtualHost xxx.xxx.xxx.xxx:80>
        ServerAdmin [email protected]
        ServerName subdomain.example.com
        DocumentRoot /var/www
        ProxyRequests Off
        <Proxy *>
            Order deny,allow
            Allow from all
        </Proxy>
        ProxyPass /context/ ajp://127.0.0.1:8009/context/
        ProxyPass / ajp://127.0.0.1:8009/context/
        #ProxyPassReverse /context/ http://127.0.0.1:8009/context/
        #ProxyPassReverse / http://127.0.0.1:8009/context/
        #ProxyPassReverseCookiePath /context/ /
    </VirtualHost>There is another application deployed on the same instance of tomcat at the ROOT context. I have looked at the JSESSIONID that is set in the cookie, which is sent back to Chrome and it changes on every request, while it does not for IE and Firefox.
    I am at a loss here. Any ideas are welcome!

  • Application Builder problem on one server but not another

    I am having an Application Builder problem. When I get into App Express and go inside the builder and try to edit a listed application, I get an “http 404 the page cannot be found. The page might have had its name changed or is temporarily unavailable” situation. I can get into SQL commands, utilities, and administrative activities. I can also run the application. Also, if I go onto a different server with App Express on it, I can get into the builder and edit applications with no trouble. Our DBA had the server in question rebooted a little over a week ago and that took care of the problem for a couple days. Any ideas? Is this an Express problem or a server problem? He had also tried restarting Express before he had the reboot done and that didn’t help.
    Thank you for any help.
    Cordially,
    Robert J. Smith

    I have messages from the Apache error log files from the dates I was getting the builder error. For future reference, I will post them below. The builder has been working fine lately.
    Robert Smith
    ** error log messages follow **
    [Mon Jul 16 07:25:12 2007] [error] [client 147.159.5.134] [ecid: 
    79143788610,1] File does not exist:
    /app/oracle/oraappsrv10g/forms/java/java/awt/KeyboardFocusManager.class
    [Mon Jul 16 07:25:12 2007] [error] [client 147.159.5.134] [ecid: 
    79143788611,1] File does not exist:
    /app/oracle/oraappsrv10g/forms/java/java/awt/event/MouseWheelListener.class
    [Mon Jul 16 07:25:13 2007] [error] [client 147.159.5.134] [ecid: 
    83438757083,1] File does not exist:
    /app/oracle/oraappsrv10g/forms/java/oracle/forms/registry/default.dat

  • ASP application has problems working with oracle database 8.1.7

    ASP application has problems working with oracle database 8.1.7 through both oracle ODBC driver and Microsoft ODBC driver
    We have an ASP application running on Windows 2000 server, and with 8.1.7 Net8Client and MDAC 2.6 SP1.
    The application worked fine with an Oracle 8.0.5 database.
    After upgrading oracle database to 8.1.7.0.0, our ASP application works fine except when updating the same data record more than once. The application is not saving our updates.
    We tested our application using Oracles ODBC driver v8.1.7.5.0
    and experienced more problems. We had problems just bring up our data entry pages. In either case, we are returned with some 505 errors in our browser, problems with the ASP pages and IIS, the page is not displaying.
    If anyone has some suggestions on how to fix my problem, please advise. Thanks in advance.

    thanks...i saw one article with this approach..but the document did not present the detailed process...do you have one? i am still searching for a good procedure to follow...since it is an old database and focusing/studying old versions like this is a pain in the a**... :(

  • TOMCAT Application does not start

    HI Guys,
    I have installed BOE 3.1 .
    Somehow TOMCAT application is not running.
    Can anyone tell me what could be the reason?
    Regards

    Hi,
    check the supported platforms Guide for BOE XI 3.1 SP2 on Windows here:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/402db6eb-845d-2c10-a38c-aafde85ec769?quicklink=index&overridelayout=true
    Please use a supported Server OS for your testings ad see it four error still exist on it.
    Regards
    -Seb.

  • Application Language Problem

    Hello,
    I am writing From Turkey. I have an iphone 5s and i believe i am the one of first iphone 5s buyer in Turkey.
    I had a problem and i called apple and nobody solved my problem. I tunes help desk or whatever thay said that problem is not their problem its applications developers problem...
    I am explaining my problem :
    I downloaded Skype, ICQ ,Air Wings, Shazam , And some of other applications but its koming with japanese language. I change my prefered language to Turkish and my location is also choosen Turkey. But I have still the same problem.
    I tunes help desk gave me these link below to solve my problem.
    If Apple keep telling me that this is not their problem i am going to change my iphone and my all families phone to another brand...
    ICQ – Free Calls and Messages support url is http://www.icq.com/support/
    Air Wings® support url is http://www.pangeasoft.net/support.html
    Shazam Version 15244739; support url is http://www.shazam.com/music/web/faqs.html?
    When i seach from google this problem happens to other people...

    Hi
    I am not sure but it may be fixed from the portal during WebDynpro ABAP iView creation. Please contact your portal admin for this.
    Thanks
    Vishal kapoor

  • Adobe Story free application install problem

    I have been using Adobe Story Free version for a year but with the most recent automatic update (Dec 2012) the desktop application will not open. Upon clicking the icon for Adobe Story it attempts to take an update but stops with the following message:
    " Sorry, an error has occurred. This application cannot be installed because this installer has been mis-configured. Please contact the application author for assistance."
    Does anyone know how to fix this?

    Sandeep,  Thank you! Adobe Story is okay now.
    Date: Sat, 29 Dec 2012 10:58:48 -0700
    From: [email protected]
    To: [email protected]
    Subject: Adobe Story free application install problem
        Re: Adobe Story free application install problem
        created by [email protected] in Adobe Story - View the full discussion
    Hi, Please uninstall the current Adobe story application and then install latest from https://story.adobe.com/AIR/AdobeStory.air . That should fix it. Thanks,Sandeep
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4953552#4953552
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4953552#4953552
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4953552#4953552. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Story by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • When are you going to fix your 12_0_0_77.exe Application Error problem?

    When are you going to fix your 12_0_0_77.exe Application Error problem?

    What error specifically?
    What OS amd what browser?

  • Preview Application Resizing Problem

    Preview Application Resizing Problem
    Microsoft platforms have two significant advantages. The first is the concept of an operating system that can function with hardware that ranges from cellular phones to desktop computers. The second is that Microsoft has excellent software development tools
    for creating and testing computer programs.
    Software compatibility across hardware platforms requires not only meeting CPU and memory requirements. Application programs must be able to automatically adjust Window and control sizes to meet the needs of available window sizes, video display unit sizes
    and screen resolutions, switching between vertical and horizontal viewing, vertical and horizontal scrolling, changes in font sizes , and variations in the available screen space due to usage of vertical and horizontal toolbars.
     Software developers must be careful that resizing doesn’t squeeze controls too close together or make them so small that they cannot be finger or stylus selected when used with touch screens.
    Some of the required automatic resizing options are provided by the Microsoft software compilers and the Windows operating system.  Softgroup Component’s “.NET  Forms Resize” is an example of one of the third party applications that provide advanced
    resizing functionality.
    Many of the resizing functions are programmer options and, if not properly enabled, an application may not have the required resizing functionality. At the current state of the art, application programs are highly variable in their capability to do the “intelligent
    resizing” that is required to handle different display environments.
    A case in point is the Microsoft Preview Application for Windows 10. When entering lengthy comments, the send button becomes positioned off the end of the program window. It is possible to scroll to the button, but the display automatically resets when scroll
    is released. The result is that the text cannot be sent. You can try a "blind" TAB to the SEND button. This appeared to work after several tries, but the comment was apparently not received,
    RERThird

    Hi,
    What do you see when you open the same PDF file in Acrobat Reader? Are the words still squeezed than?
    Dimaxum

  • Hello everyone I have a problem with the app store as secret questions asks me to download the application, the problem is that I do not remember the answers as I do?? thank you very much to all

    Hello everyone I have a problem with the app store as secret questions asks me to download the application, the problem is that I do not remember the answers as I do?? thank you very much to all

    Hello andreabn90
    If you can't remember your security questions go to  Express Lane.
    select iTunes from the list, then iTunes store.        On the next screen select account Management.          There, select iTunes store account security and write that you would like to reset your security questions and / or answers.
    You should get an eMail reply over the next 24 hours.

  • How to know reason for Application down problem?

    sometimes, Application down problem occurred Live System.
    Recently, Two generated during about 2 month.
    problem have something in common.
    it's to discover problem When Monday moning.
    I want to find out execute program list.
    example) concurrent, schedule job, access user action, query by FORM
    I guess because called execute program when Friday, Saturday, Sunday.
    How to find out reason?
    And, What's Applicatin down Reason case study mothod?
    I can not access Matalink becouse a maintenance contract ended.
    I am man of ripe experience as programmer.
    However, I have little experience experience system admin.
    Help me!
    Message was edited by:
    user638293

    Hai user638293 ,
    There are so many experts in this forum who will be very happy to help u unless and until u've made your question clear.. think that is the reason u didnt get any reply yet..
    AFAIU, your application system is goin down frequently.. twice during 2 months.. rite ?..
    can u please make your question clear ?
    Kai

  • Application List problems - will Nokia ever addres...

    The empty Application List problem on the Nokia Go To select options list is well known.
    My new 5610 takes this a step further. When you try to select Applications List when choosing Go To options, the machine just hangs.
    Has anyone else experienced this? I guess the phone's a bit new for a s/w upgrade...
    Max

    Please, dial *#0010# to determine which firmware version do you have.
    Furthermore, what is the name of that theme you are using because that is non-standard, isn’t it?

  • Can't print under Tomcat but no problem under sun application server 8!

    Hi,
    I am rather puzzle by the fact that a programme written by me using all the print api and printable implementation when being called by the JSF page is capable of being successfullly print out when being deployed under sun application server 8 but got hang or met with no response when the same war file generated by the JSC 2 is being deployed onto Tomcat 5.17 .
    Was it due to some missing jar file or api , I really have no idea at all
    Any suggestion please ?
    Thank

    Hi,
    I got rather stupid question to ask regarding the font size.
    if I got a font size of 10, I know it is only refering to the height in pixel , my problem start when I need to know , how many characters can I print across in a A4 size paper. The pixel point is 1/72 of an inch, it is vertical .
    Is there any formula that I can use to determine how many characters per inch that particular font is supposed to print?
    Suggestion that I received is to use trial and error method.
    Thank

  • Memory leak on application undeploy.

    We're creating a Spring-based web app that is using a Tomcat 7.0.33 managed Oracle database pool. We're using the ojdbc6.jar to connect (Oracle 10g but migrating to 11g later).
    When our application is undeployed in Tomcat we get probable memory leak warnings (see below). After several re-deploys we inevitably run out of PermGen space. I've tried using the ojdbc14 drivers and they didn't seem to have this problem. But we're moving to 11g so we can't use them. I have tried adding a ContextListener that closes the DBCP pool on destroy but that didn't help any. Is this a bug in the Oracle drivers? Is there any way we can mitigate this?
    17505 INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'myManager'
    17515 INFO org.apache.tiles.access.TilesAccess - Removing TilesContext for context: org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory$SpringWildcardServletTilesApplicationContext
    Dec 06, 2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
    SEVERE: The web application [myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1468544]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    Dec 06, 2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
    SEVERE: The web application [myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@d73b31]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    Dec 06, 2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
    SEVERE: The web application [myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@13aae39]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    Dec 06, 2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
    SEVERE: The web application [myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@18443b1]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    Dec 06, 2012 6:41:34 PM org.apache.catalina.startup.HostConfig deleteRedeployResources
    INFO: Undeploying context [myApp]

    Nevermind - It figures just after I post this I find the solution. And naturally it's not a bug in the ojdbc6.jar drivers. :-)
    It turns out our application was also including ojdbc6.jar in WEB-INF/lib. This caused Tomcat to use our jar for connections and thus the leak was formed. So not deploying ojdbc6.jar with our application (marking it as "provided" in pom.xml) lets Tomcat manage the connections and clean-up our app.

Maybe you are looking for

  • How do I get more tagged/bookmarked results to show up in awesome bar? Currently it will only show 4.

    When I type a word into the address/url/awesome bar that is a word I know I have used as a tag on several bookmarked pages, only 4 of the results in the drop down are bookmarked pages. The rest of the pages in the drop down are other pages suggested

  • Using Preview to cycle through a folder of images/photos

    While on Tiger, I used a program called JustLooking to replace Preview, because I wanted an app that would allow me to easily click through all my photos and images just using the keyboard arrow keys. (I did not have to select all files first, just d

  • Can objects be passed between JSPs?

    I want to do this: I have a set of 4 interfaces that I use to populate data in 4 tables. But the thing is, I need to populate the data only at the end of the 4th interface, when the user clicks on the "Finish" button. Is it possible to construct an O

  • What does Order By -1 mean?

    Hi Can anyone tell me what does and Order By clause with -1 mean...it's pretty confusing to me, never seen before? Thanks Rashed

  • Idx1 transaction

    Hi IDX1 transaction is used to Create the port to get Idoc Metadata from Sender System ( The Port Name must match the port name in the idoc header - Usually in format SAP<System ID>. eg. SAPID1. Could you please tell me all IDOC headers will contain