commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Melnikov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (EMAIL-128) HtmlEmail doesn't close connection to smtp server
Date Sun, 21 Jul 2013 18:24:48 GMT

    [ https://issues.apache.org/jira/browse/EMAIL-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13714764#comment-13714764
] 

Ivan Melnikov commented on EMAIL-128:
-------------------------------------

I have this kind of thing in my .meta log file

-----------------log file exception-------------------------

!ENTRY org.eclipse.core.resources 4 1 2013-07-20 04:59:12.609
!MESSAGE Core exception while retrieving the content description
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file
system: '/send-form-1.0/war/WEB-INF/deploy/com.myproject.send.form.SendForm/rpcPolicyManifest/manifests/0C94E687013CDDF67C90273A6230CE51.txt'.
	at org.eclipse.core.internal.resources.File.getContentDescription(File.java:269)
	at org.eclipse.core.internal.propertytester.FilePropertyTester.testContentType(FilePropertyTester.java:108)
	at org.eclipse.core.internal.propertytester.FilePropertyTester.test(FilePropertyTester.java:60)
	at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
	at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
	at org.eclipse.core.internal.expressions.AndExpression.evaluate(AndExpression.java:29)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateOr(CompositeExpression.java:68)
	at org.eclipse.core.internal.expressions.OrExpression.evaluate(OrExpression.java:21)
	at org.eclipse.ui.internal.navigator.NavigatorPlugin$Evaluator.run(NavigatorPlugin.java:245)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.navigator.CustomAndExpression.evaluate(CustomAndExpression.java:71)
	at org.eclipse.ui.internal.navigator.NavigatorPlugin$Evaluator.run(NavigatorPlugin.java:245)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.navigator.NavigatorPlugin.safeEvaluate(NavigatorPlugin.java:260)
	at org.eclipse.ui.internal.navigator.extensions.NavigatorContentDescriptor.isTriggerPoint(NavigatorContentDescriptor.java:426)
	at org.eclipse.ui.internal.navigator.extensions.NavigatorContentDescriptorManager.findDescriptors(NavigatorContentDescriptorManager.java:234)
	at org.eclipse.ui.internal.navigator.extensions.NavigatorContentDescriptorManager.findDescriptorsForTriggerPoint(NavigatorContentDescriptorManager.java:185)
	at org.eclipse.ui.internal.navigator.NavigatorContentService.findDescriptorsByTriggerPoint(NavigatorContentService.java:805)
	at org.eclipse.ui.internal.navigator.NavigatorContentService.findContentExtensionsByTriggerPoint(NavigatorContentService.java:654)
	at org.eclipse.ui.internal.navigator.NavigatorContentService.findContentExtensionsByTriggerPoint(NavigatorContentService.java:635)
	at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.hasChildren(NavigatorContentServiceContentProvider.java:377)
	at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.hasChildren(NavigatorContentServiceContentProvider.java:422)
	at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2123)
	at org.eclipse.jface.viewers.TreeViewer.isExpandable(TreeViewer.java:588)
	at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2153)
	at org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(AbstractTreeViewer.java:2835)
	at org.eclipse.jface.viewers.TreeViewer.updatePlus(TreeViewer.java:852)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:834)
	at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:808)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:782)
	at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:644)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:753)
	at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:1485)
	at org.eclipse.jface.viewers.TreeViewer.handleTreeExpand(TreeViewer.java:952)
	at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:1496)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:132)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:7538)
	at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5534)
	at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1896)
	at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:5086)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4584)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2424)
	at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1533)
	at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:6411)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4564)
	at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5937)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2530)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
!SUBENTRY 1 org.eclipse.core.resources 4 274 2013-07-20 04:59:12.609
!MESSAGE Resource is out of sync with the file system: '/send-form-1.0/war/WEB-INF/deploy/com.myproject.send.form.SendForm/rpcPolicyManifest/manifests/0C94E687013CDDF67C90273A6230CE51.txt'.

-----------------------

I am not pretty sure what exactly should I look for... I tried to extract exception concerning
the SendForm projects. Please lead me if you need some more information
                
> HtmlEmail doesn't close connection to smtp server
> -------------------------------------------------
>
>                 Key: EMAIL-128
>                 URL: https://issues.apache.org/jira/browse/EMAIL-128
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: Ivan Melnikov
>            Priority: Blocker
>
> ***Prehistory:
> I tried to send html email to smtp server from my GWT application servlet by using this
official site user guide example http://commons.apache.org/proper/commons-email/userguide.html
the "HtmlEmail" usage snippet...
> Sending message with smtp requires authentication and encryption so I combined two examples
and used code like a (see my snippets)
> snippet A : 
> ------------------------------------
> public class Send{
> public synchronized SendReport send(MyMessage msg){
> ...
> // Create the email message
> 		  HtmlEmail email = new HtmlEmail();
> 		  
> 		  
> 		  try {
> 			  
> 			  
> email.setHostName("smtp.mail.com");
> 			  email.setSmtpPort(465);
> 			  email.setAuthenticator(new DefaultAuthenticator(USER_NAME,PASSWORD));
> 			  email.setSSLOnConnect(true);			  
> 			  
> 			  email.addTo(TO, "test");
> 			  
> 			  email.setFrom(FROM, msg.getFrom());
> 			  email.setSubject(msg.getSubject());			  
> 			  		  
> 			  String message=msg.getMessage();
> 			  
> 			  email.setHtmlMsg(message);
> 			   email.setTextMsg("Your email client does not support HTML messages");
> 			   email.send();			  
> 			  
> 			  
> 		} catch (EmailException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 			
> 			
> 		}
> }//method end...
> }//class end...
> ------------------------------------
> snippet B: the gwt/rpc servlet 	
> public class SendServiceImpl extends RemoteServiceServlet implements SendService {
> 	static Send send=new Send();
> 	
> 	@Override
> 	public SentReport sendMessage(MyMessage message) {
> 				
> 		return this.getMessageSend().sendMessage(message);
> 	}
> 	
> 	private synchronized Send getSend()
> 	{
> 		return this.send;
> 	}
> }
> ------------------------------------
> ***Problem description:
> Message sending works fine and I can see email in my inbox; The problem occurs when I
stop Tomcat and close the web application browser tab (FF for example); for some reason right
after that my web browser (FireFox) cannot download web pages (throws connection timeout error...)
though Internet connection is working fine :S I tried to download web pages with another internet
browser Chrome for example but it behaves all the same :( I tried to see opened ports with
"netstat -an" cmd and it shows me a long list of opened ports (which I don't have until send
email code as "email.send();" activated...); That makes me think that for some reason the
JavaMail connection to smtp server is NOT CLOSED or something similar?
> The problem disappears only after I restart my OS (Windows XP Pro SP3);  
> So I suspect some bug which prevents smtp server connection closing after message send;
I cannot say for sure but maybe socket connection doesn't close after message has been sent
and received... I am not sure what should I add to my code to solve the problem because I
followed all user guide examples which don't show how to close smtp server connection manually
or something so I am a confused how to fix it :( Maybe it is some kind of memory leak due
to JavaMail I don't know...
> I dearly need your help because it is quite complicated issue as for me that makes impossible
to use HtmlEmail class in my gwt application (its server side code)
> ***My project uses
> - IDE : Eclipse Indigo 3.7
> - GWT SDK 2.3
> - JavaMail API 1.4.5
> - commons-email-1.3.1
> - Tomcat 7/ Jetty - in eclipse
> - JRE: version 7 Update 25 build 1.7.0_25-b17
> - OS: Windows XP Pro SP3

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message