Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6460471

JDIC. web based email causes UnsupportedOperationException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 6
    • client-libs
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      J2SE 6 beta
      java version "1.5.0_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      =======REGISTRY VALUE==============
      Key Name: HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail
      Class Name: <NO CLASS>
      Last Write Time: 8/4/2006 - 12:28 PM
      Value 0
      Name: <NO NAME>
      Type: REG_SZ
      Data: Yahoo! Mail


      A DESCRIPTION OF THE PROBLEM :
      Has been replicated on J2SE 6 beta by JDIC project lead. He asked me to file a bug report. See
      http://forums.java.net/jive/thread.jspa?threadID=17319&tstart=0

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) When I use a html mailto in a html page, it correctly opens Yahoo Mail as the default mailer.
      In the registry (Win XP), under HKEY_LOCAL_MACHINE\\SOFTWARE\\Clients\\Mail,
      Yahoo Mail is listed.

      2) I am trying the example from here, but get an exception:

      https://jdic.dev.java.net/documentation/Examples.html
      =======================================================
      Case# 6: Launch the system default mailer and send the constructed message with UI or without UI.

      import java.util.List;
      import java.util.ArrayList;
      import org.jdesktop.jdic.desktop.Desktop;
      import org.jdesktop.jdic.desktop.DesktopException;
      import org.jdesktop.jdic.desktop.Message;

      public class MailTest {
      public static void main(String[] args) {
      Message msg = new Message();

      List toList = new ArrayList();
      toList.add("###@###.###");
      msg.setToList(toList);

      List ccList = new ArrayList();
      ccList.add("###@###.###");
      ccList.add("###@###.###");
      msg.setCcList(ccList);

      msg.setSubject("Hello");
      msg.setBody("Test");

      List attachList = new ArrayList();
      attachList.add("C:\\test\\test.txt");
      msg.setAttachmentList(attachList);

      try {
      // Send mail in UI mode.
      Desktop.mail(msg);
      } catch (DesktopException e) {
      e.printStackTrace();
      }
      }
      }



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expected it to correctly open Yahoo Mail as the default mailer.

      ACTUAL -
      =====================================================
      Exception in thread "main" java.lang.UnsupportedOperationException: Current system default mailer is not supported.
      at org.jdesktop.jdic.desktop.internal.impl.ServiceManagerStub.getService(Unknown Source)
      at org.jdesktop.jdic.desktop.internal.ServiceManager.getService(Unknown Source)
      at org.jdesktop.jdic.desktop.Desktop.mail(Unknown Source)
      at MailTest.main(MailTest.java:30)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      import java.util.List;
      import java.util.ArrayList;
      import org.jdesktop.jdic.desktop.Desktop;
      import org.jdesktop.jdic.desktop.DesktopException;
      import org.jdesktop.jdic.desktop.Message;

      public class MailTest {
      public static void main(String[] args) {
      Message msg = new Message();

      List toList = new ArrayList();
      toList.add("###@###.###");
      msg.setToList(toList);

      List ccList = new ArrayList();
      ccList.add("###@###.###");
      ccList.add("###@###.###");
      msg.setCcList(ccList);

      msg.setSubject("Hello");
      msg.setBody("Test");

      List attachList = new ArrayList();
      attachList.add("C:\\test\\test.txt");
      msg.setAttachmentList(attachList);

      try {
      // Send mail in UI mode.
      Desktop.mail(msg);
      } catch (DesktopException e) {
      e.printStackTrace();
      }
      }
      }


      ---------- END SOURCE ----------

            denis Denis Fokin (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: