Pop3S using custom truststore

Greetings,
I'm currently trying to connect to an email folder via pop3s using javamail API.
I have no problem doing so with this simple code:
props.put("mail.pop3s.timeout", timeout);
props.put("mail.pop3s.connectiontimeout", timeout);
session = Session.getDefaultInstance(props, null);
store = session.getStore("pop3s");
store.connect(server, port, userName, password);
debugLogger.debug("connected");
folder = store.getFolder("INBOX");
folder.open(Folder.READ_WRITE);but this does work only for gmail, as it's certificate is already trusted in the cacerts of my JVM.
Problem is: my program must be able to connect to "any" pop3s folder. So, I thought I just could try removing the cacerts file from the /lib/security directory of my jre, thus ensuring that no "external" certificates will come in my way.
This worked, making it impossible to connect to gmail (javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found) unless I "tell" my program to trust the certificate from gmail itself.
I already have a truststore containg the trustedCertEntry for gmail.com, but I don't see any way to tell the program to use it... I guess it's just a matter of setting some more props before connecting, but I can't find any documentation on how to do so, the names of the props I should use, and so on...
any help?

Unfortunately, this is more difficult than it should be. You'll need your own
socket factory, which will allow you to create your own trust manager, which
will allow you to accept any cert. Of course, doing so significantly reduces
the security you're getting by using SSL.
See SSLNOTES.txt, included with JavaMail.

