Invalid stream header Exception - AES PBE with SealedObject

I am trying to do an PBE encryption with AES algorithm and SunJCE provider, using the SealedObject class to encrypt/decrypt the data...
And Im still getting the "invalid stream header" exception. Ive searched this forum, readed lots of posts, examples etc...
Here is my code for encryption (i collected it from more classes, so hopefully I didnt forget anything...):
    //assume that INPUT_STREAM is the source of plaintext
    //and OUTPUT_STREAM is the stream to save the ciphertext data to
    char[] pass; //assume initialized password
    SecureRandom r = new SecureRandom();
    byte[] salt = new byte[20];
    r.nextBytes(salt);
    SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
    KeySpec keySpec = new PBEKeySpec(pass, salt, 1536, 128);
    SecretKey pbKey = factory.generateSecret(keySpec);
    SecretKeySpec key = new SecretKeySpec(pbKey.getEncoded(), "AES");
    Cipher ciph = Cipher.getInstance("AES/CTR/NoPadding");
    ciph.init(Cipher.ENCRYPT_MODE, key);
    ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
    int ch;
    while ((ch = INPUT_STREAM.read()) >= 0) {
      byteOut.write(ch);
    SealedObject sealed = new SealedObject(byteOut.toByteArray(), ciph);
    BufferedOutputStream bufOut = new BufferedOutputStream(OUTPUTSTREAM);
    ObjectOutputStream objOut = new ObjectOutputStream(bufOut);   
    objOut.writeObject(sealed);
    objOut.close();
  }And here is my code for decrypting:
    //assume that INPUT_STREAM is the source of ciphertext
    //and OUTPUT_STREAM is the stream to save the plaintext data to
    char[] pass; //assume initialized password
    SecureRandom r = new SecureRandom();
    byte[] salt = new byte[20];
    r.nextBytes(salt);
    SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
    KeySpec keySpec = new PBEKeySpec(pass, salt, 1536, 128);
    SecretKey pbKey = factory.generateSecret(keySpec);
    SecretKeySpec key = new SecretKeySpec(pbKey.getEncoded(), "AES");
    BufferedInputStream bufIn = new BufferedInputStream(INPUT_STREAM);    //MARK #1
    ObjectInputStream objIn = new ObjectInputStream(bufIn);   
    SealedObject sealed = (SealedObject) objIn.readObject();   
    byte[] unsealed = (byte[]) sealed.getObject(key);          //MARK #2
    ByteArrayInputStream byteIn = new ByteArrayInputStream(unsealed);
    int ch;
    while ((ch = byteIn.read()) >= 0) {
      OUTPUT_STREAM.write(ch);
    OUTPUT_STREAM.close();Everytime I run it, it gives me this exception:
Exception in thread "main" java.io.StreamCorruptedException: invalid stream header: B559ADBE
     at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
     at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
     at javax.crypto.SunJCE_i.<init>(DashoA13*..)
     at javax.crypto.SealedObject.unseal(DashoA13*..)
     at javax.crypto.SealedObject.getObject(DashoA13*..)
     at oopsifrovanie.engine.ItemToCrypt.decrypt(ItemToCrypt.java:91)  //MARKED AS #2
     at oopsifrovanie.Main.main(Main.java:37)    //The class with all code below MARK #1I've also found out that the hashCode of the generated "key" object in the decrypting routine is not the same as the hashCode of the "key" object in the ecrypting routine. Can this be a problem? I assume that maybe yes... but don't know what to do...
When I delete the r.nextBytes(salt); from both routines, the hashCodes are the same, but that's not the thing I want to do...
I think, that the source of problem can be this part of code (generating the key):
    SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
    KeySpec keySpec = new PBEKeySpec(pass, salt, 1536, 128);
    SecretKey pbKey = factory.generateSecret(keySpec);
    SecretKeySpec key = new SecretKeySpec(pbKey.getEncoded(), "AES");But I derived it from posts like: [http://forums.sun.com/thread.jspa?threadID=5307763] and [http://stackoverflow.com/questions/992019/java-256bit-aes-encryption] and they claimed it's working there...
Is there anyone that can help me?
Btw, I don't want to use any other providers like Bouncycastle etc. and I want to use PBE with AES and also SealedObject to store the parameters of encryption...

Yes, it really uses only one Cipher object, but it does decoding in a little nonstandard (not often used) way, by using the SealedObject class and its getObject(Key key) method. You can check these links for documentation: [http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#SealedObject] and [http://java.sun.com/javase/6/docs/api/javax/crypto/SealedObject.html] So the question is, why it doesn't work also with the AES routines, because it should.
Btw, according to [http://java.sun.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunJCEProvider] PBEWithSHA1AndDESede/CBC/PKCS5Padding is a valid JCE algorithm for the Cipher class.
Firstly, I was generating the key for AES enc./decryption this way and it was working:
char[] pass; //assume initialized password
byte[] bpass = new byte[pass.length];
    for (int i = 0; i < pass.length; i++) {
      bpass[i] = (byte) pass;
SecretKeySpec key = new SecretKeySpec(bpass, "AES");
But I think, that it really wasn't secure, so I wanted to build a key from the password using the PBE.
Maybe there's also a way how to do this part of my AES PBE algorithm: *KeySpec keySpec = new PBEKeySpec(pass, salt, 1536, 128);* manually (with my own algorithm), but I dont know how to do it and I'd like it to be really secure.
Btw, thanks for your will to help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Invalid stream header exception

    hi all
    I have a program to encrypt/decrypt a file using existing secret key
    which is generated by my java code and it works fine. I got a key from a friend and an encrypted file to decrypt it but the program throws this exception:
    java.io.StreamCorruptedException: invalid stream header: 87449FAA
    Exception in thread "main" java.security.InvalidKeyException: No
    installed provider supports this key: (null) this is my code:
    try
        //throws exception here
        ObjectInputStream in = new ObjectInputStream(new
    FileInputStream("key.dat"));
        key = (SecretKey)in.readObject();
        byte[] raw = key.getEncoded();
        skeySpec = new SecretKeySpec(raw, "AES");
        in.close();
    catch (Exception e)
        System.out.println(e);
    Cipher cipher = Cipher.getInstance("AES");
    cipher.init(Cipher.DECRYPT_MODE, skeySpec); Honestly i don't know how my friend creates the secret key but i think he uses some key generation tools. I suppose the key file is not corrupted because he used it to encrypt/decrypt other files.

    Looks like your friend did not use Java serialization to save the key in the file.
    Edited by: sabre150 on Apr 13, 2008 5:27 PM

  • Need Help With: java.io StreamCorruptedException invalid stream header

    All:
    1. For some time I have tried to correct an error: "java.io StreamCorruptedException invalid stream header" , reoccuring in Jasper Reports source code.
    2. Based upon requirements, The Program packages variables into a HashMap, and creates a "BLOB" object which is inserted into an Oracle database. At a later point, the BLOB object is retrieved, and the "BLOB" contents are read into a byte array. The next occurring task is to retrieve data from the receiving byte array and reconstitute the original HashMap object.
    THIS IS WHEN THE PROGRAM FAILS !!!!!
    3. I can verify the number of bytes going in/out of the "BLOB" object as being the same count. I have tried different approaches listed on diverse sites w/o success. My Source Code Follows:
    // I tried to include only germane source code.
    // THIS SECTION GETS THE BLOB OBJECT AND PUTS IT INTO A BYTE //ARRAY
    rs = ps.executeQuery();
    if (rs.next())
    BLOB myblob =((OracleResultSet)rs).getBLOB("JASPERDATA");
    int chunkSize = myblob.getChunkSize();
    System.out.println("Incomming DATA size is ........." + chunkSize);
    textbuffer = new byte[chunkSize];
    int bytesRead;
    InputStream myis = myblob.getBinaryStream();
    OutputStream myout = myblob.getBinaryOutputStream();
    while((bytesRead = myis.read(textbuffer) )!= -1)
    myout.write(textbuffer);
    myout.flush();
    "" //code not germane to Discussion
              return (textbuffer); //Returns Byte Array
    // I tried to include only germane source code.
    byte [] textbuffer = adb.getBLOBFromQueue(dataFile); // Get Byte Array from above.
    int textbufferLength = textbuffer.length;
              HashMap localParamValueMap = null;
              Object in = new ObjectInputStream(new ByteArrayInputStream(textbuffer ));
              localParamValueMap = (HashMap) ((ObjectInputStream) in).readObject(); // THIS IS THE PROBLEM AREA EXCEPTION OCCURS AT "readObject"
    // ERROR RECEIVED IN TOMCAT
    //ERROR CALLSTACK
    java.io.StreamCorruptedException: invalid stream header
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253)
         at com.entservlet.DisplayJasperReports.doGet(DisplayJasperReports.java:72)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)

    Be sure that you are not seeing a secondary problem.
    In my case, with serialized objects back to the client, the client will see this expection when any of the following occurs:
    1) The server has timed out the session and instead of sending back an object, the object stream is seeing the login page.
    2) An error is occured somewhere inside of the jsp code and instead of getting a the expected serailized object in the stream, I'm getting the 500 status page...
    So...
    In your case you are going from one server to tomcat but I wouldn't be surprised if something similar is going on.
    -Dennis

  • Problem with StreamCorruptedException: invalid stream header: 3C68746D

    Hi
    I am attempting to code a project in Java which involves the user of object serialization to send a String via serialization from an applet embedded in a JSP tp a servlet all files are running on the same machine for testing purposes.
    However I seem to be getting StreamCorruptedException: invalid stream header: 3C68746D whenever I attempt to read the inputstream once I have written to it.
    My code is as follows below (I apologise for the lack of details I have attempted to comment and simplify my code as much as possible for improved readability)
    ////////////////////////APPLET CODE////////////////
    import java.io.*;
    import java.io.Serializable;
    import javax.servlet.http.*;
    import java.applet.*;
    import javax.swing.*;
    import java.net.*;
    *Compiled using netbeans 5.1
    *Uses Apache server embedded with netbeans
    *JSP address http://localhost:8084/TestServ
    *Applet is embedded within this page
    *Servlet address http://localhost:8084/TestServ/TServ
    public class Main extends javax.swing.JApplet {
    JFrame jf;//frame for the test applet
    JTextArea jt;//result text box
    public Main() {
    jt=new JTextArea();//set up applet
    this.add(jt);
    URL servletURL;
    HttpURLConnection servletConnection;
    InputStream iStream=null;
    try
    {   //this address as far as is known is correct
    servletURL = new URL( "http://localhost:8084/TestServ/TServ" );
    //open connection to servlet
    servletConnection = (HttpURLConnection)servletURL.openConnection();
    //set up connection
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true);
    servletConnection.setUseCaches(false);
    servletConnection.setDefaultUseCaches(false);
    //have tried "GET" and "POST" and "PUT"(PUT not directly compatible with apache servers)
    servletConnection.setRequestMethod("POST");
    servletConnection.setRequestProperty("Content-type","application/octet-stream");
    /*Have also tried application/x-java-serialized-object*/
    //set object output stream
    ObjectOutputStream outStream =
    new ObjectOutputStream(servletConnection.getOutputStream());
    //write a string for test purposes (As far as I am aware String implements Serializable)
    outStream.writeObject("h");
    //flush and close connection
    //have tried a combination of flush and/or close
    outStream.flush();
    outStream.close();
    //get input stream rdy for objectinput stream
    iStream = servletConnection.getInputStream();
    catch(IOException e)
    jt.setText("Error in output "+e);
    ObjectInputStream oInStream=null;
    String str = iStream.toString();
    //iStream at this point equals ""sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@6754d6
    try
    //this is where the error occurs
    //upon even trying to create a objectinputstream using iStream IOException occurs
    oInStream = new ObjectInputStream(iStream);
    //program does not get any further
    oInStream.close();
    catch(IOException e)
    //this error has been driving me crazy :(
    jt.setText("Error in input "+e);
    Servlet code is below however it does not even reach this point
    (If reading input stream is removed from the applet the servlet provides the same error message)
    /////////////////////Servlet code (however does not reach this point)///////////////
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class TServ extends HttpServlet {
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    ObjectInputStream inputFromApplet = null;
    InputStream in = request.getInputStream();
    BufferedReader inTest = null;
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet TServ</title>");
    out.println("</head>");
    out.println("<body>");
    try
    inputFromApplet = new ObjectInputStream(in);
    out.println("<h2>Sucess </h1>");
    catch(EOFException e)
    out.println("<h3>ERROR: " e " Error</h3>");
    out.println("<h3>End Servlet</h3>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    public String getServletInfo() {
    return "Short description";
    Thank you for your time I have searched for an answer for some time now and how found people in similar situations however no solution has been found
    Any help is appreciated
    Az

    The servlet isn't writing any objects back in reply. It is writing text. Not the same thing. If you want to read using an ObjectInputStream you have to write using an ObjectOutputStream.

  • Getting "java.io.StreamCorruptedException: invalid stream header"

    When creating a self made Stream (MacInputStream) and then using an ObjectInputStream over it to read Objects from a socket, I get this error:
    java.io.StreamCorruptedException: invalid stream header
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
         at TServidor.run(TServidor.java:32)
    Is there any special feature that the "self-made" streams have to implement to be possible to use ObjectInput streams over them :P ?
    Here is the MacInputStream.java code:
    import java.io.Closeable;
    import java.io.FilterInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Arrays;
    import javax.crypto.Mac;
    public class MacInputStream extends FilterInputStream implements Closeable{
         private Mac mac; // algorithm
         private byte [] mmac; //message MAC
         private boolean FIRST_TIME;
         public MacInputStream(InputStream is,Mac mac) {
              super(is);
              this.mac=mac;
              FIRST_TIME=true;
    public int read() throws IOException{
              if(FIRST_TIME){
                   mmac = new byte [mac.getMacLength()];
                   super.read(mmac);
              if(super.in.available()==0){
                   FIRST_TIME=true;
                   return -1;
              int rbyte = super.in.read();
              FIRST_TIME=false;
              mac.update((byte)rbyte);
              System.out.println("available: "+super.in.available());          
              if(super.in.available()==0){
                   byte [] macres =mac.doFinal();
                   System.out.println("message MAC: "+new String(mmac));
                   System.out.println("calculated MAC: "+new String(macres));
                   if(!Arrays.equals(macres, mmac)){
                        throw new IOException("violated integrity");
              return rbyte;
    public int read(byte [] b) throws IOException{
         if(FIRST_TIME){
              mmac = new byte [mac.getMacLength()];
              super.in.read(mmac);          
         if(super.available()==0){
              FIRST_TIME=true;
              return -1;
         int rbytes = super.in.read(b);
         FIRST_TIME=false;
         mac.update(b);
         if(super.available()==0){
              byte [] macres =mac.doFinal();
              if(!Arrays.equals(macres, mmac)){
                   throw new IOException("violated integrity");
         return rbytes;
    }And here is the "main" function where the exception gets thrown:
    public void run() {
         try {
              ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
              Mac mac = Mac.getInstance("HmacMD5");
              Key key = KeyGenerator.getInstance("HmacMD5").generateKey();          
              oos.writeObject(key);
              oos.flush();
              mac.init(key);          
              ObjectInputStream cis = new ObjectInputStream(new MacInputStream(s.getInputStream(),mac));
             String test;
             try {
                   while (true) {
                        test = (String)cis.readObject();
                        System.out.println(ct + " : " + test);
              } catch (EOFException e) {
                   System.out.println("["+ct + "]");
              } finally {
              if (cis!=null) cis.close();
              if (oos!=null) oos.close();
         } catch (Exception e) {
             e.printStackTrace();
        }It's exactly in the line: ObjectInputStream cis = new ObjectInputStream(new MacInputStream(s.getInputStream(),mac));Any ideas?
    I'm starting to desperate :P

    (a) I still don't see where you are writing the MAC that you're reading. You're reading something, but it's all or part of the Object stream header I described above, which is why ObjectInputStream' constructor is throwing that exception.
    (b) You don't need to override read(byte[] b) when you extend FilterInputStream, but you do need to override read(byte[] b, int offset, int length), and you need to do it like this:
    public int read(byte[] buffer, int offset, int length) throws IOException
      int count = 0;
      do
        int c = read();
        if (c < 0)
            break;
        buffer[offset+count++] = (byte)c;
      } while (count < length && available() > 0);
      return count > 0 ? count : -1;
    }This way the read() method gets to see every byte that's read and to do its MAC thing or whatever it does. The above is one of only two correct uses of available() in existence: it ensures that you only block once while reading, which is the correct behaviour e.g. on a network.

  • Java.io.StreamCorruptedException: invalid stream header

    I am having a problem with sending two objects (over a socket). I have read in other posts that this could be due to trying to receive incompatible data types but my applications work fine if I send my objects synchronously rather than asynchronously.
    I will try my best to describe what my problem is as my code is very long.
    I have a server and a client application (2 apps). Multiple clients connect to the server and send their details (as an object) to the server. The server then amends the object (adds some more data) and sends it back to the clients. Both the SendObject and ReceiveObject class are threads and I have created a Listener (within the client) that activates when an object is received (asynchronous communication). The Listener method looks to see if the event is an instance of a particular class and casts is as appropriate (as per below).
    public void receivedObject(ReceivedObjectEvent e) {
         ReceiveObjectThread obj = (ReceiveObjectThread) e.getObject();
         if(obj.getObject() instanceof Player) {
              thePlayer = (Player) obj.getObject();
              theTable.setHandData(thePlayer.getHand());
         if(obj.getObject() instanceof GameData) {
              gameData = (GameData) obj.getObject();
              theTable.setPlayerList(gameData.getOpponents());
    }The objects that are passed between applications both implement Serializable.
    This all works fine synchronously object passing. However, if I try and spawn two sendObject threads within the server and the corresponding two receive threads within the client and wait for the Listener to activate (asynchronously) I get the following error:
    java.io.StreamCorruptedException: invalid stream header: 00057372
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
         at ReceiveObjectThread.run(ReceiveObjectThread.java:84)
    java.io.StreamCorruptedException: invalid stream header: ACED0006
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
         at ReceiveObjectThread.run(ReceiveObjectThread.java:84)
    I am sure that this problem is due to my limited knowledge on socket and data transfer. Therefore any help on this one will be gratefully received.

    Hello ejp, your reply is very much appreciated.
    If I explain how I have implemented my sockets you may be able to see where I wrong.
    When a player connects, the client sends the server a �player� object. The server receives the �player� object and passes the socket from which it connected (within the server) to a socket property within the �player� class. Whenever the server needs to send an object to that client (player), it sends the output stream from the socket property within that �player� object. ( player.getSocket().getOutputStream() ).
    Below is the code from the �SendObjectThread� class.
    * This class allows an object to be passed over a Socket
    * @author Harold Clements
    * @version 1.0.1 12-Jun-2007 (12-Jul-2007)
    //http://www.seasite.niu.edu/cs580java/Object_Serialization.html
    public class SendObjectThread extends Thread {
         private OutputStream out;
         private Object obj;
          * This constructor allows the user to passes the two parameters for transmitting.
          * @param out The data stream that the object is going to be sent to.
          * @param obj The object to be sent.
         public SendObjectThread(OutputStream out, Object obj) {
              this.out = out;
              this.obj = obj;
          * The main thread
         public void run() {
              try {
                   ObjectOutputStream objOut = new ObjectOutputStream(out);
                   objOut.writeObject(obj);
                   objOut.flush();
              } catch (IOException e) {
                   e.printStackTrace();
    }The client only has one socket which is defined when the client first makes a connection with the server. The �getOutputStream()� and �getInputStream()� are used for all communication from the client.
    Is this what you described in your first option?
    The funny thing about it all is if I create a new �receiveObjectTread� and wait for that to finish, then create another �receiveObjectTread� both objects in question (Player and GameData) are received correctly and the application works. I only have the problem when I set both threads off and leave it for the �ReceivedObjectEvent� listener to pick them up and cast them (as per my first post).
    Thanks again for your help,
    Harold Clements

  • Xorg fails with "/usr/lib/libexpat.so.1: invalid ELF header"

    After upgrade, Xorg fails with the following message:
    (EE) AIGLX error: dlopen of usr/lib/xorg/modules/dri/i965_dri.so failed (/usr/lib/libexpat.so.1: invalid ELF header)
    (EE) AIGLX: reverting to software rendering
    openbox: error while loading shared libraries: /usr/lib/libexpat.so.1: invalid ELF header
    (I also get en error about fbcon, fbdev modules, but have read that this is not actually an issue.)
    Thanks for any help.
    Last edited by marimo (2010-01-24 07:12:25)

    If it were different architectures, there would be an ELF class error. Assuming that all of the installed libraries are from the Arch repos, I'm betting that expat is corrupt. I would reinstall expat and see if that solves the problem.

  • Java.util.zip.ZipException: invalid END header

    I get this error when I run the code:
    try {
    jFile = new JarFile(jarBuildFile.getAbsolutePath());
    } catch (IOException ex) {
    System.out.println("Got exception: "+ex);
    but only on very large jar files - about 2.5GB in size.
    With JDK 1.4, I get the error, jar file too large.
    With JDK 1.5, I get the above error (invalid END header).
    With JDK 1.6, it reads the file for about 5 seconds, then reports that the file cannot be opened.
    Smaller jar files work fine. This jar file has two files in it, a small XML file and a large video file.
    I'm running under windows XP.
    Doing a jar -tvf (jdk 1.5) on the large jar file works fine.
    The file was built with the jar command (jdk 1.5).
    Is this a bug in the JDK?
    Thank you!
    -Joe
    http://www.lovehorsepower.com

    Sp0ttedD0g wrote:
    I ran into this problem today too and found out it was due to the fact that I had a jar in my war that I was trying to deploy that had a file format of unicode instead of binary (it had been checked into source control system incorrectly). After updating the jar with the proper format (binary), the problem went away.The other reported problems are due to file size, not content.

  • Invalid Cursor state Exception  -  Help required

    Hi,
    I'm having a web page(JSP), which is making use of 3 ResultSet objects. Using the first two, i'll populate two different Drop down list, with values from database(Access) while loading the page for first time.
    Now if the user select any value from any (or both) of drop down list and clicks submit, i need to display all values in database, meeting the criteria from first & second drop down list. For this selection, i'm using the third ResultSet variable. While executing the query, i'm sure that 3rd ResultSet is returning some value. But when i try to retrieve the value to a string variable, i'm getting the Invalid cursor state exception.
    Throughout the page, i haven't closed any of the ResultSet. When i closed the first and second ResultSets in the third function(where 3rd ResultSet is used), i'm not getting any value. Its returning like ResultSet closed.
    Please help me to get this solved. It's very urgent because without this, i cannot proceed further. Please share your ideas.
    Thanks in advace for your valuable help

    If you open a new resultset within the same statement, all previously opened will be closed.
    Read the API docs, luke.

  • Invalid export DLL or export format" with Crystal Reports 2008 to Excel xls

    We are experiencing the same issue as reported in the sticky thread. I answered in that thread, but thought that I woudl open a new thread to keep track of this issue.  I can give you the responses to your questions you have requested in that thread:
    Server Operating System - MS Windows Server 2003 R2 Enterprise Edition SP2
    Version of the .NET Framework - MS .NET Framework 3.5 SP1
    How did you deploy? - Installed CR 2008 SP1 runtime with msi package
    If you deployed with CRRuntime_12_0_mlb.msi - what was the date of the file and its size? CRRuntime_12_1_mlb.msi dated Sept. 16, 2008 12:55:00 PM, size: 56,717,824 bytes
    What is the file version of crpe32.dll on your server? You'll find this in the C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 directory - File was created 9/13/08 11:21AM, 9451KB File Version: 12.1.0.882
    How many libpng10.dll files are on your system? List all instances. - 1 instance is on the system located in C;\Program Files\Business Objects\Business Objects Enterprise 12.0\win32_x86 directory. It is dated 9/13/08 8:52:26AM 132KB version 1.0.30.1
    Any additional comments - We have tried to export to PDF and this works successfully. However, we can not export to xls or rft formats.
    CRXF_XLS.dll is 905KB 9/13/08 9:38AM Version 12.1.0.882
    CRXF_RTF.dll is 509KB 9/13/08 9:35AM Version 12.1.0.882
    We also have the CR XIR2 server runtime installed side by side on the server as we migrate from CR 2008 to CR XIR2 SP4 ( where this function does work currently).
    Please let me know if you need anything additional.
    Phil
    "Invalid export DLL or export format" with Crystal Reports 2008
    Posted: Sep 27, 2008 12:36 AM       E-mail this message      Reply 
    I've included this sticky because we are seeing many posts in this forum regarding the error Invalid export DLL or export format when exporting to Excel and RTF in .NET applications using the Crystal Reports 2008 .NET SDK.
    Issue
    Exporting a Crystal Report to Excel or RTF format
    .NET application using the Crystal Reports 2008 runtime (version 12.0)
    error Invalid export DLL or export format
    We've been doing some testing in-house and haven't reproduced this behavior. In order to figure this issue out we will need your help. If you are getting this error please reply to this post with the following information:
    Server Operating System
    Version of the .NET Framework
    How did you deploy?
    If you deployed with CRRuntime_12_0_mlb.msi - what was the date of the file and its size?
    What is the file version of crpe32.dll on your server? You'll find this in the C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 directory
    How many libpng10.dll files are on your system? List all instances.
    Any additional comments
    What We Know
    The error invalid export DLL or export format may occur when exporting to Excel and RTF formats in .NET applications utilizing the Crystal Reports 2008 runtime (v 12.0)
    Other export formats like Adobe PDF, Crystal Reports, CSV all export with no error
    Some customers have resolved this by adding C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to their environment path variables
    This may have something to do with the file libpng10.dll. Both crxf_xls.dll and crxf_rtf.dll are dependent on it.
    Thanks in advance for your co-operation. We hope to figure out what is causing this issue soon.

    Hi,
    I am also having the same problem, except that I am not using Crystal Report 2008 runtime but the actual Crystal Report 2008 installation on Windows XP SP2 with VS Studio 2005 (VC++). MS .NET Framework 2.0.
    Cyrstal Report XIR2 was installed on the same machine but uninstalled before installing Crystal Report 2008.
    So only one instance of libpng10.dll and found in C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86
    Crpe32.dll        3/1/2008 version 12.0.0.683
    Crxf_xls.dll       3/1/2008 version 12.0.0.683
    Crxf_rtf.dll         3/1/2008 version 12.0.0.683
    crdb_oracle.dll  3/1/2008 version 12.0.0.683
    libpng10.dll       3/1/2008 version 1.0.30.0             122880 bytes
    There is no problem for exporting to pdf, html, word, csv, Crystal Report. If I create a testing report without any data from database, the testing report can then be exported also to rtf and xls.
    Oracle 11.1.0.6 is the DB for the reports.
    Adding C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to the path did not resolve my problem.
    Any idea to fix this issue?
    Thanks
    Kin H Chan

  • Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

    I've Main Report + 5 sub report. All of this in a 1 file named _rptBorang.rpt.
    This _rptBorang.rpt consists of
    1. Main Report
    2. _spupimSPMBorang.rpt
    3. _spupimSTPMBorang.rpt
    4. _spupimSijilDiploma.rpt
    5. _spupimKoQ.rpt
    6. _spupimPilihanProg.rpt
    When I preview the report, the Enter values dialog box ask 7 parameters. It's
    1. idx
    2. tbl_MST_Pemohon_idx
    3. tbl_MST_Pemohon_idx(_spupimSPMBorang.rpt)
    4. tbl_MST_Pemohon_idx(_spupimSTPMBorang.rpt)
    5. tbl_MST_Pemohon_idx(_spupimSijilDiploma.rpt)
    6. tbl_MST_Pemohon_idx(_spupimKoQ.rpt)
    7. tbl_MST_Pemohon_idx(_spupimPilihanProg.rpt)
    My ASP.NET code as following,
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="_cetakBorang.aspx.vb" Inherits="_cetakBorang" title="SPUPIM" %>
    <%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1n" runat="server">
        <div align="center">
            <asp:Label ID="lblMsg" runat="server" ForeColor="Red"></asp:Label>
            <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
                AutoDataBind="true" />
        </div>
        </form>
    </body>
    </html>
    Imports System.configuration
    Imports System.Data.SqlClient
    Imports System.Web.Security
    Imports CrystalDecisions.Shared
    Imports CrystalDecisions.CrystalReports.Engine
    Partial Class _cetakBorang
        Inherits System.Web.UI.Page
        Private Const PARAMETER_FIELD_NAME1 As String = "idx"
        Private Const PARAMETER_FIELD_NAME2 As String = "tbl_MST_Pemohon_idx"
        Private Const PARAMETER_FIELD_NAME3 As String = "tbl_MST_Pemohon_idx(_spupimSPMBorang.rpt)"
        Private Const PARAMETER_FIELD_NAME4 As String = "tbl_MST_Pemohon_idx(_spupimSTPMBorang.rpt)"
        Private Const PARAMETER_FIELD_NAME5 As String = "tbl_MST_Pemohon_idx(_spupimSijilDiploma.rpt)"
        Private Const PARAMETER_FIELD_NAME6 As String = "tbl_MST_Pemohon_idx(_spupimKoQ.rpt)"
        Private Const PARAMETER_FIELD_NAME7 As String = "tbl_MST_Pemohon_idx(_spupimPilihanProg.rpt)"
        Dim myReport As New ReportDocument
        'rpt connection
        Public rptSvrNme As String = ConfigurationManager.AppSettings("rptSvrNme").ToString()
        Public rptUsr As String = ConfigurationManager.AppSettings("rptUsr").ToString()
        Public rptPwd As String = ConfigurationManager.AppSettings("rptPwd").ToString()
        Public rptDB As String = ConfigurationManager.AppSettings("rptDB").ToString()
        Private Sub SetCurrentValuesForParameterField(ByVal reportDocument As ReportDocument, ByVal arrayList As ArrayList, ByVal paramFieldName As String)
            Dim currentParameterValues As New ParameterValues()
            For Each submittedValue As Object In arrayList
                Dim parameterDiscreteValue As New ParameterDiscreteValue()
                parameterDiscreteValue.Value = submittedValue.ToString()
                currentParameterValues.Add(parameterDiscreteValue)
            Next
            Dim parameterFieldDefinitions As ParameterFieldDefinitions = reportDocument.DataDefinition.ParameterFields
            Dim parameterFieldDefinition As ParameterFieldDefinition = parameterFieldDefinitions(paramFieldName)
            parameterFieldDefinition.ApplyCurrentValues(currentParameterValues)
        End Sub
        Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Not IsPostBack Then
                publishReport(Convert.ToInt32(Session("applicantIdx")), Convert.ToInt32(Session("applicantIdx")))
            End If
        End Sub
        Private Sub publishReport(ByVal idx As Integer, ByVal tbl_MST_Pemohon_idx As Integer)       
            Try
                Dim reportPath As String = String.Empty
                reportPath = Server.MapPath("_rptBorang.rpt")
                myReport.Load(reportPath)
                myReport.SetDatabaseLogon(rptUsr, rptPwd, rptSvrNme, rptDB)
                Dim arrayList1 As New ArrayList()
                arrayList1.Add(idx)
                SetCurrentValuesForParameterField(myReport, arrayList1, PARAMETER_FIELD_NAME1)
                Dim arrayList2 As New ArrayList()
                arrayList2.Add(tbl_MST_Pemohon_idx)
                SetCurrentValuesForParameterField(myReport, arrayList2, PARAMETER_FIELD_NAME2)
                Dim arrayList3 As New ArrayList()
                arrayList3.Add(tbl_MST_Pemohon_idx)
                SetCurrentValuesForParameterField(myReport, arrayList3, PARAMETER_FIELD_NAME3)
                Dim arrayList4 As New ArrayList()
                arrayList4.Add(tbl_MST_Pemohon_idx)
                SetCurrentValuesForParameterField(myReport, arrayList4, PARAMETER_FIELD_NAME4)
                Dim arrayList5 As New ArrayList()
                arrayList5.Add(tbl_MST_Pemohon_idx)
                SetCurrentValuesForParameterField(myReport, arrayList5, PARAMETER_FIELD_NAME5)
                Dim arrayList6 As New ArrayList()
                arrayList6.Add(tbl_MST_Pemohon_idx)
                SetCurrentValuesForParameterField(myReport, arrayList6, PARAMETER_FIELD_NAME6)
                Dim arrayList7 As New ArrayList()
                arrayList7.Add(tbl_MST_Pemohon_idx)
                SetCurrentValuesForParameterField(myReport, arrayList7, PARAMETER_FIELD_NAME7)
                Dim parameterFields As ParameterFields = CrystalReportViewer1.ParameterFieldInfo
                CrystalReportViewer1.ReportSource = myReport
            Catch ex As Exception
                lblMsg.Text = ex.Message
            End Try
        End Sub
        Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
            myReport.Close()
        End Sub
    End Class
    The result was, my ASP.NET return error --- > Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
    I'm stuck
    Really need help
    Edited by: WKM1925 on Feb 22, 2012 11:49 AM

    First off, it would really be nice to have the version of CR you are using. Then
    1) does this report work the CR designer?
    2) What CR SDK are you using?
    3) If .NET, what version?
    4) Web or Win app?
    5) What OS?
    Then, please re-read your post and see if it actually makes any sense. To me, it's just gibberish...
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • When FMLE stopped,Remote RTMP stream to FMS 4.5 with rtmfp?

    When FMLE stopped,Remote RTMP stream to FMS 4.5 with rtmfp?
    edit  "applications/multicast/main.asc" ?
    HELP ME !!! THANKS!!!
    * File: main.asc
    * The server-side portion of the multicast sample application.
    * This app accepts publish and unpublish requests from FMLE, and republishes
    * the live stream from FMLE into a target Flash Group.
    // General Constants
    // "Constants" representing multicast event types.
    var TYPE_FUSION = 1;
    var TYPE_IP = 2;
    var TYPE_P2P = 3;
    // StreamContext Description, Constants and Functions
    * Type: StreamContext
    * This application tracks the context for live streams published to the server
    * that are being republished into a Flash Group. The StreamContext "type" used
    * for this is just an Object containing the following members:
    *   client         - The encoding/publishing client.
    *   streamName     - The source Stream name as published by the client.
    *   type           - The multicast event type.
    *   groupspec      - The groupspec identifying the Flash Group and capabilities.
    *   address        - IP multicast address (optional for pure P2P events).
    *   netConnection  - A loopback NetConnection used for the mcastNetStream.
    *   mcastNetStream - The NetStream used to republish the source Stream into
    *                    the Flash Group.
    *   netGroup       - An (optional) NetGroup handle for the target Group.
    *                    Only present for Fusion or P2P events.
    *   state          - One of the state constants defined immediately below
    *                    this comment.
    var STATE_INIT            = 0; // Starting state for a StreamContext.
    var STATE_CONNECTING      = 1; // Establishing loop-back connection.
    var STATE_CONNECTED       = 2; // Connection established.
    var STATE_PUBLISH_PENDING = 3; // Attempting to publish.
    var STATE_REPUBLISHING    = 4; // Actively republishing to multicast.
    var STATE_UNPUBLISHING    = 5; // Shutting down multicast republish.
    var STATE_UNPUBLISHED     = 6; // Unpublished successfully.
    var STATE_DISCONNECTING   = 7; // Shutting down loopback connection.
    var STATE_DISCONNECTED    = 8; // Connection shut down. Done.
    * Registers a source Stream published by the specified client, along with the
    * context for the multicast event, as a StreamContext Object.
    * @param client - The Client publishing the stream.
    * @param streamName - The source Stream name.
    * @param params - The parameters resulting from parsing the source Stream's
    *                 query string.
    * @return The new StreamContext Object for the registered Stream.
    function registerStream(client, streamName, params)
        var streamContext = { "client": client,
                              "streamName": streamName,
                              "type": params["fms.multicast.type"],
                              "groupspec": params["fms.multicast.groupspec"] };
    if (params["fms.multicast.interface"])
      streamContext["interfaceAddress"] = params["fms.multicast.interface"];
        if (params["fms.multicast.address"])
            streamContext["address"] = params["fms.multicast.address"],
        streamContext.state = STATE_INIT;
        updateStreamContextLookups(streamContext);
        trace("Registered multicast context for source stream: " + streamName);
        return streamContext;
    * Updates the indexed lookups installed for the passed StreamContext Object
    * with the application.
    * @param streamContext - The StreamContext Object to (re)index.
    function updateStreamContextLookups(streamContext)
        application.streamTable[streamContext.streamName] = streamContext;
        if (streamContext.netConnection)
            application.netConnTable[streamContext.netConnection] = streamContext;
        if (streamContext.mcastNetStream)
            application.mcastNetStreamTable[streamContext.mcastNetStream] = streamContext;
        if (streamContext.netGroup)
            application.netGroupTable[streamContext.netGroup] = streamContext;
    * Provides access to the StreamContext Object for a registered source Stream
    * by name.
    * @param streamName - A registered source Stream name.
    * @return The associated StreamContext Object; undefined if the source Stream
    *         name is not registered.
    function getStreamContextForSourceStream(streamName)
        return application.streamTable[streamName];
    * Provides access to the StreamContext Object for a given server-side
    * NetConnection hosting a multicast NetStream.
    * @param netConnection - A server-side NetConnection.
    * @return The associated StreamContext Object; undefined if the passed
    *         NetConnection is not indexed to a StreamContext.
    function getStreamContextForNetConnection(netConnection)
        return application.netConnTable[netConnection];
    * Provides access to the StreamContext Object for a given multicast NetStream.
    * @param netStream - A multicast NetStream.
    * @return The associated StreamContext Object; undefined if the passed
    *         NetStream is not indexed to a StreamContext.
    function getStreamContextForMulticastNetStream(netStream)
        return application.mcastNetStreamTable[netStream];
    * Provides access to the StreamContext Object for a given NetGroup associated
    * with a multicast NetStream.
    * @param netGroup - A NetGroup.
    * @return The associated StreamContext Object; undefined if the passed
    *         NetGroup is not indexed to a StreamContext.
    function getStreamContextForNetGroup(netGroup)
        return application.netGroupTable[netGroup];
    * Unregisters the StreamContext from the application.
    * @param streamContext - The StreamContext Object to unregister.
    function unregisterStreamContext(streamContext)
        if (streamContext.netConnection)
            delete application.netConnTable[streamContext.netConnection];
        if (streamContext.mcastNetStream)
            delete application.mcastNetStreamTable[streamContext.mcastNetStream];
        if (streamContext.netGroup)
            delete application.netGroupTable[streamContext.netGroup];
        trace("Unregistered multicast context for source stream: " +
              streamContext.streamName);
    // Application callback functions
    * Initializes global StreamContext lookup tables.
    application.onAppStart = function()
        application.streamTable = {};
        application.netConnTable = {};
        application.mcastNetStreamTable = {};
        application.netGroupTable = {};
    * Handles a publish event for the application by validating the request
    * and bridging the published stream into a target Flash Group. Invalid
    * publish requests are ignored and the publishing client's connection
    * is closed.
    * @param client - The publishing client.
    * @param stream - The published stream.
    application.onPublish = function(client, stream)
        //trace("Handling publish request for source stream: " + stream.name);
        var params = parseQueryString(stream.publishQueryString);
        if (!validateStreamParams(params))
            application.disconnect(client);
            return;
        var prevContext = getStreamContextForSourceStream(stream.name);
        if (prevContext)
            forceCloseStreamContext(prevContext);
        // Register source Stream, and kick off the async process that will
        // eventually wire-up the associated multicast NetStream.
        var streamContext = registerStream(client, stream.name, params);
        openMulticastConnection(streamContext);
    * Handles an unpublish event for the application by shutting down
    * any associated multicast NetStream.
    * @param client - The unpublishing client.
    * @param stream - The source stream being unpublished.
    application.onUnpublish = function(client, stream)
        trace("Handling unpublish request for source stream: " + stream.name);
        var streamContext = getStreamContextForSourceStream(stream.name);
        if (streamContext && (streamContext.state <= STATE_REPUBLISHING))
            destroyStreamContext(streamContext);
    // Callback functions for NetConnection and multicast NetStream/NetGroup wiring.
    * First step in setting up a republished multicast NetStream; open the loopback
    * connection it requires.
    * @param streamContext - The StreamContext Object for the publish event.
    function openMulticastConnection(streamContext)
        var nc = new NetConnection();
        nc.onStatus = netConnectionStatusHandler;
        streamContext.netConnection = nc;
        updateStreamContextLookups(streamContext);
        streamContext.state = STATE_CONNECTING;
        nc.connect(resetUriProtocol(streamContext.client.uri, "rtmfp"));
    * Status event handler for the loopback NetConnection used by the multicast
    * NetStream. Advances setup upon successful connection, or triggers or advances
    * tear-down as a result of connection loss or an unpublish and clean shutdown.
    * @param info - The status info Object.
    function netConnectionStatusHandler(info)
        var streamContext = getStreamContextForNetConnection(this);
        trace("Multicast NetConnection Status: " + info.code +
              (streamContext ? ", Source stream: " + streamContext.streamName : ", Not associated with a source stream."));
        if (streamContext)
            switch (info.code)
            case "NetConnection.Connect.Success":
                streamContext.state = STATE_CONNECTED;
                // If event type is Fusion or P2p, wire up a NetGroup for neighbor
                // bootstrapping and maintenance ahead of (re)publishing the stream.
                var type = streamContext.type;
                if (type == TYPE_FUSION || type == TYPE_P2P)
                    initNetGroup(streamContext);
                else
                    initMulticastNetStream(streamContext);
                break;
            case "NetConnection.Connect.Failed":
            case "NetConnection.Connect.Rejected":
            case "NetConnection.Connect.AppShutdown":
                trace("MULTICAST PUBLISH ERROR: Failed to establish server-side NetConnection for use by multicast NetStream. " +
                      "Status code: " + info.code + ", description: " + info.description + ", Source stream: " +
                      streamContext.streamName);
                streamContext.state = STATE_DISCONNECTED;
                destroyStreamContext(streamContext);
                break;
            case "NetConnection.Connect.Closed":
                if (streamContext.state < STATE_DISCONNECTING)
                    trace("MULTICAST PUBLISH ERROR: Unexpected server-side NetConnection close. " +
                         "Status code: " + info.code + ", description: " + info.description + ", Source stream: " +
                         streamContext.streamName);
                streamContext.state = STATE_DISCONNECTED;
                destroyStreamContext(streamContext);
                break;
            default:
                // Ignore.
    * Initializes the multicast NetGroup following a successful connection of its
    * underlying loopback NetConnection. This hook is optional and only runs for
    * event types of Fusion and pure P2P.
    * @param streamContext - The StreamContext Object for the multicast publish.
    function initNetGroup(streamContext)
        var ng = null;
        try
            ng = new NetGroup(streamContext.netConnection, streamContext.groupspec);
        catch (e)
            trace("MULTICAST PUBLISH ERROR: Failed to construct NetGroup. Error: "
                  + e.name + (e.message ? " " + e.message : "") +
                  ", Source stream: " + streamContext.streamName);
            destroyStreamContext(streamContext);
            return;
        ng.onStatus = netGroupStatusHandler;
        streamContext.netGroup = ng;
        updateStreamContextLookups(streamContext);
    * Status event handler for the multicast NetGroup. Advances to initializing the
    * multicast NetStream upon successful NetGroup connect. Otherwise, triggers
    * shut down.
    * @param info - The status info Object.
    function netGroupStatusHandler(info)
        var streamContext = getStreamContextForNetGroup(this);
        trace("Multicast NetGroup Status: " + info.code +
              (streamContext ? ", Source stream: " + streamContext.streamName : ", Not associated with a source stream."))
        if (streamContext)
            switch (info.code)
            case "NetGroup.Connect.Success":
                initMulticastNetStream(streamContext);
                break;
            case "NetGroup.Connect.Failed":
            case "NetGroup.Connect.Rejected":
                trace("MULTICAST PUBLISH ERROR: Failed to connect multicast NetGroup. " +
                      "Status code: " + info.code + ", description: " + info.description +
                      ", Source stream: " + streamContext.streamName);
                destroyStreamContext(streamContext);
                break;
            case "NetGroup.MulticastStream.UnpublishNotify":
                // At this point, multicast publishers will be notified;
                // continue shut down.
                destroyStreamContext(streamContext);
                break;
            default:
                // Ignore.
    * Initializes the multicast NetStream following a successful connection of its
    * underlying loopback NetConnection.
    * @param streamContext - The StreamContext Object for the multicast publish.
    function initMulticastNetStream(streamContext)
        var ns = null;
        try
            ns = new NetStream(streamContext.netConnection, streamContext.groupspec);
        catch (e)
            trace("MULTICAST PUBLISH ERROR: Failed to construct multicast NetStream. Error: " +
                  e.name + (e.message ? " " + e.message : "") +
                  ", Source stream: " + streamContext.streamName);
            destroyStreamContext(streamContext);
            return;
        var type = streamContext.type;
        if (type == TYPE_FUSION || type == TYPE_IP)
      var iAddr = (streamContext.interfaceAddress) ? streamContext.interfaceAddress : null;
            try
                trace("Multicast NetStream will publish to IP address: " + streamContext.address +
          " on interface address: " + ((iAddr) ? iAddr : "default") +
                      ", Source stream: " + streamContext.streamName);
                ns.setIPMulticastPublishAddress(streamContext.address, iAddr);
            catch (e2)
                trace("MULTICAST PUBLISH ERROR: Failed to assign IP multicast address and port for publishing. Address: "
                      + streamContext.address + " on interface address: " + ((iAddr) ? iAddr : "default") +
          ", Source stream: " + streamContext.streamName);
                destroyStreamContext(streamContext);
                return;
        ns.onStatus = netStreamStatusHandler;
        streamContext.mcastNetStream = ns;
        updateStreamContextLookups(streamContext);
        streamContext.state = STATE_PUBLISH_PENDING;
    * Status event handler for the multicast NetStream. Advances state upon successful
    * connect and publish, or upon successful unpublish. Triggers tear-down if we fail
    * to attach to a source Stream to republish.
    * @param info - The status info Object.
    function netStreamStatusHandler(info)
        var streamContext = getStreamContextForMulticastNetStream(this);
        trace("Multicast NetStream Status: " + info.code +
              (streamContext ? ", Source stream: " + streamContext.streamName : ", Not associated with a source stream."))
        if (streamContext)
            switch (info.code)
            case "NetStream.Connect.Success":
                if (!this.attach(Stream.get(streamContext.streamName)))
                    trace("MULTICAST PUBLISH ERROR: Failed to attach multicast NetStream to source. Source stream: " +
                          streamContext.streamName);
                    destroyStreamContext(streamContext);
        //var stream;
                //stream = Stream.get("liveStream");
                    //return;
                }else{
                this.publish(streamContext.streamName, "live");
                break;
            case "NetStream.Publish.Start":
                streamContext.state = STATE_REPUBLISHING;
                break;
            case "NetStream.Unpublish.Success":
                streamContext.state = STATE_UNPUBLISHED;
                // Wait for unpublish notify event if the context has a NetGroup;
                // otherwise continue shut down now.
                if (!streamContext.netGroup)
                    destroyStreamContext(streamContext);
                    break;
            default:
                // Ignore.
    * The common tear-down hook. Other functions that manage or shut down
    * the StreamContext Object delegate to this function upon detecting a fatal
    * error or during shut down.
    * @param streamContext - The StreamContext Object for the source Stream and
    *                        (potentially wired-up) multicast NetStream.
    function destroyStreamContext(streamContext)
        // Unregister by Stream name immediately; lookups by NetConnection, NetGroup
        // and multicast NetStream remain in place until tear-down is complete.
        delete application.streamTable[streamContext.streamName];
        switch (streamContext.state)
        case STATE_REPUBLISHING:
            streamContext.mcastNetStream.attach(false);
            streamContext.mcastNetStream.publish(false);
            streamContext.state = STATE_UNPUBLISHING;
            return;
        case STATE_CONNECTING:
        case STATE_CONNECTED:
        case STATE_PUBLISH_PENDING:
        case STATE_UNPUBLISHED:
            // Delete status handler callbacks and cleanup in case we arrived here
            // as a result of a force close.
            if (streamContext.netGroup)
                delete streamContext.netGroup.onStatus;
            if (streamContext.mcastNetStream)
                streamContext.mcastNetStream.attach(false);
                delete streamContext.mcastNetStream.onStatus;
            streamContext.netConnection.close();
            streamContext.state = STATE_DISCONNECTING;
            return;
        default:
            // Fall-through.
        // At this point, we either never got to the republishing state or we've
        // proceeded through the clean shut down steps above. Everything for this
        // StreamContext can go away.
        unregisterStreamContext(streamContext);
    * Utility function used to force close a StreamContext in the event that we
    * start handling a republish of a Source stream before the context for its
    * prior incarnation has been torn down.
    * @param streamContext - The StreamContext Object for the source Stream.
    function forceCloseStreamContext(streamContext)
        trace("Force closing previous multicast context for source stream: " + stream.name);
        prevContext.state = STATE_UNPUBLISHED;
        destroyStreamContext(prevContext);
    // Client callback functions
    * A no-op. Answers the RPC in the fashion expected by encoders, but the real
    * work happens in application.onPublish.
    * @param streamName - The name of the stream being published.
    Client.prototype.FCPublish = function(streamName)
        this.call("onFCPublish",
                  null,
                  {code:"NetStream.Publish.Start", description:streamName});
    * A no-op. Answers the RPC in the fashion expected by encoders, but the real
    * work happens in application.onUnpublish.
    * @param streamName - The name of the stream being unpublished.
    Client.prototype.FCUnpublish = function(streamName)
        this.call("onFCUnpublish",
                  null,
                  {code:"NetStream.Unpublish.Success", description:streamName});
    * If the client invoker's ip matches what was captured for a currently publishing
    * stream, assume it's the same client and reset the stream. Otherwise, ignore.
    * @param streamName - The name of the stream being released.
    Client.prototype.releaseStream = function(streamName)
        var streamContext = getStreamContextForSourceStream(streamName);
        if (streamContext &&
            (streamContext.client.ip == this.ip) &&
            (streamContext.state <= STATE_REPUBLISHING))
            // Only tear-down an orphaned stream if it's not
            // already shutting down (see state check above).
            destroyStreamContext(streamContext);
    // Helper functions
    * Validates that a newly published stream has correct metadata (e.g. query
    * string parameters) to republish into a Flash Group. This function also
    * writes a message to the application log for any validation failures.
    * @param params - The quiery string parameters for the source Stream.
    * @return true if valid; otherwise false.
    function validateStreamParams(params)
        var empty = true;
        for (var param in params)
           empty = false;
           break;
        if (empty)
            trace("MULTICAST PUBLISH ERROR: Stream query string is empty.");
            return false;
        if (!params["fms.multicast.type"])
    trace("MULTICAST PUBLISH ERROR: Stream query string does not specify a 'fms.multicast.type'.");
            return false;
        var type = params["fms.multicast.type"];
        if (type != 1 && type != 2 && type != 3)
            trace("MULTICAST PUBLISH ERROR: 'fms.multicast.type' has invalid value: " + type);
            return false;
        if (!params["fms.multicast.groupspec"])
            trace("MULTICAST PUBLISH ERROR: Stream query string does not specify a 'fms.multicast.groupspec'.");
            return false;
        // Fusion and IP require an address:port.
        if ((type == 1 || type == 2) &&
            !params["fms.multicast.address"])
            trace("MULTICAST PUBLISH ERROR: Stream query string does not specify a 'fms.multicast.address'.");
            return false;
        // No obvious validation issues.
        return true;
    * Parses the supplied query string, and if valid, returns an Object populated
    * with the name-value pairs contained in the query string. The simple processing
    * here does not preserve multiple name-value pairings having the same name; the
    * last value seen wins. Parameters with no value are mapped to "" (empty String)
    * in the returned Object.
    * @param queryString - A query string portion of a URI, not including the leading
    *                     '?' character.
    * @return An Object containing a key-value mapping for each name-value parameter
    *         defined in the query string; Object is empty if the query string is
    *         invalid.
    function parseQueryString(queryString)
        var result = {};
        var decoded = "";
        try
            decoded = decodeURIComponent(queryString);
        catch (e) // Invalid URI component; return empty result.
            return result;
        if (decoded.length)
            var params = decoded.split('&');
            for (var i in params)
                var pair = params[i];
         var sepIndex = pair.indexOf('=');
                if (sepIndex != -1)
                    var name = pair.substr(0, sepIndex);
                    result[name] = pair.substr(sepIndex + 1);
                else
                    result[pair] = "";
        return result;
    * Utility function used to swap out the protocol (scheme) portion
    * of a given URI with an alternate.
    * @param uri - The full URI.
    * @param desiredProtocol - The replacement protocol.
    * @return The URI with its protocol replaced.
    function resetUriProtocol(uri, desiredProtocol)
        var sepIndex = uri.indexOf("://");
        return desiredProtocol + uri.substr(sepIndex);

    HELP ME !!! THANKS!!!

  • While reading from the pl/sql cursor i got "Invalid column index" exception

    Hi,
    I got the "Invalid column index" exception while reading from the cursor.
    Please advice.
    Thanks in advance
    siva

    I suppose one (or more) index in your query is in a bad state.
    Possible solutions: rebuild (with 'ALTER INDEX <index> REBUILD ...')
    drop and recreate (it's the same as above, but a little more long)

  • LWAPP"invalid IP header checksum"

    Hello , i hace a problem with a wireless network based on 4 WiSM (two in two 6500) and AP1010. AP's get IP from the DHCP and associate to the controller, but after a while, they start sending a syslog message LWAPP-ERROR: "invalid IP header checksum". I have ping losses and the AP dissasociates, reloads and reassociates to the controller. Does anyone have found the same problem?
    thanks

    What code are you running on the WLC's? I know that with the AP1010, you can't be running the newer code. that is why I ask.
    Is this happening on all 4 WLC's and can you post a snip of the log from the cli.

  • HowTo Close stream on exception (FindBug)

    Hi there.
    I've just started to use the tool FindBugs which seems to work all right as far as it goes.
    But it claims, that in the following code the method may "fail to close stream on exception":
         void writeToFile(String fileName){
              System.out.print("Creating "+fileName+" ..");
              try {
                   FileOutputStream fos = new FileOutputStream(new File(fileName));
                   PrintWriter o = new PrintWriter(fos);  //this line is marked as error-prone
                   o.println("Some String");
                   o.close();
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              System.out.println(".done");
         }Whereas if I comment out the line with the o.println-call, everything's fine again for "FindBugs".
    I have absolutely no clue to what's meant by "on exception", since neither the line itself nor the following line throws an Exception.
    (BTW: adding an "finally" block or closing the stream after the try-catch-block doesn't seem to solve the problem for FindBugs).
    So, what's my problem? The code seems to work yet. But FindBugs seems to be a neat tool and since I don't like having code that might fail to close streams on exceptions,
    I'd like to hear from some of you how you'd code a simple block like that.
    (Add to that: I hate being corrected by a programme (At least as long as this fucker seems to be smarter than me ;) So now it's time for me to learn!! )
    Any suggestions about how to improve my programming technique are gratefully taken, as well as blind guessing around about what the hell FindBugs thinks I should do better.
    -T-

    Hi,
    This is the first time I am using findbugs tool. I have this piece of code
    <target if="javadoc.packages" name="findbug" >
    <!--<available file="etc/javadoc_build.inc" property="javadoc.buildinc"/>-->
    <findbugs home="D:\bin\common\_lib\build\findbugs"
    output="xml"
    outputFile="bcel-fb.xml" >
              <!--<auxClasspath path="${basedir}/lib/Regex.jar" />-->
              <sourcePath path="C:\java.zip" />
    <class location="C:\java.zip" />
    </findbugs>
    </target>
    My questions are
    1)Is the <auxClasspath> extension required.
    2)on running ant task, i get the following error
    D:\deepak\buildProcess_2\logging>ant findbug
    Buildfile: build.xml
    [taskdef] Could not load definitions from resource tasks.properties. It could not be found.
    findbug:
    findbug:
    BUILD FAILED
    file:D:/deepak/buildProcess_2/_setup/docs.xml:190: Could not create task or type of type: findbugs.
    Ant could not find the task or a class this task relies upon.
    This is common and has a number of causes; the usual
    solutions are to read the manual pages then download and
    install needed JAR files, or fix the build file:
    - You have misspelt 'findbugs'.
    Fix: check your spelling.
    - The task needs an external JAR file to execute
    and this is not found at the right place in the classpath.
    Fix: check the documentation for dependencies.
    Fix: declare the task.
    - The task is an Ant optional task and optional.jar is absent
    Fix: look for optional.jar in ANT_HOME/lib, download if needed
    - The task was not built into optional.jar as dependent
    libraries were not found at build time.
    Fix: look in the JAR to verify, then rebuild with the needed
    libraries, or download a release version from apache.org
    - The build file was written for a later version of Ant
    Fix: upgrade to at least the latest release version of Ant
    - The task is not an Ant core or optional task
    and needs to be declared using <taskdef>.
    Remember that for JAR files to be visible to Ant tasks implemented
    in ANT_HOME/lib, the files must be in the same directory or on the
    classpath
    Please neither file bug reports on this problem, nor email the
    Ant mailing lists, until all of these causes have been explored,
    as this is not an Ant bug.
    Total time: 3 seconds
    Anyone suggest me a solution.
    bye,
    with regards,
    Deepak.

Maybe you are looking for

  • Idoc packaging at sender side

    Hi all, What is Idoc Packaging? I have a scenario(Idoc to file) where sender is sending multiple idocs and I have to collect it without using BPM is it possible? Can Idoc Packaging help me in this.. If yes kindly give me all the development details t

  • Copy and paste a map/forecast

    I have to do a month long project for a college class and am having a hard time copying a surface map. There seems to be no print screen key or other special thing that would help me out.  Am I sol?  I am really frustrated!  So any help would be grea

  • BOM changes inputting the BOM component -reg

    Hi Friends, we would like to know the BOM quantity changes happened for a particular BOm component . Using CS80 we have to input BOM header to know BOm changes , but our requirement is for a BOM component what changes are made and when they are made

  • Rpm details wanted for Solaris

    Hi All, I have rpm file for solaris.But when I do man rpm it says no manual entry.So how do I extract the package from the RPM file? Is there any rpm equivalent command in Solaris?My Solaris version is 5.9.Do I need to install relevant package for th

  • Problem on one mac but not the other

    This is an odd issue. I have an imac and macbook in the house. I know about the open ports set up and they are. On the macbook I can start a video chat just fine, and this is over wireless and on the imac I cannot, this is on gigiabit ethernet. Would