Can't using J2EE java mail?

hi all,
Here is a problem that I have with my the usage of Java Mail Session
that i set up in weblogic. I use weblogic 8.1
When I do the JNDI lookup to the mail session (set up in the weblogic
admin interface), it looks that the lookup itself is ok but when i do
the casting, it doesn't work. Have a look at my code and the trace
produced :
writed an external client,follow:
<myCode>
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory
h.put(Context.PROVIDER_URL,"t3://localhost:7001"); // provider url is
right
h.put(Context.SECURITY_PRINCIPAL,"weblogic");
h.put(Context.SECURITY_CREDENTIALS,"password");
Context namingContext = new InitialContext(h);
Session mailSession = (Session) namingContext.lookup("jndi/mail");
</myCode>
<trace>
javax.naming.ConfigurationException. Root exception is
java.rmi.MarshalExceptio
n: error marshalling return; nested exception is:
java.io.NotSerializableException: javax.mail.Session
java.io.NotSerializableException: javax.mail.Session
<<no stack trace available>>
</trace>
I can understand the exception as javax.mail.Session doesn't implement
serializble. But How do I have to do to make it work, then? Because what
I do is just how it's explained in the weblogic doc. Is there a mistake
in the do? Do I have to cast to somethig else?
Any help would be very appraciated.
Thanks.

Try this on the server side not from external client - that should work fine.
If you need this from an external client, since the java.mail.Session object is not serializable - you can also implement an EJB and have your client lookup the session bean and send the data to the server and have the serverside session bean implementation create the mail session and interact.
hth
sree