Similar Messages

  • How to use custom truststore?

    Hi, I've written a simple ssl client (basing on jakarta commons httpclient project) that connects to IIS with SSL and it works only i f I add ssl certificate from IIS to the jre cacerts (using keytool import). The cacerts are automatically readed somehow (don't know how)
    I want to make the whole thing more elastic and be able to provide my client with a path to cacerts / truststore / keystore. Am I doing it OK? I Currently it works...
    BUT the loops that print certificates and trustores to screen are empty - for example keystore               .getCertificateChain(alias); always returns null....
    But IIS cert is inside
    C:\\Program Files\\Java\\jre1.5.0_09\\lib\\security\\cacertsbbb
    PS. I would like to avoid setting System properties in my code like System.setTruststore etc.
    PS. Should be without sockets. Just extension of what i got.
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.InetAddress;
    import java.net.InetSocketAddress;
    import java.net.MalformedURLException;
    import java.net.Socket;
    import java.net.SocketAddress;
    import java.net.URL;
    import java.net.UnknownHostException;
    import java.security.GeneralSecurityException;
    import java.security.KeyStore;
    import java.security.KeyStoreException;
    import java.security.NoSuchAlgorithmException;
    import java.security.UnrecoverableKeyException;
    import java.security.cert.Certificate;
    import java.security.cert.CertificateException;
    import java.security.cert.X509Certificate;
    import java.util.Enumeration;
    import javax.net.SocketFactory;
    import javax.net.ssl.HostnameVerifier;
    import javax.net.ssl.HttpsURLConnection;
    import javax.net.ssl.KeyManager;
    import javax.net.ssl.KeyManagerFactory;
    import javax.net.ssl.SSLContext;
    import javax.net.ssl.SSLSession;
    import javax.net.ssl.SSLSocketFactory;
    import javax.net.ssl.TrustManager;
    import javax.net.ssl.TrustManagerFactory;
    import javax.net.ssl.X509TrustManager;
    import org.apache.commons.httpclient.ConnectTimeoutException;
    import org.apache.commons.httpclient.params.HttpConnectionParams;
    import org.apache.log4j.Logger;
    import junit.framework.TestCase;
    public class SSLSocketClient extends TestCase {
         private URL keystoreUrl = null;
         private String mockKeystoreUrl = "C:\\Program Files\\Java\\jre1.5.0_09\\lib\\security\\cacertsbbb";
         private String keystorePassword = "changeit";
         private URL truststoreUrl = null;
         private String mockTruststoreUrl = "C:\\Program Files\\Java\\jre1.5.0_09\\lib\\security\\cacertsbbb";
         private String truststorePassword = null;
         private SSLContext sslcontext = null;
         public void testSSLSocket() {
              try {
                   SSLSocketClient client = new SSLSocketClient();
                   // client.createSocket("10.63.29.50", 443);
                   HttpConnectionParams params = new HttpConnectionParams();
                   InetAddress ia = InetAddress.getLocalHost();
                   // params.setParameter(arg0, arg1)
                   //client.createSocket("10.63.29.50", 443, ia, 444, params);
                   client.connect("10.63.29.50", 443, "/ssl2/index.html", params);
              } catch (ConnectTimeoutException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (UnknownHostException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         private static Logger log = Logger.getLogger(SSLSocketClient.class);
          * private static KeyStore createKeyStore(final URL url, final String
          * password) throws KeyStoreException, NoSuchAlgorithmException,
          * CertificateException, IOException { if (url == null) { throw new
          * IllegalArgumentException("Keystore url may not be null"); }
          * KeyStore keystore = KeyStore.getInstance("jks");
          * keystore.load(url.openStream(), password != null ? password
          * .toCharArray() : null); return keystore; }
         private KeyStore mockCreateKeyStore(final String url, final String password)
                   throws KeyStoreException, NoSuchAlgorithmException,
                   CertificateException, IOException {
              if (url == null) {
                   throw new IllegalArgumentException("Keystore url may not be null");
              InputStream keystoreStream = new FileInputStream(url);
              KeyStore keystore = KeyStore.getInstance("jks");
              keystore.load(keystoreStream, password != null ? password.toCharArray()
                        : null);
              return keystore;
         private KeyManager[] createKeyManagers(final KeyStore keystore,
                   final String password) throws KeyStoreException,
                   NoSuchAlgorithmException, UnrecoverableKeyException {
              if (keystore == null) {
                   throw new IllegalArgumentException("Keystore may not be null");
              KeyManagerFactory kmfactory = KeyManagerFactory
                        .getInstance(KeyManagerFactory.getDefaultAlgorithm());
              kmfactory.init(keystore, password != null ? password.toCharArray()
                        : null);
              return kmfactory.getKeyManagers();
         private TrustManager[] createTrustManagers(final KeyStore keystore)
                   throws KeyStoreException, NoSuchAlgorithmException {
              if (keystore == null) {
                   throw new IllegalArgumentException("Keystore may not be null");
              TrustManagerFactory tmfactory = TrustManagerFactory
                        .getInstance(TrustManagerFactory.getDefaultAlgorithm());
              tmfactory.init(keystore);
              TrustManager[] trustmanagers = tmfactory.getTrustManagers();
              for (int i = 0; i < trustmanagers.length; i++) {
                   if (trustmanagers[i] instanceof X509TrustManager) {
                        trustmanagers[i] = new AuthSSLX509TrustManager(
                                  (X509TrustManager) trustmanagers);
              return trustmanagers;
         private SSLContext createSSLContext() {
              try {
                   KeyManager[] keymanagers = null;
                   TrustManager[] trustmanagers = null;
                   if (this.mockKeystoreUrl != null) {
                        KeyStore keystore = mockCreateKeyStore(this.mockKeystoreUrl,
                                  this.keystorePassword);
                        //if (log.isDebugEnabled()) {
                             Enumeration aliases = keystore.aliases();
                             while (aliases.hasMoreElements()) {
                                  String alias = (String) aliases.nextElement();
                                  Certificate[] certs = keystore
                                            .getCertificateChain(alias);
                                  if (certs != null) {
                                       log.info("Certificate chain '" + alias + "':");
                                       for (int c = 0; c < certs.length; c++) {
                                            if (certs[c] instanceof X509Certificate) {
                                                 X509Certificate cert = (X509Certificate) certs[c];
                                                 log.info(" Certificate " + (c + 1) + ":");
                                                 log.info(" Subject DN: "
                                                           + cert.getSubjectDN());
                                                 log.info(" Signature Algorithm: "
                                                           + cert.getSigAlgName());
                                                 log.info(" Valid from: "
                                                           + cert.getNotBefore());
                                                 log.info(" Valid until: "
                                                           + cert.getNotAfter());
                                                 log
                                                           .info(" Issuer: "
                                                                     + cert.getIssuerDN());
                        keymanagers = createKeyManagers(keystore, this.keystorePassword);
                   if (this.mockTruststoreUrl != null) {
                        KeyStore keystore = mockCreateKeyStore(this.mockKeystoreUrl,
                                  this.truststorePassword);
                        //if (log.isDebugEnabled()) {
                             Enumeration aliases = keystore.aliases();
                             while (aliases.hasMoreElements()) {
                                  String alias = (String) aliases.nextElement();
                                  log.debug("Trusted certificate '" + alias + "':");
                                  Certificate trustedcert = keystore
                                            .getCertificate(alias);
                                  if (trustedcert != null
                                            && trustedcert instanceof X509Certificate) {
                                       X509Certificate cert = (X509Certificate) trustedcert;
                                       log.info(" Subject DN: " + cert.getSubjectDN());
                                       log.info(" Signature Algorithm: "
                                                 + cert.getSigAlgName());
                                       log.info(" Valid from: " + cert.getNotBefore());
                                       log.info(" Valid until: " + cert.getNotAfter());
                                       log.info(" Issuer: " + cert.getIssuerDN());
                        trustmanagers = createTrustManagers(keystore);
                   SSLContext sslcontext = SSLContext.getInstance("SSL");
    //               /sslcontext.
                   sslcontext.init(keymanagers, trustmanagers, null);
                   return sslcontext;
              } catch (NoSuchAlgorithmException e) {
                   log.error(e.getMessage(), e);
                   throw new RuntimeException("Unsupported algorithm exception: "
                             + e.getMessage());
                   // throw new AuthSSLInitializationError("Unsupported algorithm
                   // exception: " + e.getMessage());
              } catch (KeyStoreException e) {
                   log.error(e.getMessage(), e);
                   throw new RuntimeException("Keystore exception: " + e.getMessage());
                   // throw new AuthSSLInitializationError("Keystore exception: " +
                   // e.getMessage());
              } catch (GeneralSecurityException e) {
                   log.error(e.getMessage(), e);
                   throw new RuntimeException("Key management exception: "
                             + e.getMessage());
                   // throw new AuthSSLInitializationError("Key management exception: "
                   // + e.getMessage());
              } catch (IOException e) {
                   log.error(e.getMessage(), e);
                   throw new RuntimeException(
                             "I/O error reading keystore/truststore file: "
                                       + e.getMessage());
                   // throw new AuthSSLInitializationError("I/O error reading
                   // keystore/truststore file: " + e.getMessage());
         private SSLContext getSSLContext() {
              if (this.sslcontext == null) {
                   this.sslcontext = createSSLContext();
              return this.sslcontext;
         * Attempts to get a new socket connection to the given host within the
         * given time limit.
         * <p>
         * To circumvent the limitations of older JREs that do not support connect
         * timeout a controller thread is executed. The controller thread attempts
         * to create a new socket within the given limit of time. If socket
         * constructor does not return until the timeout expires, the controller
         * terminates and throws an {@link ConnectTimeoutException}
         * </p>
         * @param host
         * the host name/IP
         * @param port
         * the port on the host
         * @param clientHost
         * the local host name/IP to bind the socket to
         * @param clientPort
         * the port on the local machine
         * @param params
         * {@link HttpConnectionParams Http connection parameters}
         * @return Socket a new socket
         * @throws IOException
         * @throws IOException
         * if an I/O error occurs while creating the socket
         * @throws UnknownHostException
         * if the IP address of the host cannot be determined
         public void connect(final String host, final int sport, final String query,
                   final HttpConnectionParams params) throws IOException {
              HostnameVerifier hv = new HostnameVerifier() {
                   public boolean verify(String arg0, SSLSession arg1) {
                        System.out.println("Bartek: Hostname is not matched for cert.");
                        return true;
              URL wlsUrl = null;
              wlsUrl = new URL("https", host, Integer.valueOf(sport).intValue(),
                        query);
              System.out
                        .println(" Trying a new HTTPS connection using WLS client classes - "
                                  + wlsUrl.toString());
              HttpsURLConnection sconnection = (HttpsURLConnection) wlsUrl
                        .openConnection();
              SocketFactory socketfactory = getSSLContext().getSocketFactory();
              * HttpsURLConnection sconnection = new HttpsURLConnection( wlsUrl);
              sconnection.setHostnameVerifier(hv);
              //sconnection.setSSLSocketFactory((SSLSocketFactory) socketfactory);
              sconnection.setSSLSocketFactory((SSLSocketFactory) socketfactory);
              //sconnection.setHostnameVerifier(hv);
              tryConnection(sconnection, System.out);
         public static void tryConnection(HttpsURLConnection connection,
                   OutputStream stream) throws IOException {
              connection.connect();
              String responseStr = "\t\t" + connection.getResponseCode() + " -- "
                        + connection.getResponseMessage() + "\n\t\t"
                        + connection.getContent().getClass().getName() + "\n";
              connection.disconnect();
              System.out.print(responseStr);
    Message was edited by:
    herbatniczek

    1- By default, the jre will read the user's cacerts which runs the program.
    2- You can specify another cacerts this way :
    System.setProperty("javax.net.ssl.trustStore", my_trust);
    For the case 1 and 2, you need to put the certificate in the cacerts.. Or,
    3- You implement a custom TrustManager which, for example, accepts all certificates :
    class X509TrustManagerTrustAll implements X509TrustManager {
    public boolean checkClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isServerTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
    return null;
    public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    and you call it in the right place in the code you wrote (SSLContext,..)
    Hope it helps and deserves a duke star ;)

  • Tell JVM that it should use both default and custom truststores?

    Coming off [this question|http://forums.sun.com/thread.jspa?threadID=5408453] I have solved my problem by importing the entire cacerts keystore into my truststore along with the special certificates I need for SSL contacts with other remote servers.
    But this feels like a bit of a hack. Rather than doing this, I'd like to be able to tell the JVM "use this truststore but also look at the default when you're making an SSL request". Is there some way to do this with keytool? Or is there some simple way to set this "policy" up in my code? If so, a code sample would be a big help.
    Thanks.

    In fact, now I'm REALLY confused.
    Without messing with SSL contexts, that is, by defining -Djavax.net.truststore and -Djavax.net.truststore.password to point to a truststore file containing just the certificates I want to use, the system fails to trust a certificate that comes from cacerts. By importing all of cacerts and the non-standard certs with keytool, everything worked.
    But that seemed ugly so I went through all this and now am passing to SSLContext.init() both truststores (cacerts and the non-cacerts certs). I THOUGHT that solved my problem and it was solved - but then I read the javadocs (see above) and didn't understand why the problem was solved. I then tried the experiment of passing into SSLContext.init() JUST the truststore for the non-cacert certs and THAT STILL works without passing it the cacerts truststore.
    Thus it seems that the -Djavax.net.truststore mechanism and the one invoked by SSLContext.setDefault() are different which is not what I had assumed.
    Can someone explain this anomaly?

  • POP3Store and custom truststore

    Hi,
    I'm connecting to a pop3 server via SSL and the server does not necessarily have a trusted certificate. I want to give the user the possibility to supply a custom trustore to my app that contains the certificates to trust. How can I make the POP3Store to use this truststore ?
    I do not want to affect other processes running the in the JVM so only this one connection should use the truststore.
    cheers,
    Tex

    Hi,
    so I'm now providing a SSLSocketFactory to the connection but it still doesn't work:
    private SSLSocketFactory createSSLTestConfig()  {
            SSLSocketFactory sf = null;
            try {
                KeyStore trustStore = KeyStore.getInstance("JKS");
                trustStore.load(new FileInputStream("truststore.jks"), "password".toCharArray());
                // Set up key manager factory to use our key store
                KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
                kmf.init(trustStore, "password".toCharArray());
                TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("PKIX");
                trustManagerFactory.init(trustStore);
                TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();
                SSLContext sslContext = SSLContext.getInstance("TLS");
                sslContext.init(null, trustManagers, null);
                sf = sslContext.getSocketFactory();
            } catch (Exception e) {
                POP3Client.log.error("Could not initial SSL:" + e.getMessage());
            return sf;
        }Then I set the SSLSocketFactory as explained here: http://javamail.kenai.com/nonav/javadocs/com/sun/mail/pop3/package-summary.html
    Properties properties = new Properties();
    properties.put("mail.pop3s.host", host);
    properties.put("mail.pop3s.port", port);
    properties.put("mail.pop3.ssl.socketFactory", createSSLTestConfig());
    Session    emailSession = Session.getDefaultInstance(properties);
    pop3Store = (POP3Store) emailSession.getStore("pop3s");
    pop3Store.connect(...);but I get the ssl exception
    javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed:My truststore.jks contains the self signed certificate of the server.
    what am I doing wrong?

  • How to use customer extension table for schedule line for shopping cart ?

    Dear Experts,
    One of our client wants to have schedule lines in shopping cart item. I am thinking of using customer extension table at item level for shopping cart. Could you please help me on  how I should proceed with the appending the structures so that the end user can fill the shopping cart schedule line details?
    Which fields should I consider in such cases?
    Thanks and regards,
    Ranjan

    Hi.
    I guess you use SRM 7.0. Please go to IMG.
    SRM -> SRM Server -> Cross-Application Basic Settings -> Extensions and Field Control (Personalization) -> Create Table Extensions and Supply with Data
    Regards,
    Masa

  • Can we use custom RFC in creating models in Visual composer??

    Dear Experts,
    Can we use custom RFC in creating models in Visual composer??
    If yes, kindly provide some documents or links which would guide me how to achieve it.
    Warm Regards
    Upendra Agrawal

    Hi,
    Yes,you can do it.
    Configure the rfc and use like others Standard BAPI procedure.
    [https://www.sdn.sap.com/irj/scn/wiki?path=/display/vc/connectivity]
    Regards,
    Govindu

  • Excel data read from users and upload in to Oracle DB using custom webpart

    Hi Team,
    I need to get the excel date from user using file upload control and read the data from the excel using custom webpart and validate the each rows whether having the values or not and need to upload the data to the oracle database.
    Can you please let me know the best approach to read the data from excel using sharepoint custom webpart.
    Thanks,
    Mylsamy

    Hi,
    According to your post, my understanding is that you want to read excel data from the uploaded file and insert the data into Oracle Database.
    The following way for your reference:
    1.Create a Visual Web Part using Visual Studio.
    2. Add an asp.net upload control into the .ascx file.
    <div>
    <asp:FileUpload ID="fileupload" runat="server" />
    <asp:Button ID="btnUpload" runat="server" onclick="btnUpload_Click" Text="Upload" />
    </div>
    3. Add some logic methods into .ascx.cs file.
    protected void btnUpload_Click(object sender, EventArgs e)
    //read data and insert the data into Oracle database.
    4.We can create a web service for adding data to Oracle database, then consume this web service in the visual web part.
    More information:
    http://msdn.microsoft.com/en-us/library/ff597539(v=office.14).aspx
    http://manish4dotnet.blogspot.in/2013/02/upload-ans-read-excel-file-using-c.html
    http://msmvps.com/blogs/windsor/archive/2011/11/04/walkthrough-creating-a-custom-asp-net-asmx-web-service-in-sharepoint-2010.aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to get data for current week and previous week using customer exit in Bex.

    Hi everyone,
    I have a scenario in which I need to display data for current week and previous week (based on "sy_datum" the program has to calculate current week and previous week) in Bex using  Customer exit. I have created one variable in Bex Query Designer and I have written code for the variable in CMOD. But it is not working fine, (I know that we can do the same by using offset value in Bex). Can some one guide me how to achieve my requirement using customer exit.
    Thanks in Advance,
    G S Ramanjaneyulu.

    Hi krishna,
    Thanks for your quick reply, can you have a look at my code,
    case i_vnam.
    WHEN 'ZPWK_CWK'.
    ranges : pre_week for sy-datum.
    data : start_date type DATS,
           end_date TYPE dats .
    ************FM TO GET FIRST DATE OF CURRENT WEEK ************************
    CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
      EXPORTING
        DATE_IN  = sy-datum
      IMPORTING
        DATE_OUT = start_date.   " WEEK FIRST DATE
    end_date = START_DATE + 6.   " WEEK LAST DATE
    END_DATE   = START_DATE - 1.   " PREVIOUS WEEK END DATE
    START_DATE = START_DATE - 7.   " PREVIOUS WEEK START  DATE
    **********PREVIOUS WEEK DATES IN PRE_WEEK******************
    pre_week-SIGN   = 'I'.
    pre_week-option = 'BT'.
    pre_week-LOW    = START_DATE.
    pre_week-HIGH   = END_DATE.
    APPEND  pre_week.
    CLEAR : START_DATE,END_DATE.
    endcase.
    Regards,
    G S Ramanjaneyulu.

  • REPOST:Timing does not show up when using custom templates

    all,
    When I create an unstructured template and use it in a report with show timing set to true, the timing does not show up.
    any tips

    Correcting my previous reply,
    Timing will NOT show if you are using custom template.
    null

  • Interactive Report - search does not work when using custom authentication

    Apex 3.2.x
    I can authenticate fine with my custom authentication and all of my pages work okay except for one page that uses the Interactive Report feature. When I click 'Filter' then enter the column name, operation (contains, =, like, etc.) and the expression, then click the 'Apply' button, the page just re-displays and my filter information is missing?
    If I first login to Apex, select and run my application, the Interactive Report features work just fine. What's missing?

    More information:
    After login into my Apex workspace (development environment), when I display the Interactive Report and click debug I see this debug message:
    "using existing session report settings"
    When I login using my application's custom authentication and click debug I see this debug message:
    "creating session report settings as copy of public saved report"
    Based on this, it appears that my session info in not set correctly when using custom authentication... but I'm not sure what needs to be set.
    Edited by: user9108091 on Oct 22, 2010 6:44 AM

  • Populating the Addressee field using Customer Interface program

    Hello All,
    Can any body tell me how to populate the "Addressee" column in the HZ_Party_Sites table using Customer Interface Program. Which field should be populated in RA_Customers_Interface_All table inorder to populate the "Addressee" field.
    Thank you,
    Vijay

    You can post this thread in this
    Customers as well.
    Thanks
    GM

  • How can we use Custom MessageBox in SelectionChangedEvent of LongListSelector for Windows Phone 8

    Dear Sir/Madam,
    How can we use Custom MessageBox in SelectionChangedEvent of LongListSelector for Windows Phone 8.
    Actually my problem is that When i am using Custom  MessageBox in SelectionChangedEvent of LongListSelector,when i am click Open(Left Button) it's working fine and navigated correctly,But when i am Click the No(Right Button) then it stayed in same page
    but all that page is in stuckup i mean that page is not working and not doing any event.
    My C#.net Code
    private async void userPageLongListSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
    if (e.AddedItems.Count > 0)
    if (userPageLongListSelector.SelectedItem == null)
    return;
    if (dbTenMin == null)
    dbTenMin = new Database(ApplicationData.Current.LocalFolder, "tenMInDBSchema.db");
    await dbTenMin.OpenAsync();
    var res = (sender as LongListSelector).SelectedItem as _10Min._10MinClass.minUserPages;
    var resIndex = (sender as LongListSelector).ItemsSource.IndexOf(userPageLongListSelector.SelectedItem);
    string selectedPageName = res.userPages.ToString();
    string selectedPageDesignUser = res.pageDesignUser.ToString();
    int selectedIndex = resIndex;
    CustomMessageBox messageBox = new CustomMessageBox()
    Caption = "Message...!",
    Message = "This form need offline datalist,Please load now.",
    LeftButtonContent = "Open",
    RightButtonContent = "No"
    messageBox.Dismissed += (s1, e1) =>
    switch (e1.Result)
    case CustomMessageBoxResult.LeftButton:
    string uidAndpwd = _10MinClass._10MinStaticClass.csUidAndPwd.ToString();
    _10MinClass._10MinStaticClass.csDataListPageDetails = selectedPageDataDetailsForSchema.ToString();
    _10MinClass._10MinStaticClass.csAllDataLists = offlineDataBaseDataListNam;
    _10MinClass._10MinStaticClass.csNotCreatedSchemaNameOfDBList = notCreatedDataLists;
    userPageLongListSelector.SelectedItem = null;
    if (dbTenMin != null)
    dbTenMin.Dispose();
    dbTenMin = null;
    NavigationService.Navigate(new Uri("/10MinformDataList.xaml", UriKind.Relative));
    else
    NavigationService.Navigate(new Uri("/10MinformDataList.xaml", UriKind.Relative));
    break;
    case CustomMessageBoxResult.RightButton:
    break;
    case CustomMessageBoxResult.None:
    break;
    default:
    break;
    messageBox.Show();
    Same custom messagebox code working in Phone_BackKeyPress event i am writing the code in Right Button that e.OriginalSource.ToString(); then it is working fine.
    But It is not working in Selection Changed Event in LongListSelector control in Windows Phone 8.
    Please help me,as soon as possible.
    Thanks & Regards,
    SrinivaaS.

    What happens if you leave the implementation for LeftButton empty as well , does the page gets stuck in that case also, if you press left button?
    i.e.
    CustomMessageBox messageBox = new CustomMessageBox()
    Caption = "Message...!",
    Message = "This form need offline datalist,Please load now.",
    LeftButtonContent = "Open",
    RightButtonContent = "No"
    messageBox.Dismissed += (s1, e1) =>
    switch (e1.Result)
    case CustomMessageBoxResult.LeftButton:
    break;
    case CustomMessageBoxResult.RightButton:
    break;
    case CustomMessageBoxResult.None:
    break;
    default:
    break;
    messageBox.Show();
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • How to create a Language Branch using custom workflow?

    Hi,
    I’ve a requirement where I need to create a workflow process which will create a Language branch.  i.e I wanted to achieve the functionality using custom workflow as given in the docs: https://dev.day.com/docs/en/cq/current/administering/multi_site_manager.html#Managing the Translation of your Language Branches 
    As per the OOTB functionality,
    1.     If the target page is not exist in the Language branch, it will copy the reference page to target path.
    2.     If the target page is already exists, it will not create a copy of the reference.           
    After the translation, if we make any changes in the reference page and activate the reference, then we have a button called 'Show side by Side' under Translation in the side kick which shows differences between reference page and translated page.
    Example:
    So, I would like know how we can achieve this in my custom workflow process. In my workflow process, I’m checking whether the page is existed in the target path or not. If not exist, I used page copy.
    Eg: Page page = newPage.copy(originalPage,targetPath+"/"+originalPageName,null,true,true );
    When I use above api, it just copies the page and it will not maintain any relation with reference page.
    Any pointers would be more helpful.
    Thanks
    Siva

    Hi,
    I have a similar request to export the texts from one language and after the translation to import them to the new language, did you find any solution? My question is how can I add some steps into my workflow to validate the imported data -and if the user validate the texts then proceed with next step(in my case I import the text from a file and generate a form with values). I read the documentation from Adobe but I didn't find anything related to how we can add a workflow to a dynamically generated from(I don't use the CQ form component).
    Can anybody help me with this?
    Thx, Lorand

  • How can I use custom WLST commands for Oracle SOA Suite in Weblogic

    Hi There,
    I'm trying to view and search the weblogic log files using WLST on a Solaris/Unix system.
    I have come across this "custom WLST commands for Oracle SOA Suite" and thought of using the custom logging commands to get my task done.
    However, my WLST shell is not recognizing the commands and giving me the NameError!
    wls:/devDomain1/domainRuntime> listLogs()
    Traceback (innermost last):
    File "<console>", line 1, in ?
    NameError: listLogs
    I tried the commands listLogs, displayLogs, getLogLevel & setLogLevel but in vain!
    I have followed the instructions as per the oracle recommendation of using Custom WLST commands (http://docs.oracle.com/cd/E29597_01/core.1111/e10105/getstart.htm#ASADM10692) as below
    - Launched the WLST shell from Oracle Home.
    cd ORACLE_HOME/common/bin
    ./wlst.sh
    - Tried to run the listLogs command from domainRuntime()
    I would like to know if I need to import any additional libraries to run the custom WLST commands for Oracle SOA Suite in my WLST shell?
    I have only weblogic 10.3.1 server installed on my Solaris 10 machine on which I have deployed the OSB application software.
    There is no SOA Suite installed.
    Or is there any other way I can browse the Server Log file and get the list of log messages? Basically I would like to use this feature in my script to customize it according to my requirement of listing specific error logs which I can work it out if I know how to make these commands work.
    Please advise if this is possible and how?
    Cheers.
    Satish

    I have tried on my OSB installation (no SOA Suite here), the command listLogs() works (I was in online mode, after a connect), and the classpath is:
    CLASSPATH=/opt/oracle/fmw11_1_1_5/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/fw11_1_1_5/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/lib/jvm/java-1.6.0-sun-1.6.0.33.x6_64/lib/tools.jar:/opt/oracle/fmw11_1_1_5/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/oracle/fmw11_1_1_5/wlserver_10./server/lib/weblogic.jar:/opt/oracle/fmw11_1_1_5/modules/features/weblogic.server.modules_10.3.5.0.jar:/opt/oracle/fmw111_1_5/wlserver_10.3/server/lib/webservices.jar:/opt/oracle/fmw11_1_1_5/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/optoracle/fmw11_1_1_5/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/opt/oracle/fmw11_1_1_5/oracle_common/moules/oracle.jrf_11.1.1/jrf-wlstman.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/lib/adfscripting.jar:/opt/oracl/fmw11_1_1_5/oracle_common/common/wlst/lib/adf-share-mbeans-wlst.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/lb/mdswlst.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/auditwlst.jar:/opt/oracle/fmw11_1_1_5/oracle_cmmon/common/wlst/resources/igfwlsthelp.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/jps-wlst.jar:/optoracle/fmw11_1_1_5/oracle_common/common/wlst/resources/jrf-wlst.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/reources/oamap_help.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/oamAuthnProvider.jar:/opt/oracle/fmw111_1_5/oracle_common/common/wlst/resources/ossoiap_help.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/osoiap.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/ovdwlsthelp.jar:/opt/oracle/fmw11_1_1_5/oracle_comon/common/wlst/resources/sslconfigwlst.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/wsm-wlst.jar:/optoracle/fmw11_1_1_5/utils/config/10.3/config-launch.jar::/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/derby/lib/derbynet.ar:/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/derby/lib/derbyclient.jar:/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/drby/lib/derbytools.jar::
    The wlst.sh I have used is /opt/oracle/fmw11_1_1_5/osb/common/bin/wlst.sh
    I hope this can help

  • DB polling using custom SQL in SOA Suite 11g

    Hi,
    We are trying to poll records from a database using custom sql. But all the records in the table are being picked up at the same time and not as per the polling frequency set in the adapter.
    Below is the configuration from the .jca file:
    <endpoint-activation portType="II_ptt" operation="receive">
    <activation-spec className="oracle.tip.adapter.db.DBActivationSpec">
    <property name="DescriptorName" value="II.OrderRequest"/>
    <property name="QueryName" value="IISelect"/>
    <property name="MappingsMetaDataURL" value="II-or-mappings.xml"/>
    <property name="PollingStrategy" value="DeletePollingStrategy"/>
    <property name="PollingInterval" value="60"/>
    <property name="MaxRaiseSize" value="10"/>
    <property name="MaxTransactionSize" value="10"/>
    <property name="SequencingColumn" value="REQUEST_SAK"/>
    <property name="NumberOfThreads" value="1"/>
    <property name="ReturnSingleResultSet" value="false"/>
    <property name="DeleteDetailRows" value="false"/>
    </activation-spec>
    </endpoint-activation>
    Please let us know if anything else needs to be set to enable the polling as per the frequency in the adapter.
    Thanks.

    As the link from Anuj said, you need to also configure 'Distributed Polling' in the wizard. This speed limit trick will no longer work out of the box in 11.1.1.3 on, you will also have to set usesSkipLocking="false" in your DbAdapter connection pool definition. Skip locking eliminates the locking contention issue, so this primitive kind of load balancing is no longer needed in that case.
    Thanks
    Steve

Maybe you are looking for