Defining a Mail Session

Hello,
I'd like to setup a Mail session in my WLS 6.0 sp2. I have to log in the
mail server I use to send email, by providing login and password. Actually,
I can't find the way to define a password on the properties of the mail
seesion (I'd like all of the user of my realm to use the same login and
password to connect to the mail server). What is the name of the property I
have to use to set the login and password for this mail session ?
Regards.
Dom

If you keep the connection open across pages, you're going to need to deal with
timeouts - from the http session and from the mail server.
If you don't keep the connection open, you're going to need to "resynchronize"
your view of the store/folder with each operation, in case the folder is modified
by another session.
The former is easier in the common cases, especially if you don't care how gracefully
you handle failures. The latter is more difficult in the common cases, but handles
failure better, and in particular handles clustering better. You'll need to measure it to
see if it meets your performance and scalability requirements. You may need to mix
the two approaches to get acceptable performance.

Similar Messages

  • Mail Session configuration with embedded oc4j in jdeveloper 10g 10.1.3.1

    Hello all:
    I'd tried to use javamail in a j2ee application. I´d defined an resource reference with the EJB Module Editor but when i run the application it throws:
    java.lang.InstantiationException: Error initializing ejb-modules: No Mail Session configured for the resource MailSession
    How can i configure a Mail Session with the embedded oc4j of jdeveloper 10g 10.1.3.1?
    Thanks a lot.

    Hi,
    You need to add following configuration in $ORACLE_HOME/j2ee/home/config/application.xml & restart your OC4J :-
    <mail-session location="EMailSession" smtp-host="mail.cdsc.com">       <property name="mail.transport.protocol" value="smtp"/>       <property name="mail.debug" value="true"/>    </mail-session>Regards,
    Sandeep

  • Sending email using BPEL 11g and Mail Sessions

    Hi gurus,
    I have created a BPEL process which can emails to a set of people. The mail server, port etc are configured in EM Console --> user messaging service-email --> Email Driver Properties. I then added the 'from address' in soa infra --> workflow config.
    My question is - is there any way in which I can achieve the same using Mail Sessions (Weblogic Console --> Mail Sessions)?
    Regards,
    Arindam

    I ran accross this randomly so sorry if this is irrelevent with timing. It seems however that Text Expander might be what you need. It is a mac program though, not ios.
    http://www.smilesoftware.com/TextExpander/

  • Is not defined in this session

    SELECT cycle_flag, sequence_name FROM ALL_SEQUENCES
    I picked 'record_SEQ' sequence from the listing.
    select record_SEQ.Currval from dual; ==> ORA-08002: sequence record_SEQ.Currval is not defined in this session.
    where is the problem ?

    As per the link you posted it says , this error comes up when there is no value >...but I can see the last value in the sequence is 20632 (using TOAD's sequence tab and highlight the particular sequence).
    So, This error is confusing
    Total Questions: 3 (3 unresolved) ?????one answered and Marked as answered.
    Edited by: user575089 on Dec 23, 2009 12:47 AM

  • Best practice for keeping a mail session open in web application?

    Hello,
    We have a webmail like application where users login with their IMAP credentials, then are taken to an authenticated area of the site where they can manage different things about their email account.
    Right now the application is opening and closing a mail store connection (via a new javax.mail.Session) for each page load based on the current logged in user credentials. To me this seems like it would be a bad practice to keep opening and closing a connection each page load.
    Are there any best practices for this situation? It would be nice to be able to open the connection to the mail server on login, then keep that connection open until the person logs out, session expires, etc.
    I can probably put the javax.mail.Session into the HTTP session, but that seems like it would break any clustering functionality of tomcat. This would be fine if the machine the user is on didn't fail, but id assume if they failed over to another the mail session would be gone. Maybe keeping the mail session in the http session, checking for a connection, then first attempting to reconnect with the logged in credentials before giving up would be a possiblity?
    Any pointers would be appreciated

    If you keep the connection open across pages, you're going to need to deal with
    timeouts - from the http session and from the mail server.
    If you don't keep the connection open, you're going to need to "resynchronize"
    your view of the store/folder with each operation, in case the folder is modified
    by another session.
    The former is easier in the common cases, especially if you don't care how gracefully
    you handle failures. The latter is more difficult in the common cases, but handles
    failure better, and in particular handles clustering better. You'll need to measure it to
    see if it meets your performance and scalability requirements. You may need to mix
    the two approaches to get acceptable performance.

  • Always get the InternetAddress & javax.mail.Session error

    <%@ page import="javax.mail.*" %>
    <%@ page import="javax.mail.internet.*" %>
    <%@ page import="javax.activation.*" %>
    <%@ page import="java.util.*,java.io.*" %>
    <%@ page contentType="text/html;charset=big5" %>
    <html>
    <head>
    <title>JavaMail</title>
    </head>
    <body>
    <h2>&#21033;&#29992;JavaMail&#20358;&#20659;&#36865;&#38651;&#23376;&#37109;&#20214; - &#38468;&#21152;&#27284;&#26696;</h2>
    <%
    InternetAddress[] address = null;
    request.setCharacterEncoding("big5");
    // MultipartRequest multi = new MultipartRequest(request , "." , 5*1024*1024 , "big5");
    String mailserver = "mail.dwu.edu.tw";
    String From = request.getParameter("From");
    String to = request.getParameter("To");
    String Subject = request.getParameter("Subject");
    String type = request.getParameter("Type");
    String messageText = request.getParameter("Message");
    String FileName = request.getParameter("FileName");
    boolean sessionDebug = false;
    try {
    // &#35373;&#23450;&#25152;&#35201;&#29992;&#30340;Mail &#20282;&#26381;&#22120;&#21644;&#25152;&#20351;&#29992;&#30340;&#20659;&#36865;&#21332;&#23450;
    java.util.Properties props = System.getProperties();
    props.put("mail.host",mailserver);
    props.put("mail.transport.protocol","smtp");
    // &#29986;&#29983;&#26032;&#30340;Session &#26381;&#21209;
    javax.mail.Session mailSession = javax.mail.Session.getDefaultInstance(props,null);
    mailSession.setDebug(sessionDebug);
    Message msg = new MimeMessage(mailSession);
    // &#35373;&#23450;&#20659;&#36865;&#37109;&#20214;&#30340;&#30332;&#20449;&#20154;
    msg.setFrom(new InternetAddress(From));
    // &#35373;&#23450;&#20659;&#36865;&#37109;&#20214;&#33267;&#25910;&#20449;&#20154;&#30340;&#20449;&#31665;
    address = InternetAddress.parse(to,false);
    msg.setRecipients(Message.RecipientType.TO, address);
    // &#35373;&#23450;&#20449;&#20013;&#30340;&#20027;&#38988;
    msg.setSubject(Subject);
    // &#35373;&#23450;&#36865;&#20449;&#30340;&#26178;&#38291;
    msg.setSentDate(new Date());
    if (FileName != null)
    File file = new File(FileName);
    // &#22914;&#26524;&#26377;&#38468;&#21152;&#27284;&#26696;&#26178;&#65292;&#20808;&#23559;&#37109;&#20214;&#20839;&#23481;&#37096;&#20221;&#20808;&#23384;&#36215;&#20358;
    MimeBodyPart mbp1 = new MimeBodyPart();
    // &#35373;&#23450;&#37109;&#20214;&#20839;&#23481;&#30340;&#22411;&#24907;&#28858; text/plain &#25110; text/html
    mbp1.setContent(messageText, type + ";charset=big5");
    // &#20877;&#20358;&#23565;&#27284;&#26696;&#20316;&#34389;&#29702;
    MimeBodyPart mbp2 = new MimeBodyPart();
    FileDataSource fds = new FileDataSource(FileName);
    mbp2.setDataHandler(new DataHandler(fds));
    mbp2.setFileName(MimeUtility.encodeText(fds.getName(), "big5", "B"));
    // &#26368;&#24460;&#20877;&#23559;&#20108;&#32773;&#25972;&#21512;&#36215;&#20358;&#65292;&#30070;&#20316;&#19968;&#20221;&#37109;&#20214;&#36865;&#20986;
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    mp.addBodyPart(mbp2);
    msg.setContent(mp);
    else
    // &#33509;&#27794;&#26377;&#27284;&#26696;&#26178;&#65292;&#23601;&#30452;&#25509;&#23384;&#37109;&#20214;&#20839;&#23481;
    msg.setContent(messageText,type + ";charset=big5");
    Transport.send(msg);
    out.println("&#37109;&#20214;&#24049;&#38918;&#21033;&#20659;&#36865;");
    catch (MessagingException mex)
    mex.printStackTrace();
    %>
    </body>
    </html>
    ==================================
    i don't know why i always get the error about the type even i already add the jar file in lib folder:
    InternetAddress cannot be resolved to a type
    javax.mail.Session cannot be resolved to a type

    What server are you using?
    Did you follow the instructions on the JavaMail FAQ for setting up the server?
    Did you restart the server?

  • Mail Session configuration authorization

    Hi,
    I hava deployed the confirmer app from tutorial.
    I got exception when sending a message saying I have to use authorization.
    I know how to do it the hard way (in code obtain other mail session)
    I tried to add a single property to the mail session, but it deletes all properties from java mail session ! (mail-from for example)
    Why the container doesn't use auth info I give when setting user and pass in JNDI reference ?
    How to add this property, so other aren't affected ?
    Thanks.

    I am not sure I totally understand your question. Are you saying that if you follow the instructions in the tutorial for the confirmer app, it does not work?
    Please clarify if possible.

  • Error Compiling With java.mail.Session class

    Hi,
    The Java compiler issues an error message (below) during compilation of the following line:
    Session session = Session.getDefaultInstance( fMailServerConfig, null );
    The error message is:
    bad class file: c:\j2ee_sdk\lib\j2ee.jar(javax/mail/Session.class)
    class file has wrong version 48.0, should be 47.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    javax.mail.Session session = javax.mail.Session.getDefaultInstance( fMailServerConfig, null );
    I have tried switching between JDKs by changing the JAVA_HOME environment variable between JDKs 1.3.x to 1.4.x to 1.5.x and also to the JDK installed with the 2005 Q1 J2EE installation that I am using.
    Any ideas on how to resolve this problem? And help would be GREATLY appreciated.
    Thanks!!!
    Stuart Hoffman

    in Session session = Session.getDefaultInstance( fMailServerConfig, null ); pass the object of properties class instead of mailServerconfig
    now your problem are solved

  • Getting a Mail session from Initialcontext

    Hi,
    Does anyone know how to configure oc4j such that i could get a mail session by looking up in the initial context? I know it could be done in jboss by altering an xml file. But I am not sure how to do it in oc4j. Could someone help please?
    Could any one explain to me what is the use of PortableRemoteObject.narrow method used for? As down cast could be done directly, why is there a need for PortableRemoteObject. Thanks
    if say, part of the j2ee application (some ejb jar files) is running on a host, and the j2ee application (some different ejb jar files) is running on a different host, and to look up the ejb on diferrent host normal java casting cannot be done cause they are network appart. So we need PortableRemoteObject to do the down casting. Is that right?
    If say, on a different situation, a server (orion or weblogic) is running on a host and the j2ee application is on another different host, to get the initial context, we need to set the provider and the uri say something like t3 for weblogic and ormi for orion... Am I right so far? please correct me if i am not. And to lookup the DataSource for connection pooling in order to get a connection, do we need to use portable remove object as well? I think so cause they are separated and they should communicate using rmi-iiop? Is that correct?
    Is CreateException, FinderException, RemoveException and EJBException applicable to their respective methods? Say CreateException is thorwn when problems in creating a bean instance and finder when canno find bean due to (maybe connection or sql error) etc. RemoveException when ejbRemove encounter problems and EJBException when business methods cannot succeed? In sun tutorial all methods throw EjbException which confused me. Could someone shed some light on this issue please?
    Thanks a lot
    Ras

    No.

  • Authorization error for referenced class javax/mail/Session.

    All,
    I am trying to compile a java source which is using session object in javax/mail/session.
    I am getting the error java/lang/System: Authorization error for referenced class javax/mail/Session.
    I used "import javax.mail.*;" in my java source..
    I loaded both mail.jar and activation.jar using the below command in different schema other than the schema which above java source exists.
    loadjava -thin -verbose -user <user>/<pwd>@<dburl> -resolve -synonym activation.jar
    loadjava -thin -verbose -user <user>/<pwd>@<dburl> -resolve -synonym mail.jar
    After loading, All java classes in mail.jar and activation.jar were in compiled state in that schema
    Its working well in different database having the same configuration.
    My oracle version is Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production

    I have to accomplish tried in CONSOLE TestMail.class:
    C>java TestMail
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Partmy make.bat:
    javac -g -classpath
    ...\Java\jre1.5.0_06\lib\activation.jar;...\jre1.5.0_06\lib\imap.jar;...\jre1.5.0_06\lib\mail.jar;...\jre1.5.0_06\lib\mailapi.jar;...\jre1.5.0_0\lib\plugin.jar;...\jre1.5.0_06\lib\pop3.jar;...\jre1.5.0_06\lib\smtp.jar;...\jre1.5.0_06\lib\javamail-1_3_2-src-jrl.zip;...\jre1.5.0_06\lib\j2ee.jar  TestMail.javaWhat isn't correct?
    Tanks,
    Mohammad

  • Javax.mail.Session Class Cast Exception

    I'm tryin' to send a mail via JNDI Java Mail Session, but when i get the look up Object, ClassCastException are thrown
    When i take the o.getClass().getName() is equal to the cast class that i use. I don't know what to do.
    Source --->
    Object o;
    context = new InitialContext();
    o = context.lookup("java:comp/env/mail/mysession");
    System.out.println(o.getClass().getName());
    return (javax.mail.Session) o; // Exception here!

    DUH!
    I'm using incorrect mail.jar version...
    :')

  • Gmail mail-session

    Hi,
    I hope that someone can help me.
    I'm trying to send an email from a jsp file with oc4j 10.1.2 and 10.1.3 and i receive the same error.
    javax.mail.SendFailedException: Sending failed;
    nested exception is:
         class javax.mail.AuthenticationFailedException
         at javax.mail.Transport.send0(Transport.java:218)
         at javax.mail.Transport.send(Transport.java:80)
         at untitled1.jspService(_untitled1.java:79)
         [untitled1.jsp]
         at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.3.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
         at java.lang.Thread.run(Thread.java:595)
    I configure the <mail-session> like this.
    <mail-session location="mail/GmailSmtpServer" smtp-host="smtp.gmail.com">
    <property name="mail.smtp.port" value="465"/>
    <property name="mail.smtp.auth" value="true"/>
    <property name="mail.smtp.user" value="[email protected]"/>
    <property name="password" value="xxxxxxxx"/>
    <property name="mail.smtp.starttls.enable" value="true"/>
    <property name="mail.smtp.socketFactory" value="javax.net.ssl.SSLSocketFactory"/>
    </mail-session>
    If i try with tomcat with the same configuration and it works perfect.
    <Resource name="mail/GmailSmtpServer"
    auth="Container"
    type="javax.mail.Session"
    mail.smtp.host="smtp.gmail.com"
    mail.smtp.port="465"
    mail.smtp.auth="true"
    mail.smtp.user="[email protected]"
    password="xxxxxxx"
    mail.smtp.starttls.enable="true"
    mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
    />
    Thank You.
    JP

    I had an error with
    <property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLServerSocketFactory"/>
    because i put mal.smtp.socketFactory without the .class
    Now i receive a different error
    java.io.IOException: Couldn't connect using "javax.net.ssl.SSLServerSocketFactory" socket factory to host, port: smtp.gmail.com, -1; Exception: java.lang.NoSuchMethodException: javax.net.ssl.SSLServerSocketFactory.createSocket(java.lang.String, int)
    I attached the jsse.jar, but it didn't resolve the problem.
    Thanks.
    JP

  • Mail Session

    Hi,
    I created a Java Mail Session at console.
    How can i test the mail session?????
    Any Clues on this .........
    Thanks in Advance,
    Venu......

    Youll have to write java code to lookup this session and then use it as any other to send an email
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/javamail.html

  • Sequence is not yet defined in this session

    Hello everybody
    I have package, that contain some steps. I create batch log in the start (using BATCH.nextval sequence) and to close batch log in the end (using BATCH.currval sequence) of package, also after each step of the package I create batch_process log (using BATCH.currval and BATCH_PROCESS.nextval sequences). Log works fine, if the package status is "SUCCESS".
    But when I get an error through any step, I try to create errored batch_process log (using BATCH.currval and BATCH.nextval sequences) and to close batch log (using BATCH.currval sequence) with error also. So, when I try to create errored batch_process log, T get an error: BATCH.CURRVAL is not yet defined in this session.
    Help, please, to solve this error.
    Best regards

    Are you trying to handle the error in a scenario and accessing batch.currval from within that scenario ?
    If that is the case, then you need to know that each scenario creates its own session and connection to the DB. So, the currval becomes undefined within that session.

  • How can i configure mail session

    I am trying to execute the junit test cases.The server will not be running when i execute the junit test cases.Their are some methods which send the mail.The mail session is provided by the server with the help of JNDI configured in server.xml.How can we code and provide this mail session as a JNDI resource.

    I do not know if this is the right solution but in the web application XML configuration file you have to add the mail session reference.
    The file name is xxxx-oc4j-amm.xml where xxxx is the web application name.
    Inside <orion-application> entry you have to put
    <mail-session location="mail/Session" smtp-host="smtp.host.it">
    <property name="mail.transport.protocol" value="smtp"/>
    <property name="mail.smtpo.port" value="25"/>
    </mail-session>
    where smtp.host.it is the IP address or the name of the SMTP server
    I hope to be helpful
    Ciao
    Domenico Pozza

Maybe you are looking for

  • Unable to Subclip HDV footage

    I'm having trouble subclipping HDV footage. When I match frame the footage in the timeline the make subclip option is greyed out. Anybody have any idea why FCP is doing this? Thanks in advance Intel - FCP 6.0.4

  • WINDOWS MEDIA PLAYER NOT WORKING. PLEASE HELP!!

    I recently bought the Xtremegamer X-fi sound blaster card. I installed all the drivers and updated them. System cpu: 4200 AMD X2 Speakers: 5. setup (shouldn't be any problems there) My problem is that i can't play music through windows media player.

  • Different WT values in a single field in Payslip.

    Hi, 1. We need to group together 2 or 3 deduction wage types amount as a single field and bring into payslip, how to bring this value in a single field. 2. How to bring values of adjustment wage types in payslip if in case adjustments comes not a sta

  • JVM 1.5.0, parallelism and object creation

    Hi. I am currently running Java 1.5.0 on a production server. This server is a 4-cpu 2gb ram beast running Red Hat ES 3. It provides MySQL backend and a Java server to be accessed through a Flash client. So far, the Flash client fares well. MySQL tak

  • Deleting rows with child records

    Hi, I want to delete some records from master table based on where condition. But I want all the corresponding child record should also delete from the respective child tables.. Can anyone tell me how to go about it with example( eg emp & dept table