Use of DBlookup API and find particular receiver

Hi all,
The scenario is :
soap req -> XI -> req to external database -> resoponse from db to XI -> BAPI request -> response from BAPI to XI -> send response to SOAP Response
I found that DBlookup API (User defined function to get data from External Database) is very useful to achieve this scenario without BPM
now question is :
There are multiple SAP HR Systems, how can i determine particular HR system based on URL data received from external database?  Each SAP HR system uses same BAPI structure.
Also it will be great if anybody share any document or information regarding fetching data from external database.
Regards
Ritesh
Edited by: chintan patel on Apr 4, 2008 6:33 PM

I've to use BPM in this scenarion because eventhough I am getting data from external database I am not able to put condition on that fields. For example In this case I've to find out the particular SAP (receiver) system based on URL field, which is coming from the database. But in XPATH I am not able to fetch this URL. I can fetch only source structure fields. So BPM is the best soulution for this interface.
Thanks all for contributions. Appreciated
Chintan

Similar Messages

  • Pull large amounts of data using odata, client API and so takes a long time in project server 2013

    We are trying to pull large amounts of data in project server 2013 using both client API and odata calls, but it seem to take a long time. How is this done
    In project server 2010 we did this creating SQL views in both the reporting database and for list creating a view in the content database. Our IT dept is saying we can't do this anymore. How does a view in Project database or content database create issues?
    As long as we don't add a field in the table. So how's one to do this with creating a view?

    Hello,
    If you are using Project Server 2013 on premise I would recommend using T-SQL against the dbo. schema in the Project Web Database for your reports, this will be far quicker that the APIs. You can create custom objects in the dbo. schema, see the link below:
    https://msdn.microsoft.com/en-us/library/office/ee767687.aspx#pj15_Architecture_DAL
    It is not supported to query the SharePoint content database directly with T-SQL or add any custom objects to the content database.
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS |
    MVP | Downloads

  • I am using the MODBUS library and can't receive data, however I can send it just fine?

    Hi,
    I am using the Modbus Library to communicate with a VFD to control a fan. I am using the master write and read vi. I can write data to the VFD and get the fan to do what I want. The VFD is supposed to send a confirmation packet after I tell it to do something and I can also read its registers. When I debug the VI it shows the problem is the buffer always reads zero and the VI timesout. If I watch the lights of the USB to RS 485 adapter I am using to interface with the VFD, I see that the RX light flashs right after I send a message. So I should have something in the buffer. Does anyone have any suggestions?
    Aaron
    Solved!
    Go to Solution.

    Ok, heres what happened for anyone who has this problem. In the MB Serial Receive.vi The Bytes at Port property node was reading 0 even though there was something in the buffer. The program execution was then stuck in a loop till it timed out and never went on to read anything from the serial port buffer. I didn't spend too much time wondering why that VI didn't work and created my own. With an appropriate delay after writing to the serial port,  I used the same Bytes at Port property node and was able to get the right number of bytes to then feed the read VISA vi the number of bytes to read. I got the right response message and everything seemed good. But of course NOT! I then experimented with writing different speeds to the VFD to get the fan to run at different speeds. I found a small range of speeds where I would get no response from the VFD, either by it functioning or sending me a response packet. After quite some time, I found there is an error in the LRC-8 code in the MODBUS NI library. It does not mandate the LRC be a two character value. So if your LRC turns out to be a single character value such as F (which should be 0F)  you get an incomplete MODBUS message. This was easily fixed in the LRC8 vi by telling the 'number to hexidecimal string' vi to produce an output with a minimum width of two. Then everything worked great. Moral of the story is the MODBUS library is clunky.

  • Any one uses javax.print API and works?

    I have just downloaded 1.4 beta2 SDK and imported all the javax.print classes. I use the most simple test code as the following:
    FileInputStream fis = new FileInputStream("test.txt");
    try {
    DocFlavor psInFormat = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
    Doc myDoc = new SimpleDoc(fis, psInFormat, null);
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    aset.add(new Copies(1));
    aset.add(MediaSizeName.ISO_A4);
    aset.add(Sides.ONE_SIDED);
    PrintService[] services = PrintServiceLookup.lookupPrintServices(psInFormat, aset);
    if (services.length > 0) {
    DocPrintJob job = services[0].createPrintJob();
    job.print(myDoc, aset);
    } catch (Exception e) {System.out.println(e.getMessage());}
    However, PrintServiceLookup.lookupPrintServices can't find my printer. I have 9 network printers connected to my system which range from HP LaserJet 4500 to 8100 and Acrobat PDFWriter. The API can't find any of my printer? What did I do wrong

    Hi Guys,
    First,
    If your trying to print any document sent by the server from the client machine u have to write a applet which recieves the output in form of stream and then print it. I could do these with JPEG, GIF and ASCII but could not do it with PDF (The sun doesn't have a implementation for PDF document printing, they just have a declaration may future released will help us print PDF).
    If u want the Print dialog box to appear use the following code that worked fine for me.
    public class SomeClass
    public static void main(String args[]) throws Exception
    PrintRequestAttributeSet pras =     new HashPrintRequestAttributeSet();
    DocFlavor flavor = DocFlavor.INPUTSTREAM.GIF;
    PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras);
    PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();
    PrintService service = ServiceUI.printDialog(null, 200, 200,printService, defaultService, flavor, pras);
    if (defaultService != null)
    DocPrintJob job = defaultService.createPrintJob();
    FileInputStream fis = new FileInputStream("somefile.GIF");
    DocAttributeSet das = new HashDocAttributeSet();
    Doc doc = new SimpleDoc(byteArrayOutputStream, flavor, das);
    job.print(doc, pras);
    Thread.sleep(10000);
    If u do not want the dialog box to appear and just print to the default printer of the local machine use the following code
    public class SomeClass
    public static void main(String args[]) throws Exception
    PrintRequestAttributeSet pras =     new HashPrintRequestAttributeSet();
    DocFlavor flavor = DocFlavor.INPUTSTREAM.GIF;
    PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();
    if (defaultService != null)
    DocPrintJob job = defaultService.createPrintJob();
    FileInputStream fis = new FileInputStream("somefile.GIF");
    DocAttributeSet das = new HashDocAttributeSet();
    Doc doc = new SimpleDoc(byteArrayOutputStream, flavor, das);
    job.print(doc, pras);
    Thread.sleep(10000);
    Mean while if some body comes across any tweaks to print PDF documents using j2se1.4 please write to me at
    [email protected]
    Regards,
    Madhu

  • Developing Portals using JSR Compiant API and struts

    Hi,
    I am using Oracle AP Portal server 10.1.4 for development and all the existing portals are developed using Oracle PL/SQL. We have to convert all of them into JSR 168 Compliant (JPS API ) portlets using struts framework.
    Could you provide us ideas or code snippets or sample applications?
    It will be appreciated your responses as soon.
    Thanks
    Suren

    I may end up having to do that, but I'm trying to keep my solution set as it is as I apply a print layout using tiles to each of the reports and I would like to keep things that way if I can.
    I just noticed something interesting that I had not seen before, and that is in the PDF there is text rendered for the tiles tag <tiles:getAsString name="title" /> which tells me that the HttpURLConnection is getting the tiles attributes, but where it is failing is on the <tiles:insert attribute="body" /> tag. That at least narrows the problem down to the tiles:insert line specifically and not tiles overall.

  • (solved) When I try to use IE, Firefox opens and finds the site instead. How do I stop it?

    When I try to use IE, Firefox starts up and takes the address from IE and opens it in Firefox. I need to use both browsers. How do I stop this?

    I imagine you have Firefox set as the default browser. Unset that in firefox
    * Tools -> Options -> |Advanced| -> |General| -> system ... <br/>and uncheck the option to always check that Firefox is the default browser
    * now open IE and use IE's settings to set that as the default browser
    Now if for instance you open an internet link, or a HTML file on your Windows XP desktop they should open in IE
    Post back with how you get on.

  • Encrypt/Decrypt data, multiple public keys using Bouncy castle api?

    Hi all.
    I need to implement encrypt/decrypt functionality of some data with many public keys using bouncy castle api and EnvelopedData class in java 1.4 SE.
    Could someone give me examples how to do it. I searched whole the internet and i could not find simple example.

    Hi thanks very much.
    I had a quick look at the examples. I will see if they could help me.
    Here is more specific what i want:
    Encrypt data with multiple public keys that are kept in .pkcs12 file.
    And decrypt the data using coresponding private key after that.
    I must use bouncy castle api for java 1.4 se.
    Best regards
    Edited by: menchev on Nov 13, 2008 8:26 AM

  • JMS c API !! Process receiving SIGTERM ?

    Hi
    Im using JMS C api and writing a program.
    It is multi process system and IM receiving SIGTERM from nowhere.
    and my processes are aborting.
    I have my own handler for sigterm.
    Is Jms or any related component is using SIGTERM internally for any purpose (while disconnecting I think ) ???
    Plz Help me out ??
    Thanks

    I'm not a C expert but scanning the code for SIGTERM or signal doesn't bring up anything.
    Tom

  • Use both CAN APIs

    Hi,
    I am developing an application that talks to a microcontroller.  I would like to use the Frame API for setup where I can send commands and get responses, and would like to use the Channel API for a mode where I am simply monitoring messages that I receive from the micro.
    I have a state machine where I begin by opening the Frame API, have some different states that i go into which utilize the query/response aspect of the frame API and then a state which closes the Frame API and opens the Channel API.  The problem that I am having occurs when I have already closed the Frame API and started a read task with the channel API.  When I click the stop monitoring button, I exit the While loop which was reading a message defined in the Can DB (havn't actually had it read data yet) and execute the Channel APIs CAN Clear.VI i get the following error.
    Error - 1074388720 occured at CAN Initialize.vi
    Possible reasons:
    NI-CAN (Hex 0xBFF62110) You cannot use the Frame API and Channel API simultaneously on the same interface (such as CAN0).   tools in MAX use the Channel API.  Soultuon: Use a different interface with each API.
    I need a way to work around this and am not sure why the Frame API isn't seeming to be closed, especially since I have a state in my state machine to close the Frame API before I begin using the Channel API.
    If anyone has any suggestions please let me know.
    Thanks,
    Gary
    Solved!
    Go to Solution.

    sorry i will attach it all again so it can be run.  Use this VI.  it has a tab control.  when the program starts, the frame api is running and then you click stop and switch the tab to see the channel api running.  when you click the stop button on the channel api you should see the error.
    the error has been occurring every time, but when i just ran it, it didnt give that error.  I still think the problem exists and I see the problem in my real app that basically does the same thing.
    Attachments:
    Test for both APIs.zip ‏44 KB

  • Fetching all mails in Inbox from Exchange Web Services Managed API and storing them as a .eml files

    I want to fetch all mails in the Inbox folder using EWS Managed API and store them as .eml.
    I can store file once I get the file content as a byte[] will
    not be difficult, as I can do:
    File.WriteAllBytes("c:\\mails\\"+mail.Subject+".eml",content);
    The problem will be to fetch (1) all mails with (2)
    all headers (like from, to, subject) (I am keeping information of those values of from, to and
    other properties somewhere else, so I need them too) and (3)byte[]
    EmailMessage.MimeContent.Content. Actually I am lacking understanding of
    Microsoft.Exchange.WebServices.Data.ItemView,
    Microsoft.Exchange.WebServices.Data.BasePropertySet and
    Microsoft.Exchange.WebServices.Data.ItemSchema
    thats why I am finding it difficult.
    My primary code is:
    When I create PropertySet as
    follows:
    PropertySet properties = new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.MimeContent);
    I get following exception:
    The property MimeContent can't be used in FindItem requests.
    I dont understand
    (Q1) What these ItemSchema and BasePropertySet are
    (Q2) And how we are supposed to use them
    So I removed ItemSchema.MimeContent:
    PropertySet properties = new PropertySet(BasePropertySet.FirstClassProperties);
    I wrote simple following code to get all mails in inbox:
    ItemView view = new ItemView(50);
    view.PropertySet = properties;
    FindItemsResults<Item> findResults;
    List<EmailMessage> emails = new List<EmailMessage>();
    do
    findResults = service.FindItems(WellKnownFolderName.Inbox, view);
    foreach (var item in findResults.Items)
    emails.Add((EmailMessage)item);
    Console.WriteLine("Loop");
    view.Offset = 50;
    while (findResults.MoreAvailable);
    Above I kept page size of ItemView to
    50, to retrieve no more than 50 mails at a time, and then offsetting it by 50 to get next 50 mails if there are any. However it goes in infinite loop and continuously prints Loop on
    console. So I must be understanding pagesize and offset wrong.
    I want to understand
    (Q3) what pagesize, offset and offsetbasepoint in ItemView constructor
    means
    (Q4) how they behave and
    (Q5) how to use them to retrieve all mails in the inbox
    I didnt found any article online nicely explaining these but just giving code samples. Will appreciate question-wise explanation despite it may turn long.

    1) With FindItems it will only return a subset of Item properties see
    http://msdn.microsoft.com/en-us/library/bb508824(v=exchg.80).aspx for a list and explanation. To get the mime content you need to use a GetItem (or Load) I would suggest you read
    http://blogs.msdn.com/b/exchangedev/archive/2010/03/16/loading-properties-for-multiple-items-with-one-call-to-exchange-web-services.aspx which also covers of paging as well.
    3) offset is from the base your setting the offset to 50 each time which means your only going to get the 50 items from the offset of 50 which just creates an infinite loop. You should use
    view.Offset
    = +50;
    to increment the Offset although it safer to use
    view.Offset  += findResults.Items.Count;
    which increments the offset based on the result of the last FindItems operation.
    5) try something like
    ItemView iv = new ItemView(100, 0);
    FindItemsResults<Item> firesults = null;
    PropertySet psPropSet = new PropertySet(BasePropertySet.IdOnly);
    iv.PropertySet = psPropSet;
    PropertySet itItemPropSet = new PropertySet(BasePropertySet.IdOnly) { ItemSchema.MimeContent, ItemSchema.Subject, EmailMessageSchema.From };
    do
    firesults = service.FindItems(WellKnownFolderName.Inbox, iv);
    service.LoadPropertiesForItems(firesults.Items, itItemPropSet);
    foreach(Item itItem in firesults){
    Object MimeContent = null;
    if(itItem.TryGetProperty(ItemSchema.MimeContent,out MimeContent)){
    Console.WriteLine("Processing : " + itItem.Subject);
    iv.Offset += firesults.Items.Count;
    } while (firesults.MoreAvailable);
    Cheers
    Glen
    .Offset += fiFitems.Items.Count;

  • Problems while uploading files using the FileReference API

    I've built an image uploader module in Flex using the FileReference API and PHP.
    While this works perfect for images upto 1 MB, What I'm noticing is that for images greater that 1 MB even after the Event.COMPLETE  has triggered, the file hasn't yet been uploaded into the folder.. its only after a couple of seconds or minutes after the Event.COMPLETE,  that the image actually shows up in the FTP folder. Morever I also noticed that for such files the DataEvent.UPLOAD_COMPLETE_DATA that we are using to get feedback from PHP never gets called.
    I thought it would be related to the PHP script getting timed out... but the PHP script does get executed and the images do show up in the folder but thats way after the Event.Complete has been triggered and more importantly  DataEvent.UPLOAD_COMPLETE_DATA doesnt get called.
    Everything seems to work fine as long as the file size is under 1 MB
    Did others too face similar problems and any ideas on how to fix it?
    Thanks in advance

    I don't believe there is, as the browse button renders out as an html input type file component, and this has no ability to get native file size from the client. The only way to do it is to check the file size server side, but that kind of defeats the purpose to some extent, as the file is required to be uploaded before the file size can be checked.
    There is no way to do this on the client short of using a third party client side component - ie. java, flash or some other active component that gets file system level access.
    Ben

  • Error while using LiveCycle java APIs with Http servlets:"Remote EJBObject lookup failed for ejb/Inv

    Hi all,
    When i try to run more than one servelt of the Quick Start samples that using Livecycle Java APIs and i get an error of "Remote EJBObject lookup failed for ejb/Invocation provider" from any servelt i run.
    I try some Quick samples which is not servelts (java class) and it works fine, which makes me sure that my connection properties is true.
    Environment:
    The LiveCycle is based on "Websphere v6.1", and i use "Eclipse Platform
    Version: 3.4.1".
    i install "tomcat 5.5.17" to test the servelts in developing time through Eclipse.(only for test in developing time not for deploy on )
    The Jars i added in the classpath:
    adobe-forms-client.jar
    adobe-livecycle-client.jar
    adobe-usermanager-client.jar
    adobe-utilities.jar
    ejb.jar
    j2ee.jar
    ecutlis.jar
    com.ibm.ws.admin.client_6.1.0.jar
    com.ibm.ws.webservices.thinclient_6.1.0.jar
    server.jar
    utlis.jar
    wsexception.jar
    My code is :
    Properties ConnectionProps = new Properties();
    ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "iiop://localhost:2809");
    ConnectionProps.setProperty ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_ EJB_PROTOCOL);
    ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE,ServiceClientFa ctoryProperties.DSC_WEBSPHERE_SERVER_TYPE);
    ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "Administrator");
    ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
    ConnectionProps.setProperty("java.naming.factory.initial", "com.ibm.ws.naming.util.WsnInitCtxFactory");
    //Create a ServiceClientFactory object
    ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);
    //Create a FormsServiceClient object
    FormsServiceClient formsClient = new FormsServiceClient(myFactory);
    //Get Form data to pass to the processFormSubmission method
    Document formData = new Document(req.getInputStream());
    //Set run-time options
    RenderOptionsSpec processSpec = new RenderOptionsSpec();
    processSpec.setLocale("en_US");
    //Invoke the processFormSubmission method
    FormsResult formOut = formsClient.processFormSubmission(formData,"CONTENT_TYPE=application/pdf&CONTENT_TYPE=app lication/vnd.adobe.xdp+xml&CONTENT_TYPE=text/xml", "",processSpec);
    List fileAttachments = formOut.getAttachments();
    Iterator iter = fileAttachments.iterator();
    int i = 0 ;
    while (iter.hasNext()) {
    Document file = (Document)iter.next();
    file.copyToFile(new File("C:\\Adobe\\tempFile"+i+".jp i++;
    short processState = formOut.getAction();
    ...... (To the end of the sample)
    My Error was:
    com.adobe.livecycle.formsservice.exception.ProcessFormSubmissionException: ALC-DSC-031-000: com.adobe.idp.dsc.net.DSCNamingException: Remote EJBObject lookup failed for ejb/Invocation provider
    at com.adobe.livecycle.formsservice.client.FormsServiceClient.processFormSubmission(FormsSer viceClient.java:416)
    at HandleData.doPost(HandleData.java:62)
    at HandleData.doGet(HandleData.java:31)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    a

    I assume here that your application is deployed on a different physical machine of where LCES is deployed and running.
    Do the following test:
    - Say that LCES is deployed on machine1 and your application is deployed on machine2. Ping machine1 from machine2 and note the ip address.
    - Ping machine1 from machine1 and note the ip address.
    The two pings should match.
    - Ping machine2 from machine1 and note the ip address.
    - Ping machine2 from machine2 and note the ip address.
    The two pings should match.
    Usually this kind of error would happen if your servers have internal and external ip addresses.

  • How to access the SAP MDM destinations using mdm java api in 7.1

    hi,
    I have SAP MDM 7.1 SP11 and SAP Portal 7.3 and developing the custom webdynpro application using the  JAVA MDM API. I want configure the SAP MDM destinations in SAP Portal .
    How to access the MDM destinations in java code using API? and how to create the connection with MDM using the MDM destinations.
    Please provide the code for access the SAP MDM destinations in java code using MDM java api and creating the connection to MDM.
    Thanks

    Jun,
    Thanks for the reply and api information.
    I have got this api information from the following sap documentation. But i am looking for the code by implementing this class and creating the mdm connection.
    Creating an MDM Connection Using Java Code - SAP NetWeaver Master Data Management (MDM) - SAP Library
    if any thing can you share it.
    Thanks

  • Problem using Java Mail API with WLS 7.0

    Hi All,
    I am trying to use the Java Mail API provided by WLS 7.0. I have made the
    settings metioned in the WLS 7.0 docs. However when I try to run the program I
    am getting the following error:
    javax.naming.NoInitialContextException: Need to specify class name in environment
    or system property, or as an applet parameter, or in an application resource file:
    java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    46)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:283)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    The code that I have written is as follows
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
         public static void main(String args[])
              try
                   //Context ic = getInitialContext();
                   InitialContext ic = new InitialContext();
    /* My jndi name is "testSession" */
                   Session session = (Session) ic.lookup("testSession"); /* THE PROBLEM IS SHOWN
    IN THIS LINE */
                   Properties props = new Properties();
                   props.put("mail.transport.protocol", "smtp");
                   props.put("mail.smtp.host", "XX.XX.XX.XX");
    /* For security reasons I have written the ip add in this format */
                   props.put("mail.from", "[email protected]"); /* for security reasons i have
    changed the mail address */
                   Session session2 = session.getInstance(props);
                   Message msg = new MimeMessage(session2);
                   msg.setFrom();
                   msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("[email protected]",
    false));
                   msg.setSubject("Test Message");
                   msg.setSentDate(new Date());
                   MimeBodyPart mbp = new MimeBodyPart();
                   mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
                   Multipart mp = new MimeMultipart();
                   mp.addBodyPart(mbp);
                   msg.setContent(mp);
                   Transport.send(msg);
              catch(Exception e)
                   e.printStackTrace();
         }//end of main
    public static Context getInitialContext()
         throws NamingException
              Properties p = new Properties();
              p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              p.put(Context.PROVIDER_URL, "t3://localhost:7501/testWebApp");
                   p.put(Context.SECURITY_PRINCIPAL, "weblogic");
                   p.put(Context.SECURITY_CREDENTIALS, "weblogic");
              return new InitialContext(p);
    }//end of class
    Can anyone please tell me what is the problem. I thought that we cannot directly
    do
    InitialContext ic = new InitialContext();
    So I had written a method getInitialContext() as shown in the above piece of code,
    but that too did not work.
    Eagerly awaiting a response.
    Jimmy Shah

    You can use InitialContext ic = new InitialContext() only if you are using a startup class, servlet or a JSP i.e
    server side code.
    If you are using a java client you need to use Context ic = getInitialContext();
    Try this code
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
    public static void main(String args[])
    try {
    Properties h = new Properties();
    h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    h.put(Context.PROVIDER_URL, "t3://localhost:7001");
    Context ic = new InitialContext(h);
    Session session = (Session) ic.lookup("testSession");
    Properties props = new Properties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", "XX.XX.XX.XX");
    props.put("mail.from", "[email protected]");
    Session session2 = session.getInstance(props);
    Message msg = new MimeMessage(session2);
    msg.setFrom();
    msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse("[email protected]",false));
    msg.setSubject("Test Message");
    msg.setSentDate(new Date());
    MimeBodyPart mbp = new MimeBodyPart();
    mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp);
    msg.setContent(mp);
    Transport.send(msg);
    catch(Exception e)
    e.printStackTrace();
    }//end of main
    }//end of class
    We have shipped a javamail example in the samples\server\src\examples\javamail folder.
    Jimmy Shah wrote:
    Hi All,
    I am trying to use the Java Mail API provided by WLS 7.0. I have made the
    settings metioned in the WLS 7.0 docs. However when I try to run the program I
    am getting the following error:
    javax.naming.NoInitialContextException: Need to specify class name in environment
    or system property, or as an applet parameter, or in an application resource file:
    java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    46)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:283)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    The code that I have written is as follows
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
    public static void main(String args[])
    try
    //Context ic = getInitialContext();
    InitialContext ic = new InitialContext();
    /* My jndi name is "testSession" */
    Session session = (Session) ic.lookup("testSession"); /* THE PROBLEM IS SHOWN
    IN THIS LINE */
    Properties props = new Properties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", "XX.XX.XX.XX");
    /* For security reasons I have written the ip add in this format */
    props.put("mail.from", "[email protected]"); /* for security reasons i have
    changed the mail address */
    Session session2 = session.getInstance(props);
    Message msg = new MimeMessage(session2);
    msg.setFrom();
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("[email protected]",
    false));
    msg.setSubject("Test Message");
    msg.setSentDate(new Date());
    MimeBodyPart mbp = new MimeBodyPart();
    mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp);
    msg.setContent(mp);
    Transport.send(msg);
    catch(Exception e)
    e.printStackTrace();
    }//end of main
    public static Context getInitialContext()
    throws NamingException
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, "t3://localhost:7501/testWebApp");
    p.put(Context.SECURITY_PRINCIPAL, "weblogic");
    p.put(Context.SECURITY_CREDENTIALS, "weblogic");
    return new InitialContext(p);
    }//end of class
    Can anyone please tell me what is the problem. I thought that we cannot directly
    do
    InitialContext ic = new InitialContext();
    So I had written a method getInitialContext() as shown in the above piece of code,
    but that too did not work.
    Eagerly awaiting a response.
    Jimmy Shah--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5. I am receiving an error problem when doing the following -  I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive whe

    Hi, I am having a little trouble with exporting images to another drive and Catalogue and need some help if anyone can give me some advice
    I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5.
    I am receiving an error problem when doing the following -
    I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive where a Lightroom Catalogue has been created. In this Catalogue I have arranged for the images once exported to be moved to a different folder - I used the Auto Import process under the File dialogue box.
    When processing the Export I receive an error message for each of the images being exported indicating the following -
    Heading Import Results
    Some import operations were not performed
    Could not move a file to requested location. (1)
    then a description of the image with file name
    Box Save As                                  Box  OK
    If I click the OK button to each image I can then go to the other Catalogue and all images are then transferred to the file as required.
    To click the OK button each time is time consuming, possibly I have missed an action or maybe you can advise an alternative method to save the time in actioning this process.
    Thanks if you can can help out.

    Thank You, but this is a gong show. Why is something that is so important to us all so very, very difficult to do?

Maybe you are looking for

  • Problem with partitioning

    Hi all, In my organization, few tables were partitioned recently. But all the rows are going to default partition istead of going to the appropriate partition. So the appliclation team thinks that something wasn't done correctly - rows aren't distrib

  • I need effects or technical

    I'm making a video of extreme sports with a song of the dubstep genre. The image is according to the rhythm of the song in the video use the techniques of slow motion andreverse to give a touch of crazy to dubstep. But I would like to have another te

  • TS3367 When I answer my FaceTime for some reason the video shows up sideways.How do I fix this and turning the IPad don't fix it

    When I answered my FaceTime the video picture went sideways and half the size.Turning it does not help and the people on the other side say I show up in a very small box.How do I fix this?

  • Macbook says "service battery" but battery seems fine.

    I've had my macbook pro for 5 years .For the last 2 years it says "service battery," but the battery seems fine to me. With the screen dimmed, airport turned off, and using only MS word, it goes for about 100 minutes. Is there any risk involved with

  • No sound effects after iOS 5 upgrade

    After upgrading to iOS 5, my iPad 2 no longer has any sound effects. In Sounds settings, I can hear them, so mechanical aspects of playing sounds is not the issue. Regardless of the Notiication settings, there at no sound effects (no clicks, no ding