BAD PARAM Exception

Folks, My CORBA App is throwing the following exception:
WARNING: "IOP00110201: (BAD_PARAM) Null parameter"
org.omg.CORBA.BAD_PARAM:vmcid: SUN minor code: 201 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.nullParam (Unknown Source)
This is being thrown from an IDL-generated Helper class of an object in the method 'public static void write()' in the line 'out.write_string(s.someString);'. This seems to be happening when the string 'someString' has a value of null. Can't a string have null value? Is this exception expected? Should all string values be necessarily non-null?
Thanks.

GSP wrote:
Folks, My CORBA App is throwing the following exception:
WARNING: "IOP00110201: (BAD_PARAM) Null parameter"
org.omg.CORBA.BAD_PARAM:vmcid: SUN minor code: 201 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.nullParam (Unknown Source)
This is being thrown from an IDL-generated Helper class of an object in the method 'public static void write()' in the line 'out.write_string(s.someString);'. This seems to be happening when the string 'someString' has a value of null. Can't a string have null value? Err, apparently not...
Is this exception expected? Should all string values be necessarily non-null?No, not all. But it can't be null in this case (given the provided details).
It this application developed by a company called Atomikos?

Similar Messages

  • Matrix Bad Value exception in ItemCode column

    hello ,
    i faced an exception with filling itemcode column
    As u know this column is linked object and have CFL (choose from list)
    the problem i faced that on choosing from list i choose an item to add new line in matrix
    this event done and a new line added sucessfully
    but the problem was with CFL , that it didnt able to close , it still opened and you need to press ESC or click on cancel to close it
    when i tracking the exception i found "Bad value" exception, although the itemcode column filled but the
    also i bind all matrix columns with data sources and i can fill matix at first , but when i want to add new line i faced this problem
    best regards and thank you in advance ....
    Ammar

    Thanks Rasmus,
    But that's something I've already tried - it doesn't seem to make any difference.

  • Unusual Bad Padding Exception

    I am writing a class to encrypt licencing information onto a text file in Base64 encoding. This write aspect works fine but the reading the licence back throw a Bad Padding Exception. (error and code below) Any assistance will be much appreciated
    javax.crypto.BadPaddingException: Given final block not properly padded
    at com.sun.crypto.provider.SunJCE_h.b(DashoA6275)
    at com.sun.crypto.provider.SunJCE_h.b(DashoA6275)
    at com.sun.crypto.provider.AESCipher.engineDoFinal
    (DashoA6275)
    at javax.crypto.Cipher.doFinal(DashoA6275)
    at Encryptor.encrypt(Encryptor.java:117)
    at Encryptor.loadAllEncryptedLayerLicences
    (Encryptor.java:158)
    at Encryptor.main(Encryptor.java:183)
    KeyGenerator kgen = KeyGenerator.getInstance("AES");
    kgen.init(128);
    SecretKey skey = kgen.generateKey();
    byte[] raw = skey.getEncoded();
    SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
    Cipher cipher = Cipher.getInstance("AES");
    //encrypt
    cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
    byte[] encrypted = cipher.doFinal(value.getBytes());
    //CONVERT TO BASE64 Encoding
    String s = new sun.misc.BASE64Encoder().encode(encrypted);
    //write the encrypted data to the file
    fos = new FileOutputStream("C:\\aes\\output.properties");
    new PrintStream(fos).println("layerhandle\t"+s);
    fos.flush();
    //fos.close();
    //decrypt
    byte[] buf = new sun.misc.BASE64Decoder().decodeBuffer(value);
    cipher.init(Cipher.DECRYPT_MODE, skeySpec);
    //read from file and decrypt the values
    byte[] unecrypted = cipher.doFinal(buf);
    String word = new String(unecrypted);

    String s = new
    sun.misc.BASE64Encoder().encode(encrypted);
    //write the encrypted data to the file
    fos = new
    FileOutputStream("C:\\aes\\output.properties");
    new PrintStream(fos).println("layerhandle\t"+s);
    fos.flush();
    //fos.close();This looks suspicious. You should close the PrintStream and not just flush 'fos'. Closing the PrintSteam will close 'fos'. This failure to close the print stream could be the cause your problem.
    >
    >
    //decrypt
    byte[] buf = new
    sun.misc.BASE64Decoder().decodeBuffer(value);If there is a problem with decrypt then it may be because you have not read the 'value' or the 'key' properly.

  • Getting error message CT bad param: invalid matrix

    When we try to print this form in Reader 9 or X, we're getting the CT bad param: invalid matrix error message. Any thoughts on what's causing this and how to fix it?
    Thanks,
    MDawn

    java.sql.SQLException: ORA-00904: "SANDY": invalid identifier
    Looks like the sql you are submitting is invalid.
    Print out a copy of the sql you are trying to run and you will probably get:
    SELECT * FROM OURUSERS WHERE usr = Sandy and password = secretThat isn't valid sql. It is missing quotes around the values you are checking.
    This is the corrected sql query:
    SELECT * FROM OURUSERS WHERE usr = 'Sandy' and password = 'secret'so one solution would be:
    String sql = "SELECT * FROM OURUSERS WHERE usr = '" + user + "' and password = '" + pwd + "' ";However that is not optimal. It exposes your code to sql injection attack.
    The better way is to use a prepared statement:
    String sql = "SELECT * FROM OURUSERS WHERE usr = ? and password =?";
    st = con.prepareStatement(sql);
    st.setString(1, user);
    st.setString(2, password);
    rs = st.executeQuery();cheers,
    evnafets

  • Why bad padding exception???

    hi guys
    here i am trying to decrypt the already encrypted string by one different encrpytion algo.
    in the example i have encrypted the string by des and then i tried to decrypt it using blowfish but it gives as the output null instead of a random string...because of a bad padding exception(check line 86). help to remove the exception.
    if we try to decrypt the des encrypted string by des again it give n padding exception. why with blowfish???
    // CIPHER / GENERATORS
    import javax.crypto.Cipher;
    import javax.crypto.SecretKey;
    import javax.crypto.KeyGenerator;
    // KEY SPECIFICATIONS
    import java.security.spec.KeySpec;
    import java.security.spec.AlgorithmParameterSpec;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.PBEParameterSpec;
    // EXCEPTIONS
    import java.security.InvalidAlgorithmParameterException;
    import java.security.NoSuchAlgorithmException;
    import java.security.InvalidKeyException;
    import java.security.spec.InvalidKeySpecException;
    import javax.crypto.NoSuchPaddingException;
    import javax.crypto.BadPaddingException;
    import javax.crypto.IllegalBlockSizeException;
    import java.io.UnsupportedEncodingException;
    import java.io.IOException;
    public class StringEncrypter {
    Cipher ecipher;
    Cipher dcipher;
    StringEncrypter(SecretKey key, String algorithm) {
    try {
    ecipher = Cipher.getInstance(algorithm);
    dcipher = Cipher.getInstance(algorithm);
    ecipher.init(Cipher.ENCRYPT_MODE, key);
    dcipher.init(Cipher.DECRYPT_MODE, key);
    } catch (NoSuchPaddingException e) {
    System.out.println("EXCEPTION: NoSuchPaddingException");
    } catch (NoSuchAlgorithmException e) {
    System.out.println("EXCEPTION: NoSuchAlgorithmException");
    } catch (InvalidKeyException e) {
    System.out.println("EXCEPTION: InvalidKeyException");
    public String encrypt(String str) {
    try {
    // Encode the string into bytes using utf-8
    byte[] utf8 = str.getBytes("UTF8");
    // Encrypt
    byte[] enc = ecipher.doFinal(utf8);
    // Encode bytes to base64 to get a string
    return new sun.misc.BASE64Encoder().encode(enc);
    } catch (BadPaddingException e) {
    } catch (IllegalBlockSizeException e) {
    } catch (UnsupportedEncodingException e) {
    } catch (IOException e) {
    return null;
    public String decrypt(String str) {
    try {
    // Decode base64 to get bytes
    byte[] dec = new sun.misc.BASE64Decoder().decodeBuffer(str);
    // Decrypt
    byte[] utf8 = dcipher.doFinal(dec);
    // Decode using utf-8
    return new String(utf8, "UTF8");
    } catch (BadPaddingException e) {
    System.out.println("BAd padding excception");
    } catch (IllegalBlockSizeException e) {
    System.out.println("IllegalBlockSizeException");
    } catch (UnsupportedEncodingException e) {
    System.out.println("UnsupportedEncodingException");
    } catch (IOException e) {
    System.out.println("IOException");
    return null;
    public static void testUsingSecretKey() {
    try {
              String secretString = "code cant be decrypted!";
              SecretKey desKey = KeyGenerator.getInstance("DES").generateKey();
              SecretKey blowfishKey = KeyGenerator.getInstance("Blowfish").generateKey();
         StringEncrypter desEncrypter = new StringEncrypter(desKey, desKey.getAlgorithm());
              StringEncrypter blowfishEncrypter = new StringEncrypter(blowfishKey, blowfishKey.getAlgorithm());
              String desEncrypted = desEncrypter.encrypt(secretString);     
         String desDecrypted = desEncrypter.decrypt(desEncrypted);
         String blowfishDecrypted = blowfishEncrypter.decrypt(desEncrypted);      
         System.out.println(desKey.getAlgorithm() + " Encryption algorithm");
         System.out.println(" Original String : " + secretString);
         System.out.println(" Encrypted String : " + desEncrypted);
         System.out.println(" Decrypted String : " + desDecrypted);
         System.out.println();
         System.out.println(blowfishKey.getAlgorithm() + " Encryption algorithm");
         System.out.println(" Original String : " + desEncrypted);
         System.out.println(" Decrypted String : " + blowfishDecrypted);
         System.out.println();
         } catch (NoSuchAlgorithmException e) {
         public static void main(String[] args) {
         testUsingSecretKey();
    }

    peter_crypt wrote:
    you are right but this is my question. why cant we do that?? it should be possible.by the way i am working on a project for cryptanalysis . there i need to implement it.You need to spend more time studying and less time programming -
    1) Applied Cryptography, Schneier, Wiley, ISBN 0-471-11709-9
    2) Practical Cryptography, Ferguson and Schneier, Wiley, ISBN 0-471-22357-3
    3) Java Cryptography, Knudsen, O'Reilly, ISBN 1-56592-402-9 dated but still a good starting point
    4) Beginning Cryptography with Java, written by David Hook and published by WROX .

  • Bad Padding Exception using AES/ECB/PKCS5Padding

    Hi, I need some help Tryng to crypt and decrypt a String using AES/ECB/PKCS5Padding
    I paste my code below
    Crypt
    Cipher cipher;
             byte[] pass=new byte[]{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; // just for example
            SecretKeySpec key = new SecretKeySpec(pass, "AES");
            cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
            cipher.init(Cipher.ENCRYPT_MODE, key);        
            byte[] utf8 = da_cifrare.getBytes("utf-8");
            byte[] enc = cipher.doFinal(utf8);
            String cifrata =new String (Base64.encodeBase64(enc));
            return cifrata;
    And on the other side Decrypt
    Cipher decipher;
               byte[] pass=new byte[]{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; // just for example
               SecretKeySpec key = new SecretKeySpec(pass, "AES");
               decipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
               decipher.init(Cipher.DECRYPT_MODE, key); 
               byte[] buf =Base64.decodeBase64(da_decifrare.getBytes("utf-8"));
               byte[] recoveredBytes = decipher.doFinal(buf);
               String in_chiaro = new String (recoveredBytes,"utf-8");
               return (in_chiaro);I'm getting Bad padding exception when I try to Decrypt, any ideas ??

    Nothing obviously wrong but we have no view of your Base64 encoder and decoder. You should check
    a) that the bytes of your key are the same in both methods
    b) that the bytes resulting in your decrypt methodbyte[] buf =Base64.decodeBase64(da_decifrare.getBytes("utf-8"));are exactly the same as those created in the encrypt method using  byte[] enc = cipher.doFinal(utf8);
          Note - since Base64 consists of only ASCII characters you should use String cifrata =new String (Base64.encodeBase64(enc),"ASCII");and byte[] buf =Base64.decodeBase64(da_decifrare.getBytes("ASCII"));though this flaw should not be the cause of your exception.
    Edited by: sabre150 on Dec 15, 2009 12:32 PM

  • Bad Padding Exception

    I've got a small program to save/load passwords from a file, but the encryption is causing me a few issues, currently I'm stuck on a bad padding exception (line 120).
    The code can be found here: http://www.rafb.net/paste/results/R8NoZB78.html
    Does anyone know how I can resolve the error? Thanks.

        private String decrypt(String encrypted) {
            try {
                Cipher cipher = Cipher.getInstance("DES");
                cipher.init(Cipher.DECRYPT_MODE, key);
                return new String(Base64.decodeBase64(cipher.doFinal(encrypted.getBytes())));
            } catch (Exception e) { e.printStackTrace(); }
            return null;
        private String encrypt(String plaintext) {
            try {
                Cipher cipher = Cipher.getInstance("DES");
                cipher.init(Cipher.ENCRYPT_MODE, key);
                return new String(cipher.doFinal(Base64.encodeBase64(plaintext.getBytes())));
            } catch (Exception e) { e.printStackTrace(); }
            return null;
        }decrypt()
    string -> encrypted encoded bytes -> encoded bytes -> bytes -> string
    encrypt()
    string -> bytes -> encoded bytes -> encrypted encoded bytes -> string
    I do ask myself first. And no, I still don't get what the problem is - I really think there's something, probably very simple, that I don't know about and that's why I'm not getting this.

  • CCM enrichment BaDI implementation - exception handling

    Hello CCM Gurus,
    We're using CCM 2.0 version. I'd like to make an upload enrichment implementation, and raise an exception if one item has some problem. Every time if in the code an exception is raised according to one item, the whole catalog upload goes wrong, and the upload of the other good items go wrong as well. If it is possible I'd like to get a warning or an error message in SLG1 from the problematic items, but the correct items should be load into the catalog.
    If you have a sample implementation like this, what is solved this issue please send me.
    Thanks and regards
    Almos

    Hello Masa,
    Thanks for the helpful advice, the debugging is working now. Do you know some documentation or material where I can find some useful detailed infomation about using CCM BAdI?
    I don't know exactly the differences between the /CCM/CTLG_ENRICHMENT and the /CCM/CHAR_VALUATION BAdI. What is the prefered BAdI when you'd like to change or append uploaded CCM catalog data?
    Thanks and regards
    Almos

  • Bad Position Exception

    I have posted this in the concurrency thread, as I think this is a concurrency issue, but it is hard to know because my code is throwing exceptions that are hard to understand.
    The exception I am getting is "bad position" followed by a number, eg "bad position: 111787".
    This seems to happen when I am accessing a Vector, Hashtable or ByteArrayOutputStream in a multi-threaded program, so I am assuming it is some kind of concurrency issue. However, I would have expected to get a recognisable exception message such as "ConcurrentModificationException" or something like that.
    Does anyone have any idea what this exception is? Am I barking up the wrong tree in assuming it is a concurrency exception?
    Thanks

    Searching the JDK7 source gives
    sabre@beta:~/jdk7$ find . -name "*.java" -exec grep -il "bad position" {} \;
    ./jdk/src/share/classes/javax/swing/text/DocumentFilter.java
    ./jdk/src/share/classes/javax/swing/text/Document.java
    ./jdk/src/share/classes/javax/swing/text/JTextComponent.java
    ./jdk/src/share/classes/javax/swing/text/Segment.java
    Only Segment.java and JTextComponent have that as part of an exception (IllegalArgumentException) message.
    Since these are both Swing classes, if this is a concurrency issue then I would suspect it is caused by you not updating something in the Swing event thread.

  • Initialising Cipher- No Alg params exception

    Hi guys.
    I am trying to encrypt some data with the secret key and then.. send the secret key & encrypted data across ..(dont worry the secret key is sent securely using PKI ;-)) . Then i recreate the secret key and use it to decrypt the data. I was successful in recreating the secret key. but while initialising the cipher (to decrypt mode) using the reconstructed secret key, it throws exception like this:
    java.lang.IllegalArgumentException: no IV set when one expected
    at org.bouncycastle.jce.provider.JCEBlockCipher.engineInit(JCEBlockCipher.java:437)
    at javax.crypto.Cipher.init(DashoA6275)
    I then got the algorithm params from the earlier cipher and then sent them across too.. and this works properly !!! Can u please tell me whether it is right to do it this way.Can we do it in any other way without sending the alg parameters ?? something like.. can the parameters be generated at the other side..just guessing ;)
    //Encrypt
    Cipher scipher= Cipher.getInstance("DES/CBC/PKCS5Padding");
    scipher.init(Cipher.ENCRYPT_MODE,secretKey);
    encrypted= scipher.doFinal("data".getBytes());
    System.out.println("after encrypting the data with the secret key : "+new String(encrypted));
    AlgorithmParameters ap= scipher.getParameters();
    //Decrypt
    Cipher dcipher= Cipher.getInstance("DES/CBC/PKCS5Padding");
    dcipher.init(Cipher.DECRYPT_MODE,reconstructedSecretKey);//HERE I GET THE EXCEPTION
    decrypt= dcipher.doFinal(encrypted);
    System.out.println("after decrypting with the secret key the data is: "+new String(decrypt));
    Thanks in advance,
    Vijay.

    Thanks a LOT Grant . I tried it out and it works
    well!!:-)). Glad I could help.
    I would like to know more about
    IVParameters and also about different modes (CFB/ OFB
    /CFB8/OFB32/ OAEP and others)and the padding schemes
    to be used with them. Can u give me any specific link
    where these things are discussed well?My usual advice is to find and browse/read Bruce Schneier's "Applied Cryptography", ISBN 0-471-111709-9, Wiley&Sons pub. It's a very good introduction to the whole crypto field. There's also the "Handbook of Applied Cryptography" (HAC) - it's also a great book, but heavier on the math and not as accessible (IMNSHO) to the beginner as Schneier. However, it is available in PDF format - check here:
    http://www.cacr.math.uwaterloo.ca/hac/
    It's a fascinating field - good luck!
    Grant

  • How do you trap bad request exceptions

    Hi,
    Can anyone tell me how to catch an exception from the page flow request processor. I'd like to be able to trap requests to invalid .do and .jpf urls. I have exception handling in my Global.app, but that only seems to apply to exceptions generated by the page flow controller.
    At the moment I'm getting this magic html which I think is maybe hardcoded in one of the struts or workshop servlets?
    <html><head><title>Page Flow Error - Action Not Found</title></head>
    <body>
    <h1>Page Flow Error - Action Not Found</h1>
    <table border="1" cellspacing="0">
    <tr><td><b>Page Flow:</b></td><td>Global.app</td></tr>
    <tr><td><b>Action:</b></td><td>blah/something</td></tr>
    <tr><td><b>Form:</b></td><td>null</td></tr>
    </table>
    <span style="color:red">Unable to find action <b>blah/something</b>.</span>
    </body></html>
    thanks,
    laphroaig

    You can report a problem with a purchase as described on this page : http://support.apple.com/kb/HT1933
    There is this general feedback page for the iPad, but I think the above is probably better : http://www.apple.com/feedback/ipad.html

  • Bad pointer exception in Debug mode.. CView in CDockable pane MFC Feature pack

    Hi
    I have attached a CView in  CDockablePane and it works fine
    in Release mode but it throws bad memory pointer in
    debug mode while closing the application.(Crashing during close).
    Please advise...
    Find the code below how I had attached the View to Dockable pane
    //===================================================
    BOOL COutputWnd::AddView ( CRuntimeClass *pRuntimeViewClass, LPCTSTR lpcszTitle, int nIconIndex,int nTabIndex )
    if ( !pRuntimeViewClass )
    return FALSE;
    int nTabIndex = 0;
    CWnd *pWnd = NULL;
    CCreateContext newContext;
    CTestView *pView = NULL;
    newContext.m_pCurrentDoc = NULL;
    newContext.m_pNewViewClass = pRuntimeViewClass;
    newContext.m_pNewDocTemplate = NULL;
    TRY
    pWnd = ( CWnd* ) pRuntimeViewClass->CreateObject ( );
    if ( NULL == pWnd )
    AfxThrowMemoryException ( );
    CATCH_ALL ( e )
    TRACE0 ( "Out of memory creating a view\n" );
    return FALSE;
    END_CATCH_ALL
    if ( !pWnd->Create ( NULL, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect ( 0, 0, 0, 0 ), &m_wndTabs, AFX_IDW_PANE_FIRST + nTabIndex, NULL ) )
    TRACE0 ( "Create view failed\n" );
    return FALSE;
    m_wndTabs.AddTab( pWnd, _T("Browser Tab"), (UINT)m_wndTabs.GetTabsNum());
    pWnd->SendMessage ( WM_INITIALUPDATE );
    pWnd->SetOwner ( this );
    pView = ( CTestView* ) pWnd;
    if ( NULL != pView )
    pView->Navigate2 ( lpcszTitle );
    return TRUE;
    }//===================================================
    Thanks
    Shajeer

    Hi
    I am calling the AddView from OnCreate of COutputWnd as below
    int COutputWnd::OnCreate(LPCREATESTRUCT lpCreateStruct){
    if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1;
    m_Font.CreateStockObject(DEFAULT_GUI_FONT);
    CRect rectDummy;
    rectDummy.SetRectEmpty();
    // Create tabs window:
    if (!m_wndTabs.Create(CMFCTabCtrl::STYLE_FLAT, rectDummy, this, 1)){
    TRACE0("Failed to create output tab window\n");
    return -1; // fail to create}
    AddView( RUNTIME_CLASS(CBrowserView),_T("www.google.com"),-1,0);
    return 0;
    Find below the call stack when it crashes
    Bad_Pointer.exe!AfxAssertValidObject(const CObject * pOb=0x00b7e838, const char * lpszFileName=0x014c58c8, int nLine=2372)  Line 99 + 0xa bytes C++
      Bad_Pointer.exe!CFrameWnd::AssertValid()  Line 2373 C++
      Bad_Pointer.exe!CMDIFrameWnd::AssertValid()  Line 384 C++
      Bad_Pointer.exe!CMainFrame::AssertValid()  Line 271 C++
      Bad_Pointer.exe!AfxAssertValidObject(const CObject * pOb=0x00b70068, const char * lpszFileName=0x014d5404, int nLine=288)  Line 107 C++
      Bad_Pointer.exe!CBasePane::GetParentMiniFrame(int bNoAssert=0)  Line 291 C++
      Bad_Pointer.exe!CDockablePane::OnDestroy()  Line 2579 + 0x12 bytes C++
      Bad_Pointer.exe!CTabbedPane::OnDestroy()  Line 215 C++
      Bad_Pointer.exe!CWnd::OnWndMsg(unsigned int message=2, unsigned int wParam=0, long lParam=0, long * pResult=0x001ae47c)  Line 2042 C++
      Bad_Pointer.exe!CWnd::WindowProc(unsigned int message=2, unsigned int wParam=0, long lParam=0)  Line 1755 + 0x20 bytes C++
      Bad_Pointer.exe!CBasePane::WindowProc(unsigned int message=2, unsigned int wParam=0, long lParam=0)  Line 1011 + 0x14 bytes C++
      Bad_Pointer.exe!AfxCallWndProc(CWnd * pWnd=0x00b90af0, HWND__ * hWnd=0x000114d8, unsigned int nMsg=2, unsigned int wParam=0, long lParam=0)  Line 240 + 0x1c bytes C++
      Bad_Pointer.exe!AfxWndProc(HWND__ * hWnd=0x000114d8, unsigned int nMsg=2, unsigned int wParam=0, long lParam=0)  Line 403 C++
      user32.dll!7787f8d2()  
      [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll] 
      user32.dll!7787f794()  
      user32.dll!7787f73d()  
      user32.dll!77880817()  
      user32.dll!77880a65()  
      ntdll.dll!776f99ce()  
      user32.dll!778714c8()  
      Bad_Pointer.exe!CMDIFrameWndEx::OnDestroy()  Line 777 C++
      90909090()
    Thanks!
    Shaj

  • Bad Padding exception when trying to decrypt the file

    Hi i am trying to decypt a file in java which is encrypted in c++ but i get the pad padding exception
    javax.crypto.BadPaddingException: Given final block not properly padded
         at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
         at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
    public byte[] decrypt(byte[] str) {
    try {
    // Decrypt
         System.out.println("beforedecrypt-->"+str.length);
         byte[] input = new byte[64];
              while(true) {
                        int bytesRead = fin.read(input);
                        if (bytesRead == -1) break;
                        byte[] output = dcipher.update(input, 0, bytesRead);
                   byte[] output = dcipher.doFinal();
         // byte[] utf8 = dcipher.doFinal(str);
         System.out.println("afterdecrypt-->");
    // Decode using utf-8
    return output;
    } catch (javax.crypto.BadPaddingException e) {e.printStackTrace();}
    catch (IllegalBlockSizeException e) {e.printStackTrace();}
    catch (Exception e){e.printStackTrace();}
    return null;
    }

    MuppidiJava wrote:
    Sorry man..i got the same key in java..which you got i followed everything was mentioned... but i did not get the same key using C++ But did you compensate in your Java for the C++ bug I highlighted involving the creation of the bytes from the password? I bet you didn't. Did you even talk to your C++ guys about the bug? I bet you didn't.
    as i said i was not good at it..but your sample cpp code would have fixed it easily. Did you look at the Microsoft Crypto documentation? I bet you didn't. Did you try to learn enough C++ to add in the few lines of code needed to export and print out the generated key? I bet you didn't. Did you try to get the C++ guys to help you on this?
    I runing short of timeSorry but your time management problem is your problem.
    ..thanks for your support..The BadPaddingException problem you have is almost certainly as a result of you not generating the same key bytes in your Java as are being generated by the C++. Since you get the same bytes as I do when not compensating for the C++ bug it is almost certain that the C++ bug is the root cause of your problem. If I compensate for the C++ bug I get a match between my C++ key bytes and my Java key bytes. If you don't spend effort in understanding the C++ bug and how to correct for it in your Java you are stuffed. If you don't spend time learning enough C++ to be able to export the C++ key then you will have great difficulty in proving that you C++ key bytes actually match your Java key bytes. I have explained what the bug is - the Java code to compensate for the bug is actually trivial. I have explained how to export the C++ key - the C++ code for this is small and straightforward. I'm not going to provide the C++ code nor the Java compensation code. This is a 'forum' and not a programming service.
    P.S. You still have a problem with the '.' key on your keyboard.

  • NIO Bug Bad Address Exception

    I've been developing a file transfer system using the transferTo and transferFrom methods. My method will throw intermittently IOExceptions
    "Bad address". Has anyone else seen this? There is a bug report out on this however it was not reproducible. We are able to reproduce this error
    at an alarming rate. I am using java 1.4.0_01.

    There is a bug in 1.4.0.01 and there is no work around. I was force to use the old IO classes, and tweek the Garbage collector, and classes to ensure maximum through put. I was informed by the Java Team that this problem was fixed in 1.4.1. I that is not the case you will have to submit another bug report.

  • URGENT Please ! Problem printing form in LC ES2 "CT bad param: invalid matrix"

    Hello everyone,
    I'm a new user of Live Cycle but usually I am able to solve my problem by myself... This time, this problem really seem weird to me!
    I created 2 forms from an excel file, one that is working well in Live Cycle Es2, acrobat X and reader X (I set the parameters of the form so everybody is able to fill the form, save it and print it in Reader). The second page of the second document is problematic: Page 2 is unable to print in Live Cycle, acrobat or reader. I can save it, fill it but not print it. The first page alone is printing in all programs but as I add the second one I'm having those error messages:
    In live cycle:
    in Acrobat and Reader :
    Please help me, I really tryed what i could! (uninstall, reinstall, reboot, copy-paste in a new document, print on another printer, Windows7 update)...
    Thanks!!!!

    Hi,
    This error mainly occurs while populating the fieldcatalog i.e fields are wrongly populated. PLease chack your column Position no assignment.
    Another reason could be if you are using field symbols to assign data in the field catalog

Maybe you are looking for