ADF Logging ,need one file per application

Hi , I used the ADF logging api and I saw all log information on AdminServer.log   . I need to have one file per application , ho it is possible ?
thanks

Hey,
You can follow the below link
http://adfandjdeveloper.blogspot.in/2013/07/use-adf-logger-in-adf-application.html
Thanks

Similar Messages

  • [svn:fx-trunk] 11575: Put default style declarations into one class per application or module.

    Revision: 11575
    Author:   [email protected]
    Date:     2009-11-09 11:34:57 -0800 (Mon, 09 Nov 2009)
    Log Message:
    Put default style declarations into one class per application or module.
    Generate all the default styles in one class instead of a class for each style. The name of the style class will be based on the application or module name. An application named ?\226?\128?\156foo?\226?\128?\157 will have a style class named ?\226?\128?\156_foo_Style?\226?\128?\157. The idea is to allow applications to be compiled with different themes and get their owns styles. Currently this is not possible because a global style in both themes will have the same class name, _globalStyle. Whatever class the top-level application loads the sub-applications and modules will have to use the same class because of the flash player first-class-in-wins rule. Now each application and module will have their own style class.
    QE notes: None.
    Doc notes: None.
    Bugs: SDK-22454
    Reviewer: Paul, Pete
    Tests run: checkintests, all mustella tests.
    Is noteworthy for integration: No.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22454
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.vm
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java

    Revision: 11575
    Author:   [email protected]
    Date:     2009-11-09 11:34:57 -0800 (Mon, 09 Nov 2009)
    Log Message:
    Put default style declarations into one class per application or module.
    Generate all the default styles in one class instead of a class for each style. The name of the style class will be based on the application or module name. An application named ?\226?\128?\156foo?\226?\128?\157 will have a style class named ?\226?\128?\156_foo_Style?\226?\128?\157. The idea is to allow applications to be compiled with different themes and get their owns styles. Currently this is not possible because a global style in both themes will have the same class name, _globalStyle. Whatever class the top-level application loads the sub-applications and modules will have to use the same class because of the flash player first-class-in-wins rule. Now each application and module will have their own style class.
    QE notes: None.
    Doc notes: None.
    Bugs: SDK-22454
    Reviewer: Paul, Pete
    Tests run: checkintests, all mustella tests.
    Is noteworthy for integration: No.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22454
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.vm
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java

  • Error - The file must match the template type. Upload one file per language

    hi,
    Error - The file must match the template type. Upload one file per language and territory combination.
    i am getting above error while registering RTF template in oracle application e -business suite using XML publisher admistrator responsibility.
    My work :
    i generated xml output using concurrent program.
    for this i used standard PO report,
    the executable name: POXPRPOP.
    i designed the template using MS Office word (for RTF template)
    for this :
    <?start: body?>
    <? for-each: G_Headers?>
    VENDOR:
    <?POH_VENDOR_NAME?>
    <?POH_VENDOR_COUNTRY?>
    PURCHASEORDER NO.
    <?POH_PO_NUM?>
    SHIP TO:
    <?C_COMPANY?>
    <?POH_SHIP_ADDRESS_LINE1?>
    <?POH_SHIP_COUNTRY?>
    BILL TO:
    <?C_COMPANY?>
    <?POH_BILL_ADDRESS_LINE1?>
    <?POH_BILL_COUNTRY?>
    <?end for-each?>
    <?end body?>
    saved this file as "Purchasing.rtf" on desk top
    i registered data definition
    name:purchase order data definition.
    code : short name of concurrent program.
    i try to create template Or register the template in oracle e-business suite.
    name: purchasing template
    code: concurrent program short name
    type : RTF.
    file : browse from desk top (purchasing.rtf)
    language:english
    territory: US.
    but i am getting above error
    could any one help to come out of this problem.
    thank you
    regarding,
    sai krishna@cavaya

    Hi,
    I am getting the error as
    The file must match the template type. Upload one file per language and territory combination.
    I have checked the template name. It doesn't exist already. Please help me.
    Thanks in Advance,
    Jeganathan

  • Writing to XMP file or one file per folder?

    I am about to start using LR2. Used to using PS and Bridge. I use DNG and tiffs, and jpgs. I am used to having one file per folder for bridge's info. I do NOT want an XMP file per picture file. How does LR2 do this? I have read a few posts about XMP files and such. Is there a setting to make one file per folder, or does LR2 make XMP files for each picture?

    >XMP sidecars are only created for proprietary raw files (eg CR2, NEF, etc) and only when you save metadata out to file.
    Good, so since I do not use proprierary RAW's, I am safe. Thanks. I do plan to save metadata to the files, so in the future, other programs can use it.

  • Need one file regarding 11.5.10.2?

    Hi All,
    As 11.5.10.2 has been removed from edelivery , I need one file that is data_dat216.zip from disk6, oraAppsDb because it has been corrupted in my media and I am unable to install the software, can anybody help me and if share this file his/her PC so I can download this file or any other way where I can get this file.Thanks
    Edited by: EBSNewBie on Oct 19, 2008 9:15 PM

    Hi,
    Please send me you email to [email protected]
    Thx,
    Ronald

  • I need ONE file ONLY

    After publishing a software simulation I get a folder created
    with six files. One html file 2k. One Flash Movie file .swf 2867kb.
    Three Fullmotion.swf files(537kb,2430kb and 244kb, respectively).
    Finally, one .js 1kb.
    When I publish the .swf without the Fullmotion.swf's then the
    file doesn't display properly. How do I get just ONE FILE
    ONLY!!!!!!! I am using Captivate 3.

    Hi John
    See if the thread linked below helps you achieve your goal.
    Click
    here to read the thread
    Cheers... Rick

  • Creating one file per each 50 Mb of data received from PI

    Hi Experts,
    I have a scenario JMS to FIle.I have to create separate files for each maximum of 50MB received by SAP PI.
    For example if PI receive 160 MB data then i have to create 4 files i.e 1st file with 50 MB file data ,2nd file with 50 MB file data ,3rd file with 50 MB file data and 4th file with 10 MB file data. How to acheive this any suggestion.
    Regards
    Deepak

    Hi Deepak,
    Following logic can be applied if and only if the data that you are receiving from JMS is binary one(not a structured). In that case, you can break your large binary data file into small small packets of any size.
    In SAP PI 7.30/7.31 this fuctionality is available in the File sender and receiver channel. You can directly use it if you are working on the PI 7.30/7.31.
    If you are not using 7.30/7.31 then you need to write a adapter module which does same functionality. Logic is simple:
    Step 1: Get the XI message payload and convert it into binaryStream object.
    Step2: find the length of binaryStream and then calculate the no.of packets that you want to create by dividing binaryStream size with packet's size that you want. eg. if main payload size is 160 MB and packet's size is 50 MB and no.of packets = 160/50 =3.2 round off to 3.
    Step 3: Divide the large file size 4 times with given packet size and put remaining data into last packet.
    Step5: change all the small binaryStream packet into Files and store them into target directory.
    Best Regards,
    RK

  • Insert multiple files onto a single track, not one file per track

    Hello,
    In both Audition CS5.5 and CS6, when the user inserts multiple files into a multitrack session, they are placed on multiple tracks. (As the help file says, "The files are inserted on separate tracks at the current time position"). Please change this to allow multiple files to be inserted onto a single track.
    I can understand the usefulness of the current behaviour in some scenarios, but there are other workflows in which the placement of multiple files on multiple tracks is a serious hindrance.
    E.g. In this thread, a user mentions needing to insert 10,000 individual files for dialogue editing and mixing.
    I also posted in that thread because my own workflow involves editing hundreds of individual files, which are single notes recorded for the production of virtual instruments.
    The reason why a "one-track multitrack" workflow is useful to me is that it allows great flexibility in processing multiple files individually or at once, comparing them, adding markers, fades, etc.
    It would also be useful when bringing in any audio that has been recorded in consecutive chunks - field recordings, concerts, Foley sessions, etc.
    In the thread, another user suggested inserting all the files onto a single track in Premiere Pro, then bringing that project into Audition as a multitrack session. Unfortunately this creates another problem for me, because it renames all the audio with the suffix "extracted". My workflow requires me to keep the original file names, because these are used downstream when mapping the recorded notes in the virtual instrument.
    Thanks for reading and please consider this for a future update.

    Just curious. Has there been an answer yet as to how to insert existing audio clips from a file to a waveform view in CS6. I create voiceovers or edit large interview files that require audio tones and sfx for my clients in production studios. The tones are inserted between takes as a courtesy tone to denote separation.  In the older versions of Audition, the function was as simple as mix/pasting an audio file, selecting insert or overlap, set the import level percentage and paste.  And each time this function was exercised, Audition would use the same settings you last used to reduce repetition of settings. Logical. That's all gone in CS6 ... so, to lay down a voiceover file for Comcast or any client, in waveform view (vs. Multitrack which is not necessary for single mono file editing) I have to go through unnecessary steps simple to select insert/mix paste>file>paste into existing wave form.
    Also, if I need to simply overlap a gasp over the last syllable of a phrase in a simple wave form, I don't appear to be able to do this.  I called Adobe for support on these function, but, they had not answers and simple said I couldn't change the workspace, and they had no other answers. Any help would be greatly appreciated if you have insight.

  • How to catch all logs to one file with rsyslog?

    Hi,
    I have this config in rsyslog:
    # cat /etc/rsyslog.conf
    # Minimal config
    $ModLoad imuxsock # provides support for local system logging
    $ModLoad imklog # provides kernel logging support
    $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
    $FileOwner root
    $FileGroup root
    $FileCreateMode 0640
    $DirCreateMode 0755
    $Umask 0022
    $WorkDirectory /var/spool/rsyslog
    $IncludeConfig /etc/rsyslog.d/*.conf
    # Un sol log
    *.* /var/log/missatges.log
    # Si hi ha notificacions crítiques (pànic), enviar per consola a tots els usuaris
    *.emerg :omusrmsg:*
    [root@serviedre ~]#
    but in 'missatges.log' there is no systemd-timesyncd output:
    # journalctl -n
    -- Logs begin at Fri 2010-01-01 01:00:05 CET, end at Mon 2014-12-08 18:33:08 CET. --
    Dec 08 18:31:20 serviedre systemd[162]: Starting Default.
    Dec 08 18:31:20 serviedre systemd[162]: Reached target Default.
    Dec 08 18:31:20 serviedre systemd[162]: Startup finished in 168ms.
    Dec 08 18:31:20 serviedre systemd[1]: Started User Manager for UID 0.
    Dec 08 18:31:44 serviedre systemd-timesyncd[129]: Using NTP server 86.59.80.170:123 (2.europe.pool.ntp.org).
    Dec 08 18:31:31 serviedre systemd[162]: Time has been changed
    Dec 08 18:31:31 serviedre systemd-timesyncd[129]: interval/delta/delay/jitter/drift 32s/-12.456s/0.115s/0.000s/+0ppm
    Dec 08 18:31:31 serviedre systemd[1]: Time has been changed
    Dec 08 18:32:03 serviedre systemd-timesyncd[129]: interval/delta/delay/jitter/drift 64s/+0.001s/0.113s/0.000s/+0ppm
    Dec 08 18:33:08 serviedre systemd-timesyncd[129]: interval/delta/delay/jitter/drift 128s/+0.004s/0.114s/0.001s/+15ppm
    [root@serviedre ~]# cat /var/log/missatges.log | grep drift
    [root@serviedre ~]#
    Why?
    Last edited by xanb (2014-12-17 09:54:50)

    This happens with a lot of info: `journalctl -b` prints:
    Dec 17 09:36:16 serviedre systemd[6276]: Received SIGRTMIN+24 from PID 6328 (kill).
    Dec 17 09:36:16 serviedre systemd[6277]: pam_unix(systemd-user:session): session closed for user root
    Dec 17 09:36:16 serviedre systemd[1]: Stopped User Manager for UID 0.
    Dec 17 09:36:16 serviedre systemd[1]: Stopping user-0.slice.
    Dec 17 09:36:17 serviedre systemd[1]: Removed slice user-0.slice.
    Dec 17 09:41:38 serviedre systemd-timesyncd[133]: interval/delta/delay/jitter/drift 2048s/-0.000s/0.099s/0.000s/+55ppm
    Dec 17 09:55:51 serviedre sshd[6333]: Accepted password for root from 172.26.0.7 port 35114 ssh2
    Dec 17 09:55:51 serviedre sshd[6333]: pam_unix(sshd:session): session opened for user root by (uid=0)
    Dec 17 09:55:51 serviedre systemd[1]: Starting user-0.slice.
    Dec 17 09:55:51 serviedre systemd[1]: Created slice user-0.slice.
    Dec 17 09:55:51 serviedre systemd[1]: Starting User Manager for UID 0...
    Dec 17 09:55:52 serviedre systemd[1]: Starting Session c2 of user root.
    Dec 17 09:55:52 serviedre systemd-logind[137]: New session c2 of user root.
    Dec 17 09:55:52 serviedre systemd[6335]: pam_unix(systemd-user:session): session opened for user root by (uid=0)
    Dec 17 09:55:52 serviedre systemd[1]: Started Session c2 of user root.
    Dec 17 09:55:52 serviedre systemd[6335]: Starting Paths.
    Dec 17 09:55:52 serviedre systemd[6335]: Reached target Paths.
    Dec 17 09:55:52 serviedre systemd[6335]: Starting Timers.
    Dec 17 09:55:52 serviedre systemd[6335]: Reached target Timers.
    Dec 17 09:55:52 serviedre systemd[6335]: Starting Sockets.
    Dec 17 09:55:52 serviedre systemd[6335]: Reached target Sockets.
    Dec 17 09:55:52 serviedre systemd[6335]: Starting Basic System.
    Dec 17 09:55:52 serviedre systemd[6335]: Reached target Basic System.
    Dec 17 09:55:52 serviedre systemd[6335]: Starting Default.
    Dec 17 09:55:52 serviedre systemd[6335]: Reached target Default.
    Dec 17 09:55:52 serviedre systemd[6335]: Startup finished in 143ms.
    Dec 17 09:55:52 serviedre systemd[1]: Started User Manager for UID 0.
    Dec 17 10:15:46 serviedre systemd-timesyncd[133]: interval/delta/delay/jitter/drift 2048s/-0.000s/0.100s/0.000s/+55ppm
    Dec 17 10:19:43 serviedre systemd[1]: Reloading.
    Dec 17 10:19:44 serviedre systemd[1]: Unknown serialization item 'subscribed=:1.0'
    but
    [root@serviedre ~]# tail /var/log/missatges.log
    Dec 14 18:33:12 localhost kernel: [ 4.959569] mmcblk0: p1
    Dec 14 18:33:12 localhost kernel: [ 6.833607] EXT4-fs (sda1): re-mounted. Opts: discard
    Dec 14 18:33:12 localhost kernel: [ 9.783482] EXT4-fs (sda8): mounted filesystem with ordered data mode. Opts: discard
    Dec 14 18:33:12 localhost kernel: [ 9.885975] EXT4-fs (sda5): mounted filesystem with ordered data mode. Opts: discard
    Dec 14 18:33:12 localhost kernel: [ 10.004117] EXT4-fs (sda6): mounted filesystem with ordered data mode. Opts: discard
    Dec 14 18:33:12 localhost kernel: [ 10.109992] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: discard
    Dec 14 18:33:12 localhost kernel: [ 10.243718] EXT4-fs (sda7): mounted filesystem with ordered data mode. Opts: discard
    Dec 14 18:33:12 localhost kernel: [ 10.596835] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: discard
    Dec 14 18:33:12 localhost kernel: [ 12.914250] sunxi_emac sunxi_emac.0: eth0: link up, 100Mbps, full-duplex, lpa 0x41E1
    Dec 14 18:33:22 localhost kernel: [ 23.247589] eth0: no IPv6 routers present
    [root@serviedre ~]#

  • Generation file per delivery date

    Hi experts,
    I would like to generate a file after creation of an order.
    Each line of the order can have a delivery date different. I would like generate so much file as delivery date but I don't know how.
    I know generate one file for all order but I would like to know how generate one file per delivery date?
    Any ideas please?
    Thank you
    Best regards
    Sarah

    Hi Sarah
    Here is a link to my dropbox
    https://www.dropbox.com/s/h94rep7u8l8rsga/Scenario_Export.zip
    where you can find a sample scenario which can help you in resolving this problem. After successful downloading you need to import it, adjust system used, check if it works (works for me using demo DB) and feel free to modify it.
    I don't have much time to refine it but it should be enough to give you idea on how you can select rows and store files to the filesystem using 'Store file' atom.
    Kind regards,
    Radek

  • How to make one file?

    I have basically 2 problems here
    a)When I do generate a signature using the enduser's privatekey,,I will be ending up with two files one signature file and other the original document,,I need one file which contains the signature as well as the original doc in readable format and also i can authenticate doc using the same signature presemt in that file.
    b)In PKI scenario shud i encrypt the doc(data) without signature or shud i encrypt the doc as well as the signature also?
    c)If i have the signature as separate entity how can i find out publickey attributes or any information of the public key using the signature that is there?
    Plz do repond asap with exaples if possible,
    thnx in advnce
    Subhash

    Yup...I need one more help i.e I was able to encrypt/decrypt using assymtric and symetric,,the flow was like this...I had a key pair...
    I generate a DES key then I create a cipher by the data string,,then i used to encrypt the des key and store it in the database...then again at the server i used to decrypt the symmetric key using the private key from the key pair and then descrypt the data...it was all well and fine..
    now instaed of string i tried MSword of MSEXCELL i wasnt able to do at ll..some suggested to do padding so i tried des/cbc/pkcs5padding...it was encryting well but again i was stuck while decrypting,,it was asking for IV parametr and all,,i tried a lot but wasnt out of it...
    now my question is shud i include the getIv byte even in the encrypted file also...???
    i wud like to paste the code,,plz help me...
    encryption part is
    import java.io.*;
    import java.security.*;
    import java.security.spec.*;
    import java.security.spec.X509EncodedKeySpec;
    import java.security.interfaces.RSAPrivateKey;
    import java.security.interfaces.RSAPrivateCrtKey;
    import java.security.interfaces.RSAKey;
    import java.io.*;
    import java.util.*;
    import java.io.BufferedInputStream;
    import java.io.DataInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.sql.*;
    import java.math.BigInteger;
    import java.security.cert.CertificateFactory;
    import java.security.cert.X509Certificate;
    import java.security.interfaces.RSAPrivateKey;
    import java.security.interfaces.RSAPublicKey;
    import java.security.Key;
    import java.security.KeyFactory;
    import java.security.Security;
    import java.security.spec.KeySpec;
    import java.security.spec.PKCS8EncodedKeySpec;
    import javax.crypto.Cipher;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.DESKeySpec;
    import org.bouncycastle.jce.provider.BouncyCastleProvider;
    public class FileEncrypt
    byte[] encryptedDESKey;
    // encryptPart variables
    KeyGenerator kg;
    Key key;
    Cipher cipher;
    RSAPublicKey rsaPublicKey;
    Cipher encryptCipher;
    // decryptedPart variables
    RSAPrivateKey priv;
    Cipher decryptCipher;
    byte[] decryptedDESKey;
    SecretKeyFactory skf;
    DESKeySpec desKeySpec;
    SecretKey sk;
    Cipher desCipher;
    public static void main(String args[]){
         String path = "C://USB//test.doc";
         String fileName = "C://USB//ENCtest.doc";
    FileEncrypt pk1 = new FileEncrypt();
    String encryptedPassword = pk1.encryptPart(path,fileName);
         Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    //XlEncrypt tt = new XlEncrypt();
    TxtFile profile = new TxtFile();
    try{
    DriverManager.registerDriver (profile.getDriver());
    con =DriverManager.getConnection (profile.getURLName(), profile.getUserName(), profile.getPassword());
    stmt = con.createStatement();
    con =DriverManager.getConnection (profile.getURLName(), profile.getUserName(), profile.getPassword());
    stmt = con.createStatement();
    stmt.executeUpdate("insert into test (pki) values('"+encryptedPassword+"')");
    }catch (SQLException e) {
    System.out.println (e.getMessage() + "Problem in getting connections");
    private String encryptPart(String path,String fileName){   
    Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    try{
    // create des key
    kg = KeyGenerator.getInstance("DES");
    key = kg.generateKey();
    // encrypt some data
    //cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
    cipher = Cipher.getInstance("DES");
    cipher.init(Cipher.ENCRYPT_MODE,key);
    //read in cert from file and get public key and decrypt des key
    rsaPublicKey = getRSAPublicKey("buyer");
    encryptCipher= Cipher.getInstance("RSA","BC");
    encryptCipher.init(Cipher.ENCRYPT_MODE,rsaPublicKey);
    encryptedDESKey = encryptCipher.doFinal(key.getEncoded());
         FileEncrypt tt = new FileEncrypt();
    String sd = tt.hexEncode(encryptedDESKey);
    int c;
    FileInputStream fis = new FileInputStream(path);
    StringBuffer fileBuffer = new StringBuffer();
    while((c=fis.read())!=-1){
    fileBuffer.append((char)c);
    String fileString = fileBuffer.toString();
    byte[] encword = cipher.doFinal(fileString.getBytes());
    String outFile = tt.hexEncode(encword);
    DataOutputStream out2 = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(fileName)));
    out2.writeBytes(outFile);
    out2.close();
    return sd;
    }catch(Exception e)
    System.out.println("<ERROR>\nIn encryptPart\n"+e.toString()+"\n</ERROR>");
    return null;
    /** This array is used to convert from bytes to hexadecimal numbers */
    static final char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7',
    '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
    * A convenience method to convert an array of bytes to a String. We do
    * this simply by converting each byte to two hexadecimal digits. Something
    * like Base 64 encoding is more compact, but harder to encode.
    public static String hexEncode(byte[] bytes) {
    StringBuffer s = new StringBuffer(bytes.length * 2);
    for(int i = 0; i < bytes.length; i++) {
    byte b = bytes;
    s.append(digits[(b & 0xf0) >> 4]);
    s.append(digits[b & 0x0f]);
    return s.toString();
    * A convenience method to convert in the other direction, from a string
    * of hexadecimal digits to an array of bytes.
    public static byte[] hexDecode(String s) throws IllegalArgumentException {
    try {
    int len = s.length();
    byte[] r = new byte[len/2];
    for(int i = 0; i < r.length; i++) {
    int digit1 = s.charAt(i*2), digit2 = s.charAt(i*2 + 1);
    if ((digit1 >= '0') && (digit1 <= '9')) digit1 -= '0';
    else if ((digit1 >= 'a') && (digit1 <= 'f')) digit1 -= 'a' - 10;
    if ((digit2 >= '0') && (digit2 <= '9')) digit2 -= '0';
    else if ((digit2 >= 'a') && (digit2 <= 'f')) digit2 -= 'a' - 10;
    r[i] = (byte)((digit1 << 4) + digit2);
    return r;
    catch (Exception e) {
    throw new IllegalArgumentException("hexDecode(): invalid input");
    // encryptPart private method
    private RSAPublicKey getRSAPublicKey(String userName){
    try{
    FileInputStream fis = new FileInputStream("C:/certificates/buyer/buyer.crt");
    BufferedInputStream bis = new BufferedInputStream(fis);
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    X509Certificate cert = null;
    while(bis.available() > 0){
    cert = (X509Certificate)cf.generateCertificate(bis);
    return (RSAPublicKey)cert.getPublicKey();
    catch(Exception e){
    System.out.println("<ERROR>\nTrying to get Public Key from cert\n"+e.toString()+"\n</ERROR>");
    return null;
    decryption part is
    import java.io.*;
    import java.security.*;
    import java.security.spec.*;
    import java.security.spec.X509EncodedKeySpec;
    import java.security.interfaces.RSAPrivateKey;
    import java.security.interfaces.RSAPrivateCrtKey;
    import java.security.interfaces.RSAKey;
    import java.io.*;
    import java.util.*;
    import java.io.BufferedInputStream;
    import java.io.DataInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.sql.*;
    import java.math.BigInteger;
    import java.security.cert.CertificateFactory;
    import java.security.cert.X509Certificate;
    import java.security.interfaces.RSAPrivateKey;
    import java.security.interfaces.RSAPublicKey;
    import java.security.Key;
    import java.security.KeyFactory;
    import java.security.Security;
    import java.security.spec.KeySpec;
    import java.security.spec.PKCS8EncodedKeySpec;
    import javax.crypto.Cipher;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.DESKeySpec;
    import java.io.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.security.*;
    import java.security.spec.*;
    import org.bouncycastle.jce.provider.BouncyCastleProvider;
    public class FileDecrypt
    byte[] encryptedDESKey;
    // encryptPart variables
    KeyGenerator kg;
    Key key;
    Cipher cipher;
    RSAPublicKey rsaPublicKey;
    Cipher encryptCipher;
    // decryptedPart variables
    RSAPrivateKey priv;
    Cipher decryptCipher;
    byte[] decryptedDESKey;
    SecretKeyFactory skf;
    DESKeySpec desKeySpec;
    SecretKey sk;
    Cipher desCipher;
    public static void main(String args[]){
         String inputFile = "C://Usb//ENCtest.doc";
         Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
         TxtFile profile = new TxtFile();
         String var="";
         try {
    DriverManager.registerDriver (profile.getDriver());
    con =DriverManager.getConnection (profile.getURLName(), profile.getUserName(), profile.getPassword());
    stmt = con.createStatement();
    con =DriverManager.getConnection (profile.getURLName(), profile.getUserName(), profile.getPassword());
    stmt = con.createStatement();
    rs = stmt.executeQuery("select pki from test");
    if(rs.next()){
    var = rs.getString("pki");
    }catch (SQLException e) {
    System.out.println (e.getMessage() + "Problem in getting connections");
         System.out.println(var);
         String encSymKey = var;
         FileDecrypt tpk = new FileDecrypt();
    String decryptedPassword = tpk.decryptPart(inputFile,encSymKey);
    //return decryptedPassword;     
    private String decryptPart(String inputFile,String encSymKey)
    try{   
    // get private key from file
    priv = getRSAPrivateKey();
    // decrypted des key
    int c;
    Security.addProvider(new BouncyCastleProvider());
    FileDecrypt t1 = new FileDecrypt();
    byte[] encryptedDESKey1 = t1.hexDecode(encSymKey);
    decryptCipher = Cipher.getInstance("RSA","BC");
    decryptCipher.init(Cipher.DECRYPT_MODE,priv);
    decryptedDESKey = decryptCipher.doFinal(encryptedDESKey1);
    // convert bytes back to des key
    skf = SecretKeyFactory.getInstance("DES");
    desKeySpec = new DESKeySpec(decryptedDESKey);
    sk = skf.generateSecret(desKeySpec);
    // decrypt the encrypted password
    //desCipher = desCipher.getInstance("DES/ECB/PKCS5Padding");
    desCipher = desCipher.getInstance("DES");
                   desCipher.init(Cipher.DECRYPT_MODE,sk);     
    //desCipher.init(Cipher.DECRYPT_MODE,sk);
    FileDecrypt obj1 = new FileDecrypt();
    FileInputStream fis = new FileInputStream(inputFile);
    StringBuffer encryptedFile = new StringBuffer();
    while((c=fis.read())!=-1){
    encryptedFile.append((char)c);
    String encFile = encryptedFile.toString();
    System.out.println(encFile);
    byte[] jk =obj1.hexDecode(encFile);
    String encVar = new String(desCipher.doFinal(jk));
    //String encVar = new String(desCipher.doFinal(jk));
    DataOutputStream out2 = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("C:/usb/dectest.doc")));
    out2.writeBytes(encVar);
    out2.close();
    //System.out.println(new String(desCipher.doFinal(jk)));
    return new String("subhash");
    }catch(Exception e){
    System.out.println("<ERROR>\nIn decryptPart\n"+e.toString()+"\n</ERROR>");
    return null;
    // decryptPart private method
    private RSAPrivateKey getRSAPrivateKey()
    try{
    File keyFile = new File("C:/certificates/buyer/buyerkey.der");
    DataInputStream in = new DataInputStream(new FileInputStream(keyFile));
    byte [] fileBytes = new byte[(int) keyFile.length()];
    in.readFully(fileBytes);
    in.close();
    KeyFactory kf = KeyFactory.getInstance("RSA");
    KeySpec ks = new PKCS8EncodedKeySpec(fileBytes);
    return (RSAPrivateKey)kf.generatePrivate(ks);
    }catch(Exception e){
    System.out.println("<ERROR>\nTrying to get Private Key from file\n"+e.toString()+"\n</ERROR>");
    return null;
    /** This array is used to convert from bytes to hexadecimal numbers */
    static final char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7',
    '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
    * A convenience method to convert an array of bytes to a String. We do
    * this simply by converting each byte to two hexadecimal digits. Something
    * like Base 64 encoding is more compact, but harder to encode.
    public static String hexEncode(byte[] bytes) {
    StringBuffer s = new StringBuffer(bytes.length * 2);
    for(int i = 0; i < bytes.length; i++) {
    byte b = bytes[i];
    s.append(digits[(b & 0xf0) >> 4]);
    s.append(digits[b & 0x0f]);
    return s.toString();
    * A convenience method to convert in the other direction, from a string
    * of hexadecimal digits to an array of bytes.
    public static byte[] hexDecode(String s) throws IllegalArgumentException {
    try {
    int len = s.length();
    byte[] r = new byte[len/2];
    for(int i = 0; i < r.length; i++) {
    int digit1 = s.charAt(i*2), digit2 = s.charAt(i*2 + 1);
    if ((digit1 >= '0') && (digit1 <= '9')) digit1 -= '0';
    else if ((digit1 >= 'a') && (digit1 <= 'f')) digit1 -= 'a' - 10;
    if ((digit2 >= '0') && (digit2 <= '9')) digit2 -= '0';
    else if ((digit2 >= 'a') && (digit2 <= 'f')) digit2 -= 'a' - 10;
    r[i] = (byte)((digit1 << 4) + digit2);
    return r;
    }catch (Exception e) {
    throw new IllegalArgumentException("hexDecode(): invalid input");
    plz do reply asap,,
    bye
    Subhash

  • Each batch of IDocs must create one file.

    Hi Experts,
    I am new to the PI. I am using PI 7.1. I am doing one scenario which is IDOC to file using FCC. I have devloped this interface. In Target side each idoc creats a unique file.
    But my output file should be,   Each batch of IDocs that PI processes must create one file. with date and time as part of the filename.
    Could you please help me how to crete a file like this.
    Thanks in well adwance.
    Regards
    Balu

    Thanks your replies. I am sorry to say this, The exact client requirement is:
    I have an Idoc to file scenario. Target side I am using FCC. The issue is only on file name which is creats by PI on target system The file name should have name along with only date. The output file name should be same with date. All coming files should be appended in that file itself. For making an history, each day I should maintain one file (Name along with date), Coming all files should append in that file itself.  I will have one file per day. If it already exists, it will be appended to. Please help me on this
    Thanks in Well adwance.
    Balagi

  • Multiple users logged into one server, each users printer has a different name, application needs ONE name to print to.

    Multiple users logged into one server, each users printer has a different name, application needs ONE name to print to. 
    I'm NOT in any way a Terminal Services expert and I need help trying to get an application program working in a multi-user environment.
    The issue is that the printer changes for every user that is logged in. The application needs to print NOT to the default printer, but to a "special" printer which is selected in the application... let's call it a label printer to simplify the explanation.
    You have your default regular printer, easy for the application to find that one, and then you have a special printer that labels get printed onto. The application needs to know what printer is the label printer. So we allow the user to select that in the
    application and the selection is stored in a config file in 
    C:\ProgramData\mfgr\prog\setting files
    I don't have access to the application so I can't change how this works.  
    In the "regular" world, selecting the label printer driver to use should be per machine, NOT per user. When a new user logs into a machine, the physical printer doesn't go "poof" and a new printer suddenly appear. Same printer for all
    users.
    Yet in terminal services, the physical machine is "merged" with the virtual machine on the server. And there can be many users logged in at the same time. So each users real machine (and real printer) is injected into the "fake" terminal
    services machine. The name of the printers is made unique for each user. So the printers DO go "poof" and change names depending on the user logged into terminal services.
    So user "A" logs in and sets up the application to print to "LabelPrinterForUserA" (or whatever the name of the printer happens to be), that setting is stored in the ProgramData subfolder, and all is well. Later, user "B" logs
    in, and when they print, the application tries to print to "LabelPrinterForUserA" which doesn't exist for user B or is only accessible by user A. If user B re-configures, that breaks it for user A. 
    SOLUTION 1: The way that /should/ work (in my mind) is that you define one "generic" printer in Terminal Services... call it "Virtual Label printer" and when the user wants to print to it, the print job gets re-directed back to whatever
    physical printer is actually connected to their local workstation. There is a map of virtual printer to actual printer depending on the current user. The application is told once to print to "Virtual Label Printer" for all users.
    SOLUTION 2: Or... there should be some way to make the ProgramData sub folders separate per user. E.g. when user "A" tries to access:
    C:\ProgramData\mfgr\prog\setting files
    they actually get 
    C:\UserData\UserA\AppData\mfgr\prog\setting files
    and user "B" gets
    C:\UserData\UserB\AppData\mfgr\prog\setting files
    So the question I have is: Does either of those solutions exist hidden somewhere in the setup of terminal server? Or is there another way around this issue that I don't know?

    I don't really have a "for sure" answer to this, but because people here can't seem to deal with a question that hasn't been answered I'll provide the best answer I did receive from ServerFault.com user Nathan:
    I can feel your pain with using old software on terminal servers ...the solution I've come up with definitely won't scale as it requires some manual configuration, but I've gotten this method to work with our label printers (which require to be
    printed to an LPT port...yep, that old).
    Share your USB-connected printers to the network on each machine. Then, have the user log in on aunique session for each of them
    (a TS account cannot be shared among computers for this to work) and install a network printer pointing to the USB one they shared. Try to use a DNS name to account for possible DHCP movements.
    After, it should work. Each user can do this since display names can be identical as long as the ports are different (which they are).
    This was clarified by the following series of comments:
    I think you are on to something here, and I originally advised the admin to do this. The problem he ran into is that it setup the printer names in the TS as "printer on usersworkstation"
    and he could not rename it except to change the "printer" to whatever. E.g. the "on userworkstation" remained. I believe there is another way of installing the printer which avoids this, but I can't find it. Ages ago, one used to do NET
    USE LPT2 \\computer\printer password /USER:domain\user /PERSISTENT:YES and then tell the driver to print to LPT2 –  James
    Newton Mar
    17 at 16:21   
    @JamesNewton That's actually the exact method we used. The way around the "network printer" part is to install it as local printer and map it to a TCP/IP port that way. –  Nathan
    C Mar
    17 at 16:28
    You mean in the case where the printers are TCP/IP connected and not local USB / LPT to the users workstation? That makes sense. Wonder if this will work for USB connected printers... –  James
    NewtonMar
    17 at 16:35   
    @JamesNewton You'd share the local printer on the client's PC then on the server connect via TCP/IP to it. You'd need static addresses or use DNS names if DHCP, though. –  Nathan
    C Mar
    17 at 16:51
    Ah. Yes. I see. Looks like the LPT thing should work even with a USB connected printer:superuser.com/questions/182655/… –  James
    Newton Mar
    17 at 17:09   

  • Custom logging, multiple apps in one file, different from server.log

    I have several applications running on my integration server. I would like to log from these apps to a single file (different file from server.log)
    I tried to use custom log4j logging, but there's a problem with the RollingFileAppender. Whenever a file is rolled, the backup copies are deleted. It probably happens because different classloaders load different apps and I configure the log4j in every app, but I don't understand classloaders.
    Here is a part of the log4j.properties file:
    log4j.appender.file=org.apache.log4j.RollingFileAppender
    log4j.appender.file.File=/path/log
    log4j.appender.file.maxBackupIndex=10
    log4j.appender.file.maximumFileSize=10485760and I configure the logger in every app by
    org.apache.log4j.PropertyConfigurator.configure( logPropertiesPath );(Is this wrong? Is it even possible to use one log file from different apps? The integration servers does it...)
    I don't need the log4j, if the internal logging can be set up to log app. messages to a different file and configured with a different layout pattern, it would be enough.
    Can anybody please help with my logging problem?

    I've tried this:
    I've put log4j.jar to the lib dir of the logicalhost and log4j.properties to another jar (my own) and put it to the lib dir too. I deleted the PropertyCOnfigurator.configure() line from the apps. Built it, manually deleted log4j.jar from the EARs. Then I deployed EARs, restarted the domain and ran the apps. They both logged to the same and correct file, but again the rolling didn't work. How is this possible? I thought that this way the IS should have one and only one instance of Log4j...

  • How to remove all log files at application end ?

    I need to remove all log files from database dir.
    Just the data file must be in database diretory after the application ends.
    I´v tried:
    1 - set_flags(DB_LOG_AUTOREMOVE, 1);
    2 - txn_checkpoint(0, 0, DB_FORCE);
    But ways one log file reminds.
    Any bory nows how remove all log files at application end ?
    I really need this. How can i do that in C++ ?
    Thanks,
    DelNeto

    Here's how I solved it
    // At end of app.
    // Commit tables.
    pdbParam     ->sync(0);
    pdbUser     ->sync(0);
    // Close tables.
    pdbParam     ->close(0);
    pdbUser     ->close(0);
    // Delete table objects.
    delete     m_pdbParam;
    delete     m_pdbUser;
    // Commit all changes to the database.
    penvDbEnv->txn_checkpoint(0, 0, DB_FORCE);
    penvDbEnv->close(0);
    delete penvDbEnv;
    // Remove all logs files comes here.
    DbEnv *penvDbEnv;
    penvDbEnv = new DbEnv(0);
    ui32EnvFlags = DB_CREATE |
    DB_PRIVATE |
    DB_INIT_LOCK |
    DB_INIT_LOG |
    DB_INIT_MPOOL |
    DB_THREAD |
    DB_INIT_TXN;
    // Open the environment with full transactional support.
    iResult = penvDbEnv->open("..\\database", ui32EnvFlags, 0);
    // Get the list of log files.
    char **pLogFilLis;
    char **pLogFilLisBegin;
    iResult = penvDbEnv->log_archive(&pLogFilLis, DB_ARCH_ABS | B_ARCH_LOG);
    // This line resets the log sequence numbers from the database file.
    // No actual log file is associated with the database.
    iResult = penvDbEnv->lsn_reset("..\\database\\DATABASE.db", 0);
    // Remove the log files.
    if(pLogFilLis!= NULL)
    // I don´t now how put spaces and tabs here, sorry about the "___".;-).
    __for(pLogFilLisBegin = pLogFilLis; *pLogFilLis != NULL; ++pLogFilLis)
    ____iResult = remove(*pLogFilLis);
    __free(pLogFilLisBegin);
    // At this point no more log files exists at database directory.
    penvDbEnv->close(0);
    delete penvDbEnv;
    // If i need remove the environment files, do this.
    penvDbEnv = new DbEnv(0);
    penvDbEnv->remove(("..\\database", 0);
    delete m_penvDbEnv;
    Thanks to Bogdan Coman for show me the way
    DelNeto.

Maybe you are looking for

  • What is Continuous Data Protection (CDP) & how does it work?

    When it comes to Backup and Disaster Recovery (BDR), it's important to know how it functions and which service best fits your clients' needs. Is Continuous Data Protection more cost effective than legacy backup products? How does CDP actually work? W

  • Oracle 9i and 10G professionals required

    Hi All, A company in Tanzania is looking for Oracle 9i and 10G professionals for immediate requirement. Those who are looking for change and has 4 to 5 years experience can send in your resumes to [email protected] Indians are preffered. Mention "ORJ

  • Need inputs on CONVERT function in oracle.

    My source DB is : US7ASCII My target DB is : AL32UTF8 Basically I am using oracle CONVERT funciton to convert the data. Unforutnately AL32UTF8 is not predefined in CONVERT function. So, is there are any other ways to convert the data ? Plz let me kno

  • Report in mm/dd/yy format

    Hi BW Experts, BW Report pulled under my ID is in dd/mm/yy format. Please let me know hot to reformat it to mm/dd/yy. Regards, Xys Reddi

  • How to map betwwen two custom table

    Hi, I have two custom table like GL1000 & GL1001 in HR(Should be same behavior HRP1000 & HRP10001). I need to pass the data webdynpro screen through BADI. The Method would be Create, FIND, READ, DELIMT, and UPADTE when i create BADI definition. My Qu