Missing javax.mail

Hello everyone,
when I start a new project in Jdeveloper11, the package mail in Javax is missing. In an older project, which was created in Jdeveloper 10, then migrated to Jdeveloper11, javax.mail is availible. How can I rech the package in my new application too?
thx
Jens

I guess you have to download the java mail jar from here and add it to your libraries.
Timo

Similar Messages

  • Javax.mail.MessagingException: Missing start boundary

    I use the following code creates a Mime file
    MimeMultipart mmp = new MimeMultipart();
                   MimeBodyPart mbp = null;
                   // add rootpart
                   mbp = new MimeBodyPart();
                   mbp.setContentID("[email protected]");
                   mbp.setDataHandler(new DataHandler(new FileDataSource(args[0])));
                   mmp.addBodyPart(mbp);
                   // add attachment info
                   for(int i = 1; i < args.length; i = i+2){
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
                        GZIPOutputStream gos = new GZIPOutputStream(baos);
                        FileInputStream fis = new FileInputStream(args[i+1]);
                        byte[] bytes = new byte[1024];
                        int len;
                        while((len = fis.read(bytes, 0, 1024)) > 0){
                             gos.write(bytes, 0, len);
                        fis.close();
                        gos.close();
                        baos.close();
                        InternetHeaders ih = new InternetHeaders();
                        ih.addHeader("Content-ID", args);
                        mbp = new MimeBodyPart(ih, baos.toByteArray());
                        mmp.addBodyPart(mbp);
                   String CarriageReturn = String.valueOf(CARRIAGE_RETURN);
                   String lineFeed = String.valueOf(LINE_FEED);
                   String horizontaltab = String.valueOf(HORIZONTAL_TAB);
                   FileOutputStream fos = new FileOutputStream(args[0] + ".mime");
                   StringBuffer msgParam = new StringBuffer();
                   msgParam.append("MIME-Version: 1.0");
                   msgParam.append(CarriageReturn);
                   msgParam.append(lineFeed);
                   msgParam.append("Content-Type: ");
                   msgParam.append(mmp.getContentType().replaceAll(CarriageReturn,"").replaceAll(lineFeed,"").replaceAll(horizontaltab,""));
                   msgParam.append("; start=\"<[email protected]>\"");
                   msgParam.append(CarriageReturn);
                   msgParam.append(lineFeed);
                   msgParam.append(CarriageReturn);
                   msgParam.append(lineFeed);
                   msgParam.append(CarriageReturn);
                   msgParam.append(lineFeed);
                   fos.write(msgParam.toString().getBytes());
                   mmp.writeTo(fos);
                   fos.close();
    I can correctly read the mime file at windows OS,but in linux OS i got the following error Message:
    2010/11/19 11:53:40     K101J2EED1     fatal     0041EBFC124735B5B67FFA9F4B3B09961KD1     例外=[javax.mail.MessagingException: Missing start boundary]     
    sun.reflect.GeneratedMethodAccessor303.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    $Proxy28.execute(Unknown Source)
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    jp.terasoluna.fw.web.struts.action.RequestProcessorEx.process(RequestProcessorEx.java:149)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:675)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:324)
    jp.co.nttdata.erc.sys.app.extended.ExtendedFilter.doFilter(ExtendedFilter.java:163)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:424)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:324)
    jp.co.nttdata.erc.sys.app.extended.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:174)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:424)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:324)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:379)
    com.hitachi.software.web.catalina.core.ValveWrapper.invokeNext(LinkedPipeline.java:672)
    com.hitachi.software.web.catalina.core.LinkedPipeline.invoke(LinkedPipeline.java:475)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:983)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:349)
    com.hitachi.software.web.catalina.core.ValveWrapper.invokeNext(LinkedPipeline.java:672)
    com.hitachi.software.web.tcg.ThreadControlGroupValve.invoke(ThreadControlGroupValve.java:82)
    com.hitachi.software.web.catalina.core.ValveWrapper.invokeNext(LinkedPipeline.java:672)
    com.hitachi.software.ejb.management.mbean.web.RequestStatisticsValve.invoke(RequestStatisticsValve.java:72)
    com.hitachi.software.web.catalina.core.ValveWrapper.invokeNext(LinkedPipeline.java:672)
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:188)
    com.hitachi.software.web.catalina.core.ValveWrapper.invokeNext(LinkedPipeline.java:672)
    com.hitachi.software.web.catalina.core.StandardSessionValve.invoke(StandardSessionValve.java:96)
    com.hitachi.software.web.catalina.core.ValveWrapper.invokeNext(LinkedPipeline.java:672)
    com.hitachi.software.web.catalina.core.LinkedPipeline.invoke(LinkedPipeline.java:475)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:983)
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:3928)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:261)
    com.hitachi.software.web.catalina.core.ValveWrapper.invokeNext(LinkedPipeline.java:672)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:197)
    com.hitachi.software.web.catalina.core.ValveWrapper.invokeNext(LinkedPipeline.java:672)
    com.hitachi.software.web.catalina.core.LinkedPipeline.invoke(LinkedPipeline.java:475)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:983)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    com.hitachi.software.web.catalina.core.ValveWrapper.invokeNext(LinkedPipeline.java:672)
    com.hitachi.software.web.catalina.core.LinkedPipeline.invoke(LinkedPipeline.java:475)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:983)
    org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:700)
    org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:959)
    java.lang.Thread.run(Thread.java:620)
    Edited by: chengen on Nov 24, 2010 8:26 PM
    Edited by: chengen on Nov 24, 2010 9:25 PM

    I can correctly read the mime file at windows OS,but in linux OS i got the following error Message:That would suggest one or more of the following.
    1. An end of line problem. Something is wrong with your use of CR/LF.
    2. A line length problem (brief look suggests a 998 limit.)
    3. One reader is more lenient than the other. This goes back to 1 and 2.

  • Problems sending email using javax.mail.*

    I need to send an email from an application I am working on. I am using the features of the javax.mail package to do so. In looking at the code I am unsure why this is not working. This is my first time using this package so it might be something silly I am missing so any of your thoughts are appreciated. The code is as follows:
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class EmailTester {
         public static void main(String[] args) {
              try {
                   //Set the smtp address
                   Properties props = new Properties();
                   props.put("mail.smtp.host", args[0] );
                   // get the default Session
                   Session session = Session.getDefaultInstance(props, null);
                   session.setDebug(true);
                   // create a message for this session
                   Message msg = new MimeMessage(session);
                   // set the from and to address
                   InternetAddress from =
                        new InternetAddress( args[1] );
                   InternetAddress[] to = new InternetAddress[1];
                   to[0] = new InternetAddress( args[2] );
                   msg.setFrom(from);
                   msg.setRecipients(Message.RecipientType.TO, to);
                   // set the subject and content type
                   msg.setSubject("subject");
                   msg.setContent("this is my test email", "text/plain");
                   // send the email
                   Transport.send(msg);
              catch (MessagingException me) {

    I have an EMail class that I use at:
    http://www.discoverteenergy.com/files/EMail.java
    Feel free to use it or compare against your code to see what is different.

  • Problem with recognizing javax.mail.* class ?

    Hi Folks,
    I am new to JavaMail usage on a standalone java program. I did write a java program to send a mail. The problem is it is not recognizing the javax.mail.* class, though i added on the classpath. I too added mail.jar file in the c:\program files\java\jdk1.5.0_16\lib and added the reference same to the classpath and still it is not recognizing. Do i miss something? help me out guys.
    Regards,
    jaisuryah

    Hi Shannon,
    I hope the configuration i did is well. Yah am running the Java from the command line and i dont know why importing the package of javax.mail.* classes are not recognizing. I did unzipped the zip file and placed all the JAR files to lib folder of my installed JDK and referenced the JDK to classpath in environment variable also.
    Regards,
    Jaisuryah

  • : Weblogic and javax.mail

    Even I was facing the same problem(Provider rfc )as Jon has, solved it
    thanks to Phil.. set the mail.jar ahead of weblogic.jar.
    But now am getting a different error...
    javax.mail.SendFailedException: Sending failed;
    nested exception is:
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    javax.mail.SendFailedException: 550 5.7.1 Unable to relay for
    [email protected]
    at javax.mail.Transport.send0(Transport.java:219)
    at javax.mail.Transport.send(Transport.java:81)
    at email.Email.send(Email.java:98)
    at jsp_servlet._email._jspService(_email.java:88)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :208)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:1127)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :1529)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Any thoughts!!
    Thanks!
    hariharan
    "Phil Magill" <[email protected]> wrote in message
    news:<[email protected]>...
    Download the JavaMail Api from sun and add the mail.jar file as the first
    entry on your classpath as these will be call before weblogics internal
    version. There are two files missing from Weblogic which resolve the
    providors.
    Cheers
    Phil
    "Dimitri Rakitine" <[email protected]> wrote in message
    news:[email protected]..
    Install service pack 6
    Jon Crater <[email protected]> wrote:
    I'm having problems sending JavaMail through Weblogic. When I call my
    JavaMail wrapper class from the command line, mail gets sent fine, butwhen
    I try to call them from a servlet in Weblogic, I get a MessagingException:
    "No provider for Address type rfc822"
    Any ideas?Dimitri

    Hi,
    Line: "550 5.7.1 Unable to relay for [email protected]"
    seems to be message from your SMTP server. Try different recipient or
    different SMTP server.
    t.Tero
    hari wrote:
    Even I was facing the same problem(Provider rfc )as Jon has, solved it
    thanks to Phil.. set the mail.jar ahead of weblogic.jar.
    But now am getting a different error...
    javax.mail.SendFailedException: Sending failed;
    nested exception is:
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    javax.mail.SendFailedException: 550 5.7.1 Unable to relay for
    [email protected]
    at javax.mail.Transport.send0(Transport.java:219)
    at javax.mail.Transport.send(Transport.java:81)
    at email.Email.send(Email.java:98)
    at jsp_servlet._email._jspService(_email.java:88)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :208)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:1127)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :1529)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Any thoughts!!
    Thanks!
    hariharan
    "Phil Magill" <[email protected]> wrote in message
    news:<[email protected]>...
    Download the JavaMail Api from sun and add the mail.jar file as the first
    entry on your classpath as these will be call before weblogics internal
    version. There are two files missing from Weblogic which resolve the
    providors.
    Cheers
    Phil
    "Dimitri Rakitine" <[email protected]> wrote in message
    news:[email protected]...
    Install service pack 6
    Jon Crater <[email protected]> wrote:
    I'm having problems sending JavaMail through Weblogic. When I call my
    JavaMail wrapper class from the command line, mail gets sent fine, butwhen
    I try to call them from a servlet in Weblogic, I get a MessagingException:
    "No provider for Address type rfc822"
    Any ideas?Dimitri
    // Tero Soukko
    // iobox - A Terra Mobile Company
    // +358 50 5435259
    // [email protected], [email protected] (m-mail)
    // http://www.iobox.fi, We bring the Internet to your mobile.

  • Javax.mail question

    I am working on a project and encounter a problem when I try to use javax.mail package to send email. For some season, I have to use a name without the domain name as the sender (such as Sender rather than Sender @sun.com). I got MessagingException called 501 Syntax error, mail from: <Sender>" unrecognized or missing. When I add the domain name in (subtitute Sender with [email protected]), the program worked. My mail server admin told me there is no restriction on the mail server to regulate the sender's name (also it allows relay messaging). I don't know if she is right because I don't know much about mail server. Also, I figured out that I have no problem with InternetAddress("Sender"). The only thing might have problem is Message.send().
    Anybody has a thought?
    Thanks in advance.

    In an effort to reduce the amount of spam hitting, mail relays are configured to refuse to accept pieces of email whose SMTP envelope's From header isn't resolvable
    If the header in the form of user@host instead of a globally-resolvable [email protected], a bounce message would return to your user with an error message like:
    451 <user@mailhost>... Domain does not resolve
    This means that your mail relay is identifying itself as mailhost rather than mailhost.your.domain.
    How this is fixed will depend on your mail transfer agent and your own DNS. Given that this is very site-specific, I can't provide any more help about host configuration.
    Certain mail user agents (MUAs) like Netscape, Eudora, etc., that want to use an ``SMTP host'' to deliver outgoing mail will write their own SMTP envelope. They'll do this by taking the value that the user provided as their email address (which will appear in the message's From: header and using it in the SMTP envelope From header. A mail transfer agent, configured to use the user's real email address, should be able to send mail to without problem.

  • Import javax.mail not found

    Hello,
    I am new to Java Mail. I wanted to test my first programme. When I compile, I get this errors.
    package javax.mail not found in import and so on. I have set my classpath to so
    set classpath = %classpath%;C:\j2sdk1.4.0\lib\mail.jar;C:\j2sdk1.4.0\lib\activation.jar
    I included the mail.jar,smtp.jar and activation.jar in the lib directory of my jdk e.g c:\j2sdk1.4.0\lib\ "the jar file".
    Can any one tell me what I am missing here?
    Thanks
    James

    the easiest way to do this is to put
    activation.jar
    mail.jar          
    mailapi.jar     
    imap.jar     
    smtp.jar          
    pop3.jar
    into the virtual machine directory C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext
    or the lib\ext directory of whatever virtual machine you are using
    and put coppies of them in JDK
    C:\j2sdk1.4.0-beta3\jre\lib\ext
    or jre\lib\ext
    of whatever JDK you are using
    this way they are found automaticaly
    no need for classpath

  • Javax.mail.message.recipienttype not found

    Hi,
    I use jdev10g and i want to send a mail message.
    Here's a little snip of my class for sending a mail.
    Jdeveloper gives me a error about Message.RecipientType.TO.
    "Member 'RecipientType' not found in javax.mail.Message"
    import javax.mail.Message;
    message.addRecipient(Message.RecipientType.TO,
    new InternetAddress(to));
    I've installed the javamail-1.1.3 API.
    In my project properties -> libraries, i've added this library with the correct path to the jar file.
    I'm sure that this API have this Message class.
    What is going wrong, have i missed something ???
    Greetings,
    Peter

    Hi! Srikanth,
    1. I checked MailerEJB.deploy under "Dependency Analyzer",
    I checked activation.jar and mail.jar under the J2EE node.
    I did the same for the MailerJSP.deploy.
    2. I used same jdeveloper version and jdk 1.3.1_06.
    3. I did a clean deploy for the ejb and mailerjsp.deploy
    4. I recompiled and run the jpr,
    from the message window, I got:
    C:\jdeveloper\jdk\bin\javaw.exe -ojvm -classpath C:\oc4j\samples\ejb\EJBCallsJSP\classes;C:\oc4j\samples\ejb\EJBCallsJSP;C:\jdeveloper\jdev\lib\jdev-rt.jar;C:\jdeveloper\j2ee\home\lib\activation.jar;C:\jdeveloper\j2ee\home\lib\ejb.jar;C:\jdeveloper\j2ee\home\lib\jaas.jar;C:\jdeveloper\j2ee\home\lib\jaxp.jar;C:\jdeveloper\j2ee\home\lib\jcert.jar;C:\jdeveloper\j2ee\home\lib\jdbc.jar;C:\jdeveloper\j2ee\home\lib\jms.jar;C:\jdeveloper\j2ee\home\lib\jndi.jar;C:\jdeveloper\j2ee\home\lib\jnet.jar;C:\jdeveloper\j2ee\home\lib\jsse.jar;C:\jdeveloper\j2ee\home\lib\jta.jar;C:\jdeveloper\j2ee\home\lib\mail.jar;C:\jdeveloper\j2ee\home\oc4j.jar;C:\jdeveloper\jdbc\lib\classes12.jar;C:\jdeveloper\jdbc\lib\nls_charset12.jar oracle.otnsamples.ejbcallsjsp.mailclient.MailClientSample
    I didn't see any error from this message window.
    5. The no provider for smtp error is prompted from the mail client.
    From above settings and running the application, I couldn't figure out where the error was coming from ?
    Thanks
    David

  • Problems setting email headers with javax.mail.*

    I'm trying desperatly to send HTML emails with javax.mail but I simply can't. No matter what I do, no matter how and where I set the headers it always come out as text.
    Here's a sample code:
    try {
              Properties props = System.getProperties();
              props.put("mail.smtp.host", "smtp.ability.com.br");
              Session session = Session.getDefaultInstance(props, null);
              Message msg = new MimeMessage(session);
              msg.setHeader("Content-Type", "text/html");
              msg.setRecipient( MimeMessage.RecipientType.TO, new InternetAddress("[email protected]") );
              msg.setFrom( new InternetAddress("[email protected]") );
              msg.setSubject("teste");
              msg.setText("<b>testeeeeeeeeeeeee</b>");
              Transport.send( msg );
              } catch( Throwable t ) {
                   System.err.println(t);
              }and here's the resulting email:
    Return-Path: <[email protected]>
    Delivered-To: [email protected]
    Received: (qmail 5895 invoked by uid 510); 21 Dec 2004 16:41:49 -0000
    Received: from [email protected] by relay03.dominal.com
    Received: from unknown (HELO christian) (200.217.110.124)
      by 0 with SMTP; 21 Dec 2004 16:41:48 -0000
    Message-ID: <20590970.1103647309922.JavaMail.christian@christian>
    From: [email protected]
    To: [email protected]
    Subject: teste
    Mime-Version: 1.0
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    <b>testeeeeeeeeeeeee</b>What am I missing here?
    Thanks in advance,
    Christian

    msg.setText("<b>testeeeeeeeeeeeee</b>");R
    eplace that
    bymsg.setContent("<b>testeeeeeeeeeeeee</b>",
    "text/html");
    Thanks DrClap, but that's not exactly the solution I'm looking for, cuz I would have to hard-code that header.
    I have an Email class that I use as a wrapper for the javax.mail API, and I wanna be able to have a setHeader() method that works to enable the users to set the content-type of the text (or HTML) portion of the email, even when there are attachments. How can I achieve this?

  • Cannot seem to find javax.mail.*

    I've been working with J2SE for a while now using version 1.4.2.02
    Now i have a new PC and i want to include receiving and sending mail in my applications.
    I have downloaded J2SE version 1.4.2_03 and also Javamail 1.3.1
    my existing aplications still work fine the problem is in the mail part.
    Reading the tutorial by jguru all should work but when compiling i am getting the error that the package javax.mail.* cannot be found.
    What did i miss ?
    Any help most welcome, thanks.

    Found it,
    need to add the mail.jar file to the classpath itself.
    I simply copied it into one of my classpath directories but that's not sufficient.

  • Javax.mail.internet.AddressException how to escape double quote

    When I try and parse the following internetaddress:
    InternetAddress.parse("sevsev o'first sevsev o\"last <[email protected]>")I get the following stacktrace:
    Tomcat Log [(CKY50) 2006/09/27 15:26:29.217]: 4 Email.setReplyToAddresses() javax.mail.internet.AddressException: Missing '"' in string ``sevsev o'first sevsev o"last <[email protected]>'' at position 52
            at javax.mail.internet.InternetAddress.parse(InternetAddress.java:676)
            at javax.mail.internet.InternetAddress.parse(InternetAddress.java:529)
            at javax.mail.internet.InternetAddress.parse(InternetAddress.java:506)How do I escape the double quote? Thanks in advance!

    Thanks for the quick response, I tried that and got the same stacktrace:
    Tomcat Log [(3YVJS) 2006/09/27 15:44:38.554]: 4 Email.setReplyToAddresses() javax.mail.internet.AddressException: Missing '"' in string ``sevsev o'first sevsev o"last <[email protected]>'' at position 52
            at javax.mail.internet.InternetAddress.parse(InternetAddress.java:676)
            at javax.mail.internet.InternetAddress.parse(InternetAddress.java:529)
            at javax.mail.internet.InternetAddress.parse(InternetAddress.java:506)

  • Failed to build javax.mail.jar (Java Mail 1.4.4) with Maven-2.2.1

    Hi,
    I am building javax.mail.jar using with the source of "JavaMail 1.4.4 source code", downloaded from http://kenai.com/projects/javamail/downloads , we have some customized changes in few source java files (regarding IMAP and response) of this source, otherwise no changes we have done in this source for building mail jar with maven.
    I was using Maven 2.2.1 - successfully downloaded repository on my systems when I had Java 1.6. Then I have moved to java 7 but it failed, on roll back changes I was unable to download repositories as I had downloaded at earlier stage.
    System has set JAVA_HOME of Java Home directory
    [ERROR] BUILD ERROR
    [INFO] ----------------------------------------------------------------------
    [INFO] Internal error in the plugin manager executing goal 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version': Unable to load the mojo 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version' in the plugin 'com.sun.enterprise:osgiversion-maven-plugin'. A required class is missing: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    org.apache.maven.shared.osgi.Maven2OsgiConverter
    [INFO] ----------------------------------------------------------------------
    [INFO] Trace
    org.apache.maven.lifecycle.LifecycleExecutionExcep tion: Internal error in the plugin manager executing goal 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version': Unable to load the mojo 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version' in the plugin 'com.sun.enterprise:osgiversion-maven-plugin'. A required class is missing: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoals(DefaultLifecycleExecutor.java:698)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoalWithLifecycle(DefaultLifecycleExecuto r.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoalAndHandleFailures(DefaultLifecycleExe cutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeTaskSegments(DefaultLifecycleExecutor.jav a:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMav en.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven .java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:3 62)
    at org.apache.maven.cli.compat.CompatibleMain.main(Co mpatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(L auncher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher. java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode (Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.ja va:375)
    Caused by: org.apache.maven.plugin.PluginManagerException: Unable to load the mojo 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version' in the plugin 'com.sun.enterprise:osgiversion-maven-plugin'. A required class is missing: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    at org.apache.maven.plugin.DefaultPluginManager.getCo nfiguredMojo(DefaultPluginManager.java:679)
    at org.apache.maven.plugin.DefaultPluginManager.execu teMojo(DefaultPluginManager.java:468)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
    Caused by: java.lang.NoClassDefFoundError: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.jav a:2291)
    at java.lang.Class.getDeclaredField(Class.java:1880)
    at hidden.org.codehaus.plexus.util.ReflectionUtils.ge tFieldByNameIncludingSuperclasses(ReflectionUtils. java:47)
    at org.codehaus.plexus.component.composition.FieldCom ponentComposer.getFieldByName(FieldComponentCompos er.java:212)
    at org.codehaus.plexus.component.composition.FieldCom ponentComposer.findMatchingField(FieldComponentCom poser.java:171)
    at org.codehaus.plexus.component.composition.FieldCom ponentComposer.assembleComponent(FieldComponentCom poser.java:62)
    at org.codehaus.plexus.component.composition.DefaultC omponentComposerManager.assembleComponent(DefaultC omponentComposerManager.java:68)
    at org.codehaus.plexus.DefaultPlexusContainer.compose Component(DefaultPlexusContainer.java:1486)
    at org.codehaus.plexus.personality.plexus.lifecycle.p hase.CompositionPhase.execute(CompositionPhase.jav a:29)
    at org.codehaus.plexus.lifecycle.AbstractLifecycleHan dler.start(AbstractLifecycleHandler.java:101)
    at org.codehaus.plexus.component.manager.AbstractComp onentManager.startComponentLifecycle(AbstractCompo nentManager.java:105)
    at org.codehaus.plexus.component.manager.AbstractComp onentManager.createComponentInstance(AbstractCompo nentManager.java:95)
    at org.codehaus.plexus.component.manager.PerLookupCom ponentManager.getComponent(PerLookupComponentManag er.java:48)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup( DefaultPlexusContainer.java:331)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup( DefaultPlexusContainer.java:440)
    at org.apache.maven.plugin.DefaultPluginManager.getCo nfiguredMojo(DefaultPluginManager.java:652)
    ... 19 more
    Caused by: java.lang.ClassNotFoundException: org.apache.maven.shared.osgi.Maven2OsgiConverter
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
    at org.codehaus.classworlds.RealmClassLoader.loadClas sDirect(RealmClassLoader.java:195)
    at org.codehaus.classworlds.DefaultClassRealm.loadCla ss(DefaultClassRealm.java:255)
    at org.codehaus.classworlds.DefaultClassRealm.loadCla ss(DefaultClassRealm.java:274)
    at org.codehaus.classworlds.RealmClassLoader.loadClas s(RealmClassLoader.java:214)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320)
    ... 36 more
    [INFO] ----------------------------------------------------------------------
    [INFO] Total time: 29 minutes 36 seconds
    [INFO] Finished at: Fri Dec 21 13:07:49 IST 2012
    [INFO] Final Memory: 13M/23M
    [INFO] ----------------------------------------------------------------------
    Complete log output of downloading process can be seen here - http://neelamsharma.s3.amazonaws.com/Maven_Result-2.2.1.txt
    I am removing local repository ".m2" folder from my user each time before restart build. I have tried to download on different OS but it always stuck at same error.
    Can anybody please let me know what settings are changed that I need to update ? Or which repositories need to remove to get rid of this error?

    Looks like there is some sun plugin being used there. Might be that you need the java.net nexus repository so maven can fetch plugin dependencies from it.

  • Package javax.mail does not exist (Still having trouble)

    Good Morning
    I know that there are several posts regarding issues with javamail. I have viewed them for the past hour. While several of them address my issue I have been unable to locate a solution.
    Bare with me please, I am making this post very thorough. The other threads I have read are frusterating because the problems people tend to post are not clear.
    I am trying to run "msgsend" which is a provided demo of javamail-1.4 using command prompt (start - run - cmd) with the javac command.
    The output below is directly pasted from command prompt and written in bold.
    C:\download\javamail-1.4\demo>javac msgsend.java
    C:\download\javamail-1.4\demo>javac msgsend.java
    msgsend.java:44: package javax.mail does not exist
    import javax.mail.*;
    ^
    msgsend.java:45: package javax.mail.internet does not exist
    import javax.mail.internet.*;
    ^
    msgsend.java:140: cannot find symbol
    symbol : class Session
    location: class msgsend
    Session session = Session.getInstance(props, null);
    ^
    msgsend.java:140: cannot find symbol
    symbol : variable Session
    location: class msgsend
    Session session = Session.getInstance(props, null);
    ^
    msgsend.java:145: cannot find symbol
    symbol : class Message
    location: class msgsend
    Message msg = new MimeMessage(session);
    ^
    msgsend.java:145: cannot find symbol
    symbol : class MimeMessage
    location: class msgsend
    Message msg = new MimeMessage(session);
    ^
    msgsend.java:147: cannot find symbol
    symbol : class InternetAddress
    location: class msgsend
    msg.setFrom(new InternetAddress(from));
    ^
    msgsend.java:151: package Message does not exist
    msg.setRecipients(Message.RecipientType.TO,
    ^
    msgsend.java:152: cannot find symbol
    symbol : variable InternetAddress
    location: class msgsend
    InternetAddress.parse(to,
    ^
    msgsend.java:154: package Message does not exist
    msg.setRecipients(Message.RecipientType.CC,
    ^
    msgsend.java:155: cannot find symbol
    symbol : variable InternetAddress
    location: class msgsend
    InternetAddress.parse(cc,
    ^
    msgsend.java:157: package Message does not exist
    msg.setRecipients(Message.RecipientType.BCC,
    ^
    msgsend.java:158: cannot find symbol
    symbol : variable InternetAddress
    location: class msgsend
    InternetAddress.parse(bcc,
    ^
    msgsend.java:167: cannot find symbol
    symbol : class MimeBodyPart
    location: class msgsend
    MimeBodyPart mbp1 = new MimeBodyPart();
    ^
    msgsend.java:167: cannot find symbol
    symbol : class MimeBodyPart
    location: class msgsend
    MimeBodyPart mbp1 = new MimeBodyPart();
    ^
    msgsend.java:169: cannot find symbol
    symbol : class MimeBodyPart
    location: class msgsend
    MimeBodyPart mbp2 = new MimeBodyPart();
    ^
    msgsend.java:169: cannot find symbol
    symbol : class MimeBodyPart
    location: class msgsend
    MimeBodyPart mbp2 = new MimeBodyPart();
    ^
    msgsend.java:171: cannot find symbol
    symbol : class MimeMultipart
    location: class msgsend
    MimeMultipart mp = new MimeMultipart();
    ^
    msgsend.java:171: cannot find symbol
    symbol : class MimeMultipart
    location: class msgsend
    MimeMultipart mp = new MimeMultipart();
    ^
    msgsend.java:185: cannot find symbol
    symbol : variable Transport
    location: class msgsend
    Transport.send(msg);
    ^
    msgsend.java:193: cannot find symbol
    symbol : class Store
    location: class msgsend
    Store store = null;
    ^
    msgsend.java:195: cannot find symbol
    symbol : class URLName
    location: class msgsend
    URLName urln = new URLName(url);
    ^
    msgsend.java:195: cannot find symbol
    symbol : class URLName
    location: class msgsend
    URLName urln = new URLName(url);
    ^
    msgsend.java:212: cannot find symbol
    symbol : class Folder
    location: class msgsend
    Folder folder = store.getFolder(record);
    ^
    msgsend.java:218: cannot find symbol
    symbol : variable Folder
    location: class msgsend
    folder.create(Folder.HOLDS_MESSAGES);
    ^
    msgsend.java:220: cannot find symbol
    symbol : class Message
    location: class msgsend
    Message[] msgs = new Message[1];
    ^
    msgsend.java:220: cannot find symbol
    symbol : class Message
    location: class msgsend
    Message[] msgs = new Message[1];
    27 errors
    Here are the methods I have tried...
    1. Make sure you have most current version of Java
    2. Reinstall Java
    3. Attempt to compile in an IDE (Attempted in Eclipse 3.2)
    4. Set class path
    Some sources suggest "CLASSPATH" some suggest "CLASS PATH" as the variable name. I have tried both.
    Below is what the classpath looks like in bold.
    Variable Name: CLASS PATH
    Variable value: c:\download\javamail-1.4\mail.jar;C:\download\jaf-1.1\activation.jar;.
    I have double checked all folder names and copy pasted all entries to eliminate typos. Javamail-1.4 and jaf-1.1 are both located in c:\download which is the same location Class Path points to.
    Thank you very much for your input and effort. I can imagine how frusterating it is responding to 20million javamail posts :) (that may be a bit of an overstatement!)
    Thank you again!
    Irbi
    Message was edited by:
    irbi
    Message was edited by:
    irbi

    Yes - I have read that part of the README and did exactly as it has said in a previous attempt. I should have mentioned that here I'm sorry :)
    I moved the .jar files into the download folder and set the classpath exactly as the readme shows.
    When I do that the msgsend.java compiles correctly but it still does not run.
    Below is what happens.
    C:\download\javamail-1.4\demo>set CLASSPATH=%CLASSPATH%;c:\download\javamail-1.4
    \mail.jar;%CLASSPATH%;c:\download\jaf-1.1\activation.jar.
    C:\download\javamail-1.4\demo>javac msgsend.java
    C:\download\javamail-1.4\demo>java msgsend.java
    Exception in thread "main" java.lang.NoClassDefFoundError: msgsend/java
    C:\download\javamail-1.4\demo>
    I have tried fixing this error as well via forums and FAQs but it seems to be the most generic error.
    One suggestion was to clear your classpath. I tried this with a test hello world program which was giving the same error - "NoClassDefFoundError". By clearing the classpath I was able to get the hello world program to run without this error. But I can't just clear the classpath in this instance because it needs to point to mail.jar and activation.jar for the program to compile.
    Thanks again for all of your efforts. You are more appreciated than you know.

  • Exception in thread "main" javax.mail.NoSuchProviderException: invalid prov

    HI,
    I am trying to read mails from my inbox i amgetting the ErrorC:\javamail>java
    Readmail
    Exception in thread "main" javax.mail.NoSuchProviderException: No provider for IMAP
            at javax.mail.Session.getProvider(Session.java:455)
            at javax.mail.Session.getStore(Session.java:530)
            at javax.mail.Session.getStore(Session.java:510)
            at Readmail.main(Readmail.java:24)My Code is    {
    String host = "hostname";
    String username = "user";
    String password = "password";
    // Create empty properties
    Properties props = new Properties();
    // Get session
    Session session = Session.getDefaultInstance(props,null);
    // Get the store
    Store store = session.getStore("IMAP");
    store.connect(host, username, password);
    // Get folder
    Folder folder = store.getFolder("Inbox");
    folder.open(Folder.READ_ONLY);
    // Get directory
    Message message[] = folder.getMessages();
    for (int i=0, n=message.length; i<n; i++)
       System.out.println(i + ": " + message.getFrom()[0]
    + "\t" + message[i].getSubject());
    // Close connection
    folder.close(false);
    store.close();
    I have also tried POP3 and MIME and SMTP
    Can anyone help me Thanks

    hi bshannon,
    I am getting the same error for others but for pop3 the error is as below
    Exception in thread "main" javax.mail.MessagingException: Connect failed;
      nested exception is:
            java.net.ConnectException: Connection refused: connect
            at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:148)
            at javax.mail.Service.connect(Service.java:275)
            at javax.mail.Service.connect(Service.java:156)
            at Readmail.main(Readmail.java:25)
    Caused by: java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
            at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
            at java.net.Socket.connect(Socket.java:452)
            at java.net.Socket.connect(Socket.java:402)
            at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
            at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
            at com.sun.mail.pop3.Protocol.<init>(Protocol.java:81)
            at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:201)
            at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:144)
            ... 3 more

  • Getting javax.mail.AuthenticationFailedException: EOF on socket. Need Help

    I am trying to get hotmail emails and store in Oracle 10g database.
    When I am executing receivemail procedure from Oracle 10g database. I am getting following error.
    connect to ESIMSCO_UTIL_OWNER
    SQL> set serveroutput on
    SQL>
    SQL> Declare
    2 v_error_msg varchar2(10000);
    3 Begin
    4 v_error_msg:=receivemail('pop3.live.com', '<My email address>@hotmail.com', '<My email password>');
    5 dbms_output.put_line(v_error_msg);
    6 End;
    7 /
    javax.mail.AuthenticationFailedException: EOF on socket
    PL/SQL procedure successfully completed.
    SQL>
    I did following steps, but still I am getting this error. Can somebady help me to solve this problem.
    connect sys/<password>@esimsco as sysdba
    connect to sys
    SQL*Plus: Release 10.2.0.1.0 - Production on Wed May 30 16:02:04 2012
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> begin
    1 dbms_java.grant_permission( 'ESIMSCO_UTIL_OWNER', 'SYS:java.util.PropertyPermission', '*', 'read,write' );
    2 commit;
    3 end;
    4 /
    PL/SQL procedure successfully completed.
    SQL> begin
    2 dbms_java.grant_permission(
    3 grantee => 'ESIMSCO_UTIL_OWNER',
    4 permission_type => 'SYS:java.net.SocketPermission',
    5 permission_name => '*',
    6 permission_action => 'connect,resolve'
    7 );
    8 end;
    9 /
    PL/SQL procedure successfully completed.
    SQL> begin
    2 dbms_java.grant_permission(
    3 grantee => 'ESIMSCO_UTIL_OWNER',
    4 permission_type => 'SYS:java.util.PropertyPermission',
    5 permission_name => '*',
    6 permission_action => 'read,write'
    7 );
    8 end;
    9 /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL>
    Then I connect ESIMSCO_UTIL_OWNER.
    connect to ESIMSCO_UTIL_OWNER
    Create 2 tables.
    create table attachment(
    at_file varchar2(500),
    at_mimetype varchar2(500),
    at_attachment blob
    create table email (
    em_incident integer,
    em_from varchar2(1000),
    em_subject varchar2(1000),
    em_body nclob
    Then Create java source named receivemail.
    create or replace and compile java source named receivemail as
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
    import java.sql.*;
    import sqlj.runtime.*;
    import oracle.sql.BLOB;
    public class ReceiveMail
    static void getAttachments(Message message, int incidentNo)
    throws MessagingException, IOException, SQLException {
    //String attachments = "";
    Object content = message.getContent();
    if (content instanceof Multipart)
    // -- Multi part message which may contain attachment
    Multipart multipart = (Multipart)message.getContent();
    // -- Loop through all parts of the message
    for (int i=0, n=multipart.getCount(); i<n; i++) {
    Part part = multipart.getBodyPart(i);
    String disposition = part.getDisposition();
    if ((disposition != null) &&(disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE))) {
    //-- This part is a file attachment
    String fileName = incidentNo+"_"+part.getFileName().replace(' ','_');
    System.out.println("FILE: " + fileName);
    String contentType = part.getContentType();
    String mimeType = contentType.substring(0,contentType.indexOf(";"));
    System.out.println("FILETYPE: " + mimeType);
    InputStream is = part.getInputStream();
    // -- To work with a BLOB column you have to insert a record
    // -- with an emptly BLOB first.
    #sql { insert into attachment(at_file, at_mimetype, at_attachment)
    values (:fileName, :mimeType, empty_blob()) };
    // -- Retrieve the BLOB
    BLOB attachment = null;
    #sql { select at_attachment into :attachment
    from attachment where at_file = :fileName };
    // -- Fill the BLOB
    OutputStream os = attachment.getBinaryOutputStream();
    int j;
    while ((j = is.read()) != -1) {
    os.write(j);
    is.close();
    os.close();
    // -- Set the BLOB by updating the record
    #sql { update attachment set at_attachment = :attachment
    where at_file = :fileName };
    static String getPlainTextBody(Message message)
    throws MessagingException, IOException
    Object content = message.getContent();
    if (message.isMimeType("text/plain")) {
    // -- Message has plain text body only
    System.out.println("SIMPLE TEXT");
    return (String) content;
    } else if (message.isMimeType("multipart/*")) {
    // -- Message is multipart. Loop through the message parts to retrieve
    // -- the body.
    Multipart mp = (Multipart) message.getContent();
    int numParts = mp.getCount();
    System.out.println("MULTIPART: "+numParts);
    for (int i = 0; i < numParts; ++i) {
    System.out.println("PART: "+mp.getBodyPart(i).getContentType());
    if (mp.getBodyPart(i).isMimeType("text/plain")) {
    // -- Return the plain text body
    return (String) mp.getBodyPart(i).getContent();
    } else if (mp.getBodyPart(i).isMimeType("multipart/*")) {
    // -- Body is also multipart (both plain text and html).
    // -- Loop through the body parts to retrieve plain text part.
    MimeMultipart mmp = (MimeMultipart) mp.getBodyPart(i).getContent();
    int numBodyParts = mmp.getCount();
    System.out.println("MULTIBODYPART: "+numBodyParts);
    for (int j = 0; j < numBodyParts; ++j) {
    System.out.println("BODYPART: "+mmp.getBodyPart(j).getContentType());
    if (mmp.getBodyPart(j).isMimeType("text/plain")) {
    // -- Return the plain text body
    return (String) mmp.getBodyPart(j).getContent();
    return "";
    } else {
    System.out.println("UNKNOWN: "+message.getContentType());
    return "";
    static void saveMessage(Message message)
    throws MessagingException, IOException, SQLException
    //String body = "";
    int incidentNo;
    // -- Get a new incident number
    #sql { select seq_incident.nextval into :incidentNo from dual };
    // -- Get the header information
    String from = ((InternetAddress)message.getFrom()[0]).getAddress();
    System.out.println("FROM: "+ from);
    String subject = message.getSubject();
    System.out.println("SUBJECT: "+subject);
    // -- Retrieve the plain text body
    String body = getPlainTextBody(message);
    // -- Store the message in the email table
    #sql { insert into email (em_incident, em_from, em_subject, em_body)
    values (:incidentNo, :from, :subject, :body) };
    // -- Retrieve the attachments
    getAttachments(message, incidentNo);
    #sql { commit };
    // -- Mark message for deletion
    // message.setFlag(Flags.Flag.DELETED, true);
    public static String Receive(String POP3Server, String usr, String pwd)
    Store store = null;
    Folder folder = null;
    try
    // -- Get hold of the default session --
    Properties props = System.getProperties();
    props.put("mail.pop3.connectiontimeout", "60000");
    Session session = Session.getDefaultInstance(props, null);
    // -- Get hold of a POP3 message store, and connect to it --
    store = session.getStore("pop3");
    store.connect(POP3Server,995, usr, pwd);
    System.out.println("Connected");
    // -- Try to get hold of the default folder --
    folder = store.getDefaultFolder();
    if (folder == null) throw new Exception("No default folder");
    // -- ...and its INBOX --
    folder = folder.getFolder("INBOX");
    if (folder == null) throw new Exception("No POP3 INBOX");
    // -- Open the folder for read_write (to be able to delete message) --
    folder.open(Folder.READ_WRITE);
    // -- Get the message wrappers and process them --
    Message[] msgs = folder.getMessages();
    for (int msgNum = 0; msgNum < msgs.length; msgNum++){
    saveMessage(msgs[msgNum]);
    System.out.println("No more messages");
    return ("SUCCESS");
    catch (Exception ex){
    ex.printStackTrace();
    return ex.toString();
    finally{
    // -- Close down nicely --
    try{
    // close(true), to expunge deleted messages
    if (folder!=null) folder.close(true);
    if (store!=null) store.close();
    catch (Exception ex){
    //ex.printStackTrace();
    return ex.toString();
    Then create function receivemail.
    create or replace function receivemail(pop3_server in string,
    pop3_usr in string,
    pop3_pwd in string)
    return varchar2
    is language java name
    'ReceiveMail.Receive(java.lang.String,
    java.lang.String,
    java.lang.String) return String';
    And then trying to execute function receivemail, but I am getting following error.
    SQL> set serveroutput on
    SQL>
    SQL> Declare
    2 v_error_msg varchar2(10000);
    3 Begin
    4 v_error_msg:=receivemail('pop3.live.com', '<Hotmail email address>@hotmail.com', 'Hotmail password');
    5 dbms_output.put_line(v_error_msg);
    6 End;
    7 /
    javax.mail.AuthenticationFailedException: EOF on socket
    PL/SQL procedure successfully completed.
    SQL>
    I am requesting, please help me to solve this problem.
    I will be very thankful for your kind help and support.
    Amol......
    Edited by: Amol Karyakarte on 31-May-2012 7:27 AM

    Hello,
    I don't think this is the right forum, as this question seems to have nothing to do with the Oracle Forms tool.
    You'd better ask it in the database forum.
    Francois

Maybe you are looking for

  • Error while extracting the data in R/3 production system,

    Hi Team, We got the following error while extracting the data in R/3 production system, Error 7 When Sending an IDoc R3 3 No Storage space available for extending the inter 44 R3 299 No storage space available for extending the inter R3 299 Error in

  • Return and Exchange Policy

    I purchased an iPod Mini on Dec. 25, 2004. I would like to know if I am covered by the Apple Limited Warranty or Support, if so, what steps do I take to return my iPod Mini in for repair or maybe exchange?

  • Issue with transferring calls to VM for the correct DN Unity Connection 9.1.2

    Hi all I have been facing an issue with a Unity Connection Server v9.1.2. Every time an internal extension (assigned to VM profile and to Unity as a user) which is configured to be transferred to VM after 20 sec or so NoAN,is called , Unity treats th

  • Problem with converted PDF from OTF

    Hello, im having a problem with character interpretation in PDF document when i convert it from OTF. At the moment im using Arial true type font in my smartform, im using function module CONVERT_OTF to convert OTF to PDF. When i open PDF document wit

  • GR posting with External No Range

    Hi,    Is it possible to create a GR with external number(for both Mtl and Acct document) with correspond to a PO number... Thanks