Similar Messages

  • This is regarding CBMA in SAP PI 7.3.1. I have set up the alert mail using default java mail client.I do receive the alerts via mail. But my requirement is to direct all the mails to Business workplace inbox in ECC.

    This is regarding CBMA in single stack SAP PI 7.3.1. I have set up the alert mail using default java mail client.I do receive the alerts via mail. But my requirement is to direct all the alert mails to Business workplace inbox in ECC.
    So I need to set up PI to redirect mails to ECC Business workplace user inbox (sbwp). From here rules are set up & routed per distribution list.
    Please guide me how I can achieve this requirement.

    Hi,
    yes, it is a little bit different. This is the issue.....  
    But I am not sure if your links will help:
    1) /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
    is about a different solution. I do not need to count the number of lines of the source message.
    And the second variable is about concat line by line from unbound node to unbound node.
    My issue is:
    Souce:
    Message line (0...unbound) ! ! ! ! ! ! ! !
    .    ResultLine   (1..1)
    Mapping:
    =>   ResultLine1
           ResultLine2
           ResultLine........          => into UDF to an element  (1..1) in one mapping operation.
    So that all "ResultLine"s are included.
    The result is explained in the given link for Mail attachment with UDF.
    So I am not sure how to use this thread for my issue.
    In the comments of that blog Christoph Gerber writes that the new variable feature can only handle single values.
    So it is not suitable for my purposes as I have a list of values here that needs to be moved into the target message field.
    2) http://wiki.sdn.sap.com/wiki/display/Java/UsingEditJavaSectioninMessageMapping
    shows where to find the button "Java section" which is not available here in 7.1
    3) /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
    too is about the nice little button for Java Section that is no longer existing on PI 7.1 screen for mappings.  
    So my issue is: How to replace the Java section function with global variables in PI 7.1?
    Best regards
    Dirk

  • How can I use Seeburger java functions on SAP XI's user defined functions?

    Hi All,
    As my title implies; how can I use Seeburger java functions on SAP XI's user defined functions?  I've tried searching over the net in tutorials regarding this topic but I failed to find one; can someone provide me information regarding my question? thanks very much.
    best regards,
    Mike

    Hi Mike !
    You should check your documentation about which java classes you need to reference in the "import" section of your UDF. And also deploy the java classes into the java stack or include them as a imported archive in integration repository...it should be stated in the seeburger documentation.
    What kind of functions are you trying to use?
    Regards,
    Matias.

  • Can we use Essbase JAVA API in Hyperrion Planning

    Hi,
    I want to load data and extract data from Hyperion Planning applications. can i use Essbase Java APIs to do this Or is there any separate set of APIs available for Planning Applications ?
    Thanks a lot,
    Prince

    Hi John,
    I have following doubts regarding loading data to Hyperion planning by a custom connector
    1) Loading data to Hyperion Planning application using Essbase Java API would be possible at application layer (Hyperion Planning) or at database layer (loading data directly to essbase database) ?
    2) If we load data directly to essbase database how are we going to recognize which essbase server is connected with Hyperion Planning application ? Does user require to know in advance the underlying databse server ? Is there any API in Essbase or in Planning to connect to Planning application ?
    3) If we load data directly to essbase database how to find out Planning applications and essbase application ? In other words how to differentiate between essbase applications and Hyperion Planning appllications ? Or How to recognize Planning applications ? Is there any API in Essbase to find out this ?
    4) If we read data directly from Essbase how do we recognize data from a Planning application ?
    5) What is the difference between Classic planning application and EPMA planning application ? Can we develop a connector to work with both these flavour or type ?
    Please suggest.
    Thanks,
    Prince

  • Can I use j2ee in gprs mobile phone?

    How can I use j2ee in gprs moblie phone?

    Actual mobile phone are unlikely to support J2EE themselves as this is mostly server-side technology.
    You can get phones though that support J2ME, these can the communicate with a server running J2EE technologies.
    I'm not sure however if any gprs phones yet support J2ME, and it also depends on where you live.
    Try looking in the devices section at www.microjava.com

  • TS1398 I can't use my yahoo mail.  it says to turn private browsing off. it says to go to settings, safari, private browsing.  mind dosen't have private browsing.

    I can't use my yahoo mail.  it says to turn private browsing off. it says to go to settings, safari, private browsing.  mind dosen't have private browsing.

    Make sure Private Browsing is off.
    Tap "Private" on Safari Screen to disable Private Browsing. When top of screen is white, Private Browsing is off.

  • HT4864 Can you use Windows Live Mail to send/recieve iCloud email and share contacts or can I just use iCloud email on my PC without use Live Mail?

    Can you use Windows Live Mail to send/recieve iCloud email and share contacts or can I just use iCloud email on my PC without use Live Mail? I want to use one email adress, one contact list and one calendar. I want to be able to have access to all this on my iphone and pc.

    You can only use Mail, contacts and calendars will not work, for that you need Outlook.

  • Can't use iPhone and Mail at the same time

    When my iPhone is on I can't receive Apple Mail on my computer. I get an error message on the computer that says another client is using the mail (or something to that effect). If I turn off the iPhone the error message usually disappears on my computer allowing me to access mail. Is there something I can do so I can keep my iPhone on and also get Apple Mail at the same time?

    Never seeing this problem.
    Are you using a MobileMe IMAP account or another provider and account? Is problem when using the Apple Mail application in OS 10.4.11 on your listed G5?
    Ernie

  • Can I use JavaMail without Mailing Server??

    Dear All,
    My name is Jonathan Wong, a final year student.
    I am going to develop an internet application for my final year project that contains a part to sent e-mails by using JavaMail.
    Can I use JavaMail without setting up any Mail Server?? If no, can I use the ISP one?? Also, how can I retreive the mailing list from database to JavaMail?? Please advise.
    Thanks in advance.
    Best Wishes
    Jonathan

    You dont neend to set up a Mail server , You just have to connect to the desired mail server to send and retreive mails............. You should read the Javamail Api , you will find all the classes and required methods there ,, to retreive and send emails........

  • Can't use my mac mail

    Okay, so I really need some advice. Because the gmail account I once had connected to my mac mail is now deleted, so I can therefore not use my mac mail at all. And I'm wondering if there's some way to fix this and set up my mac mail and connect it with another email account.
    I'd be really grateful if you'd have some advice to give.

    iCloud is not supported on 10.6.8, the minimum is Lion 10.7.2.
    You can make mail work by manually entering the account however:

  • What email can be used on Apple Mail?

    Can I use hotmail or googlemail on Apple Mail?

    Hi.
    Yes, you can use Gmail, just follow these steps.
    Regarding Hotmail, you need to install a third-party mail plugin, httpmail, but it may not work with some recent Hotmail accounts.
    Good Luck.

  • Can I FAX with JAVA MAIL??

    Any body can help me with some key code to fax with my Java mail?? What are the other requirements apart from JAVA MAIL API???
    Thanking you
    Achintya

    Hello! Achintya, what I know is you need to hv a service provider to convert yr e-mail into fax format & send to the destination.
    iSam
    [email protected]

  • How can i  use  this  java program to access from  a jsp page?

    import java.io.*;
    import java.util.*;
    public class FileProcessing
      //create a vector container  for the input variables
         Vector variables = new Vector();
      //create a vector container for the constants
         Vector constants = new Vector();
      /*create a string expression container for the equation
         as read from the file */
         String expression = " ";
      //create double result container for the final result
         double result = 0;
         public boolean processFile(String filename,String delim)
          //index for values vector
              int num_values = 0;
          //index for constants vector
              int num_constants = 0;
          //current line being read from the external file.
              String curline = " ";
          //start reading from the external file
              try
                   FileReader fr = new FileReader(filename);
                   BufferedReader br = new BufferedReader(fr);
                   while(true)
                        curline = br.readLine();
                        if(curline == null)
                             break;
                    //determine the type of current interaction
                        boolean variable = curline.startsWith("input");
                        boolean constant = curline.startsWith("constant");
                        boolean equation = curline.startsWith("equation");
                        boolean output = curline.startsWith("result");
                   //on input variables
                        if(variable)
                          StringTokenizer st = new StringTokenizer(curline,delim);
                          int num = st.countTokens();
                          int count=0;
                          while(st.hasMoreTokens())
                               String temp = st.nextToken();
                               if(count==1)
                                    byte b[]= new byte[100];
                                    System.out.println(temp);
                                    System.in.read(b);
                                    String inputval = (new String(b)).trim();
                                    variables.add(num_values,inputval);
                                    num_values++;
                               count++;
                        // on constant values
                        if(constant)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==1)
                                       byte b[]= new byte[100];
                                       System.out.println(temp);
                                       System.in.read(b);
                                       String cons = (new String(b)).trim();
                                       constants.add(num_constants,cons);
                                       num_constants++;
                                  count++;
                        // on equation
                        if(equation)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==2)
                                       this.expression = temp;
                                  count++;
              // now we are ready to evaluate the expression
                       if(output)
                          org.nfunk.jep.JEP  myparser= new org.nfunk.jep.JEP();
                          myparser.setAllowAssignment(true);
                          for(int i=1;i<variables.size()+1;i++)
                             String name = "arg"+Integer.toString(i);
                             myparser.addVariable(name,new Double(variables.get(i-1)
                                                .toString()).doubleValue());
                          for(int i=1;i<constants.size()+1;i++)
                               String name = "arg" +Integer.
                                         toString(i+variables.size());
                               myparser.addConstant(name,new Double(constants.get(i-1).toString()));
                   //output is obtained as follows
                          myparser.parseExpression(expression);
                          result = myparser.getValue();
                          System.out.println("Assay value: "+result);
              catch(Exception e)
                   System.out.println(e.toString());
              return true;
         public static void main(String[] args)
              FileProcessing fp = new FileProcessing();
              fp.processFile("input.eqn",":");
    }here i need to generate the strings like 'enter value1' and respective text boxes dynamically . i should use this java program as business logic and a jsp page for view.
    following given is my text file input.eqn
    input:enter value1:arg1
    input:enter value2:arg2
    input:enter value3:arg3
    constant:enter constant1:arg4
    constant:enter constant2:arg5
    equation:enter equation:(arg1+arg2)*(arg3+arg4)*arg5
    result:

    Why do you double post ? http://forum.java.sun.com/thread.jspa?threadID=646988&tstart=0
    Why dint that answer satisfy you ? And why dint you say so in that thread rather than posting the same question again ?
    ram.

  • How can I use a Java program to write an executable Applescript

    I'm using a PC with Windows XP. I'm a private developer. I've written a project in Java and wish to deploy it to other people using email. I've written an Install program (the Main-Class) and successfully packed this in a jar file with the project class files and some data files all as described in the deployment trail in the Java Tutorials. A recipient with a Mac with OS X downloads the jar file and runs it to install the project class files and some data files. The install program then writes an Applescript file (Vocab.scpt shown below) on the Desktop to make starting my downloaded program easier but it doesn't seem to work and I think it may be because the script file is not "executable". Could this be the case? If so, how could I change my install program to make the script file executable or alternatively use some other system to start the downloaded program?
    Vocab.scpt:-
    # Script to start: Vocab Version: 1.0.0
    do shell script "cd /Applications/Vocab; Java Vocab"
    Many thanks for your interest. Unfortunately I don't have a Mac to experiment with this problem and although I have spent some days on and off trying to find an answer in the mass of information available on Apple's website I can only find small clues here and there to answer my problem (which I would have thought was quite a common one). In Windows a batch file (eg. Vocab.bat) is automatically executable.

    I didn't expect you to have your customer run the command. I would expect you to create the executable and install it. However, there wouldn't be any difference in what you are creating and the .jar file. Either way it is a faceless icon. For that matter, it is no different than a batch file on Windows. I'm not sure what they wouldn't understand with, "copy the Vocab.jar file to wherever you want and double-click it to run the program." In addition, you probably ought to point out that Java is not installed on Mac OS X Lion (10.7.x) and when they double-click the jar file (or whatever you send them), the system will ask if they want to install Java.
    What you really need to do is package up the app inside a Mac application package and provide the user with the application on a .dmg (disk image). Take a look here: http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Jar_Bundle r/Introduction/Introduction.html#//apple_ref/doc/uid/TP40000884
    I also found this which uses ANT to create the bundle: http://informagen.com/JarBundler/

  • Can I use a different mail client to "Send a Copy" from Pages?

    One of my favorite Pages features is its ability to send someone a copy of your document in Pages, Word, PDF, or ePub format via email with only a couple clicks in the "Share" button. But this feature only works if Mail, Apple's email client, is set as the default email client for your Mac. Because I use Unibox as my email client, I'm unable to take advantage of the "Send a Copy" feature in Pages. Is there a work around for this or a settings file within the system I can tweak to allow me to use a mail client other than Apple Mail to "Send a Copy" from Pages? Thank you!

    No, I haven't heard that. YOu have to do it the old fashion way and attach a document in your mail client before sending the mail.

Maybe you are looking for

  • Two Data Objects is one too much

    I got a field in a database named 'Date'. Now i want to get the date and formate it. For both operations i need the packages java.sql (for database) and java.text.SimpledateFormatter (to formate the date). Now i get the errror message that java don't

  • Why doesn't Adobe see my printer?

    I cannot print my PDF files. I have a new Toshiba laptop, use Windows7, and just downloaded the latest version of Adobe. When I select Print, the default printer is a Lexmart 800. I don't have that printer. The only printer I have installed ( I check

  • Status of an action PPF

    Hi, I used an action definition and it is called successfully when I save a document. But the status of this action is generated in error (red icon) although rp_status = 0 in my implementation. I want to make this action as unprocessed (Yellow icon).

  • How to create a button?

    Hi all, I need to create a buuton in a pallete in incopy application is it possible??? i have to do some actions in incopy document with that button. what all are the ways to do it???? By Oviya..

  • Trouble syncing Wi-Fi network passwords via Keychain

    I'm having a few issues getting my iPhone, iPad and my MacBook Pro to correctly sync Wi-Fi network passwords via iCloud Keychain – it's sporadic at the best of times. I've had this happen in the past and sometimes resetting the keychain (as well as t