Problem in loading Objects using ObjectInputStream

Hello,
This method load data from the secondary memory/
public void load() throws Exception
//File dataFile = new File(".\\center.dat");
//if (dataFile.exists())
ObjectInputStream in = null;
in = new ObjectInputStream(new
FileInputStream("center.dat"));
System.out.println("Open file for reading");
if(in == null)
System.out.println("File does not open correctly");
//Load courses
courses = (CourseList)in.readObject();
System.out.println("Successfully read courses of the system");
//Load Modules
modules = (ModuleList)in.readObject();
System.out.println("Successfully read modules of the system");
//Load Batches
batches = (BatchList)in.readObject();
System.out.println("Successfully read batches of the system");
//Load Candidates
candidates = (CandidateList)in.readObject();
System.out.println("Successfully read candidates of the system");
in.close();
System.out.println("Close objects file");
As i print the message of the exception it print Code excepting
I get this exception when i call readObject method and i had checked Object of ObjectInputStream i.e. in is not null.
Please help me

1) Stick to your thread: http://forum.java.sun.com/thread.jspa?threadID=651247
2) What's the stack trace?

Similar Messages

  • Problem with reading objects through ObjectInputStream

    HI
    Actually i have a problem of reading the objects from ObjectInputStream and getting StreamCorruptedException when i try to read as there is no limit to find the end of file i think iam getting the exception any suggestions please to overcome this problem..

    Of course I can, I have included two classes.
    MyMap that I shall store values in and then save to disk.
    Test Map that I stores one value in MyMap and then
    serialize to disk and the I do the reverse and se if my value is still there. Check out for yourself and please dont hestate to ask if you have trouble using it.
    import java.util.HashMap;
    import java.io.Serializable;
    * This class must implement Serializable to be stored in disk
    * with write(Object)
    public class MyMap implements Serializable
      private HashMap map = new HashMap();
      public void put(Serializable key, Serializable value)
        map.put(key,value);
      public Object get(Object key)
        return map.get(key);
    // Second class
    import java.io.*;
    public class TestMap
      public TestMap()
        try
          showHowToUseSerialize();
        catch(Throwable ignored)
          ignored.printStackTrace();
      private void showHowToUseSerialize()throws Throwable
        // First store anything to the class MyMap
        MyMap myMap = new MyMap();
        //  When yuo use put on it it only accept Serializable
        //  se how in the class
        myMap.put("key1","This is the first object in MyMap");
        // Then serialize it to disk.
        serialize(myMap);
        // Now you try to retreive from the file and see if you
        // can get the value key1 stored inside it.
        Object object = deserialize();
        // Cast it to the kind of object you have stored there.
        MyMap mapFromDisk = (MyMap)object;
        // See if key1 is really there.
        String value = (String)mapFromDisk.get("key1");
        // Print it out just be sure...
        System.out.println("key1 stored in MyMap in disk is: "+value);
      private Object deserialize()throws Throwable
        File f = new File("C:\\temp\\mymap.ser");
        if(!f.exists())
        { // Check that there really is such serialized file.
          throw new FileNotFoundException("Didnt find the serialized file: "+f);
        FileInputStream in = new FileInputStream(f);
        ObjectInputStream objIn = new ObjectInputStream(in);
        // Read in the object from the file.
        return objIn.readObject();
      private void serialize(Object myMap) throws Throwable
        File f = new File("C:\\temp\\mymap.ser");
        if(!f.exists())
          f.createNewFile();
        FileOutputStream out = new FileOutputStream(f);
        ObjectOutputStream objOut = new ObjectOutputStream(out);
        objOut.writeObject(myMap);
        objOut.close();
      public static void main(String[] args)
        new TestMap();
    }

  • Facing problem in loading table using IKM Oracle Slowly Changing Dimension

    Hi,
    I am facing problem in loading dimension table using IKM Oracle Slowly Changing Dimension
    Following is the setup :-
    SRC :- source_table (MSSQL)
    Staging :- staging_table (MSSQL)
    TRGT :- target_table (Oracle)
    -------- source_table
    group_id     int
    group_version_id     int
    name     varchar (255)
    description     varchar (255)
    comments     varchar (2000)
    ref_number     varchar (255)
    is_latest_version     decimal (5)
    is_deleted     decimal (5)
    --------- target_table
    id     number (38,0) - Mapped to <%=odiRef.getObjectName( "L" , "SEQ_NAME" , "D" )%>.nextval
              - Executed on target
              - defined the column as SK in model
    group_id     number (38,0) - defined the column as NK in model     
    group_version_id     number (38,0) - defined the column as NK in model     
    name     varchar (255) - undefined on the model description
    description     varchar (255) - Add row on change
    comments     varchar (2000) - Add row on change
    ref_number     varchar (255) - Add row on change
    is_latest_version     number (1,0) - Add row on change
    is_deleted     number (1,0) - Add row on change
    start_datetime     date     - SYSDATE
                   - Executed on target
                   - Starting Timestamp
    end_datetime     date     - NULL
                   - Executed on target
                   - End Timestamp
    I am using following KM's:-
         LKM SQL to SQL
         IKM Oracle Slowly Changing Dimension
         CKM SQL
    it gives me the following error -
    920:Invalid relational operator

    Hi,
    Yes, this is a run-time error. Currently I am debugging it by checking SNP_SESS_TXT_LOG based on sess_no ID.
    Now, I get the following error.
    I just see the following in the operator:-
    911 : 42000 : java.sql.BatchUpdateException: ORA-00911: invalid character
    911 : 42000 : java.sql.SQLException: ORA-00911: invalid character
    java.sql.BatchUpdateException: ORA-00911: invalid character
         at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:342)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10720)
         at com.sunopsis.sql.SnpsQuery.executeBatch(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    So, I do not get any idea of the exact step that is causing failure.
    Is there any setting in the operator that I am missing on?

  • Interlace problems with moving objects using iDVD

    I had an MP4 file (created by a 3rd party) from a Hi-8 analog tape which has some interlace artifacts on moving images (left image of boy) but not too bad. When the MP4 files was imported into iMovie 11 the interlace artifacts smoothed somewhat - that was OK (right image of boy). The camera was still and the boy was moving.  Vertical lines on stationary objects are OK in all images. These are screen captures from the Mac of the mp4 played through quicktime and the same file imported into iMovie 11 and played.  I paused both to take the screen capture.
    The completed project in iMovie 11 looked OK when previewed prior to rendering. These are 20 year old videos so my expections were being met.   I rendered the project with iDVD to the hard drive first and then to a DVD with the same poor imaging result on the moving object.  I am using a new Macbook Pro I bought in early January which came with iMovie 11 and iDVD  Ver 7.1.2 (1158). Running Mac OS X 10.7.3  Macbook Pro  2.3 Ghz Corei7   8GB 1333 Mhz DDR3.
    I couldn't screen capture from the MAC DVD player screen to illustrate the poor result (got a checkerboard screen) so I took a photo of the screen and imported that (below).  The moving boy on the left is from an  iMovie 11 screen capture, the image on the right is the moving boy from the rendered DVD I paused on the Mac (and took a pic of).
    Below a close up of the poorly rendered moving boy viewed on the resultant DVD.  This translates into a horrible rendition of any quick moving object.  It happens with any moving image - i.e. a pan across a room with straight vertical lines like edges of a wall will show as serrated and poorly rendered edge. I used a trial version of the Daniusoft DVD creator with the same result!  I am at a loss on how to resolve this issue.  Any thoughts out there??
    I had previously used Pinnacle Studios on my old XP PC which worked great on other tape's Mpeg files and created great DVD's (never had an interlace problem) ... until my computer died .....  so I figured Apple and associated software should be at least equal if not a superior product.   Now I'm not too sure!

    I had an MP4 file (created by a 3rd party) from a Hi-8 analog tape which has some interlace artifacts on moving images (left image of boy) but not too bad. When the MP4 files was imported into iMovie 11 the interlace artifacts smoothed somewhat - that was OK (right image of boy). The camera was still and the boy was moving.  Vertical lines on stationary objects are OK in all images. These are screen captures from the Mac of the mp4 played through quicktime and the same file imported into iMovie 11 and played.  I paused both to take the screen capture.
    The completed project in iMovie 11 looked OK when previewed prior to rendering. These are 20 year old videos so my expections were being met.   I rendered the project with iDVD to the hard drive first and then to a DVD with the same poor imaging result on the moving object.  I am using a new Macbook Pro I bought in early January which came with iMovie 11 and iDVD  Ver 7.1.2 (1158). Running Mac OS X 10.7.3  Macbook Pro  2.3 Ghz Corei7   8GB 1333 Mhz DDR3.
    I couldn't screen capture from the MAC DVD player screen to illustrate the poor result (got a checkerboard screen) so I took a photo of the screen and imported that (below).  The moving boy on the left is from an  iMovie 11 screen capture, the image on the right is the moving boy from the rendered DVD I paused on the Mac (and took a pic of).
    Below a close up of the poorly rendered moving boy viewed on the resultant DVD.  This translates into a horrible rendition of any quick moving object.  It happens with any moving image - i.e. a pan across a room with straight vertical lines like edges of a wall will show as serrated and poorly rendered edge. I used a trial version of the Daniusoft DVD creator with the same result!  I am at a loss on how to resolve this issue.  Any thoughts out there??
    I had previously used Pinnacle Studios on my old XP PC which worked great on other tape's Mpeg files and created great DVD's (never had an interlace problem) ... until my computer died .....  so I figured Apple and associated software should be at least equal if not a superior product.   Now I'm not too sure!

  • Problem with loading data using SQL LOADER

    I am having following files with me when i run following command at command prompt
    sqlldr scott/tiger@genuat control =c:\emp.ctl
    then giving error as
    SQL Loader 500: unable to open file
    SQL Loader 553: file not found
    emp.dat file data
    1111,sneha,CLERK     7902,17-Dec-80,800,20
    2222,manoj,SALESMAN,7698,20-Feb-72     ,1600,6500,30
    3333,sheela,MANAGER,7839,8-Apr-81,2975,20     
    emp.ctl file
    LOAD DATA
    INFILE 'c:\emp.dat'
    APPEND
    INTO TABLE emp
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (EMPNO,
    ENAME ,
    JOB,
    MGR,
    HIREDATE,
    SAL ,
    COMM,
    DEPTNO)
    can anyone tell me what is problem in above file why data is not loaded in table??

    I don't find any problem if you invoke the SQLLDR using the below command(and if you are certain that the control file resides in the C: drive).
    sqlldr scott/tiger@genuat control =c:\emp.ctl
    If this doesn't work then invoke the SQLLDR from the C: prompt itself.
    sqlldr scott/tiger@genuat control=emp.ctl
    It would locate the control file and check whether the sqlldr completes successfully?

  • Problem in accessing object using Expression Language

    Hello All,
    Im using Tomcat 5.5 and I am learning Expression language.Im using one servlet page as login.java i.e,
    package common;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import Database.DatabaseObject;
    import valueobjects.login1;
    public class login extends HttpServlet {
         public static final long serialVersionUID = 8707690322213556804l;
         public void doPost(HttpServletRequest req, HttpServletResponse res) {
              String name = req.getParameter("username");
              String password = req.getParameter("password");
              RequestDispatcher dispatch = null;
              ResultSet rs=null;
              Statement st=null;
              login1 log=null;
              Connection con = null;
              String sql=null;
              try
              con=new DatabaseObject().getConnection();
              st = con.createStatement();
              sql="select * from login";
              System.out.println(sql);
              rs=st.executeQuery(sql);
              while(rs.next())
                   log=new login1(rs.getString("User_Name"),rs.getString("user_Password"));
              req.setAttribute("login",log);
              req.setAttribute("username",name);
              req.setAttribute("password",password);
              dispatch = req.getRequestDispatcher("/jsps/el.jsp");
              dispatch.forward(req, res);
              catch(Exception e)
                   e.printStackTrace();
    That login1 customized object is set as ,
    package valueobjects;
    public class login1{
         String Name;
         String Password;
         public login1(String name, String password) {
              super();
              // TODO Auto-generated constructor stub
              Name = name;
              Password = password;
         public String getName() {
              return Name;
         public void setName(String name) {
              this.Name = name;
         public String getPassword() {
              return Password;
         public void setPassword(String password) {
              this.Password = password;
    then im using one jsp as el.jsp that is,
    <%@ page isELIgnored="false"%>
    <%@ page import = "java.util.*,valueobject.*"%>
    <html>
    <jsp:useBean id="login" class="valueobjects.login1">
    <jsp:setProperty name="login" property="name" value="username"/>
    <jsp:setProperty name="login" property="password" value="password"/>
    </jsp:useBean>
    <body>
         <center>
         username=${login.Name}<br><br>
         </center>
    </body>
    </html>
    but when i execute this code it is giving error as
    /jsps/el.jsp(4,0) The value for the useBean class attribute valueobjects.login1 is invalid.
    But that login1.java is in correct package that is valueobjects.but im not getting why it is giving such error.Plz help me.

    hi
    to use java bean u MUST follow the two conviosions:
    1. the class u want to make a bean from it must have no-argument constructor
    2. u must provide setter and getter for every instance variable , the name of instance varible must begin with small letter and its setter and getter must be like setXxx() and getXxx()
    the correct bean is :
    package valueobjects;
         public class login1{
         String name;
         String password;
         public String getName()
                   return name;
         public void setName(String name)
                   this.name = name;
         public String getPassword()
                    return password;
         public void setPassword(String password)
                    this.password = password;
         }where is my duke's $ ???

  • Problem creating Cipher object using getInstance

    Hi all, Can anyone please help me with this? I am using jdk1.4 which has jce. I have put jce.jar jars in classpath. When I create Cipher object like
    Cipher itsocipher1 = Cipher.getInstance("DES");
    it compiles fine but when I exicute it get following error java.lang.NoSuchMethodError at javax.crypto.SunJCE_d.a(DashoA6275) at javax.crypto.SunJCE_d.a(DashoA6275) at javax.crypto.SunJCE_d.verify(DashoA6275) at javax.crypto.SunJCE_b.f(DashoA6275) at javax.crypto.SunJCE_b.<clinit>(DashoA6275) at javax.crypto.Cipher.getInstance(DashoA6275) at EncryptDecrypt.main(EncryptDecrypt.java:26) Please Guide. Thanks.

    Copy the jce provider's jar file ( if using SunJCE, then copy sunjce_provider.jar file) to jre's lib/ext directory.
    You can also see in the java.policy file where the jvm is looking for the jar files.
    grant codeBase "file:${java.home}/lib/ext/*" {
    permission java.security.AllPermission;
    };

  • Problem in Loading Applet using WebLogic 4.5

    Hi!
    When I try this Hello example of weblogic in 4.5 I am getting the following error.
    How to resolve this?
    Very Urgent.
    thanks in advance.
    regards,
    jai
    HelloApplet: an exception occurred:
    [Root exception is weblogic.rmi.UnmarshalException: Unmarshalling return
    - with nested exception:
    [java.io.EOFException]]javax.naming.CommunicationException
         at weblogic/jndi/toolkit/ExceptionTranslator.toNamingException
         at weblogic/jndi/toolkit/ExceptionTranslator.toNamingException
         at weblogic/jndi/WLInitialContextFactory.toNamingException
         at weblogic/jndi/WLInitialContextFactory.newContext
         at weblogic/jndi/WLInitialContextFactory.getInitialContext
         at weblogic/jndi/Environment.getContext
         at weblogic/jndi/Environment.getInitialContext
         at weblogic/rmi/Naming.getContext
         at weblogic/rmi/Naming.lookup
         at HelloAppletLocal.init
         at com/ms/applet/AppletPanel.securedCall0
         at com/ms/applet/AppletPanel.securedCall
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run
    --------------- nested within: ------------------
    weblogic.rmi.UnknownHostException: Could not init server [T3://sanjay:7001/HelloServer]
    - with nested exception:
    [[Root exception is weblogic.rmi.UnmarshalException: Unmarshalling return
    - with nested exception:
    [java.io.EOFException]]javax.naming.CommunicationException]
         at weblogic/rmi/Naming.getContext
         at weblogic/rmi/Naming.lookup
         at HelloAppletLocal.init
         at com/ms/applet/AppletPanel.securedCall0
         at com/ms/applet/AppletPanel.securedCall
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run

    Use the plugin for your browser that corresponds to the version of the JDK that the server is running, ie 1.2 plugin for 1.2 server.
    jairag wrote:
    Hi!
    When I try this Hello example of weblogic in 4.5 I am getting the following error.
    How to resolve this?
    Very Urgent.
    thanks in advance.
    regards,
    jai
    HelloApplet: an exception occurred:
    [Root exception is weblogic.rmi.UnmarshalException: Unmarshalling return
    - with nested exception:
    [java.io.EOFException]]javax.naming.CommunicationException
    at weblogic/jndi/toolkit/ExceptionTranslator.toNamingException
    at weblogic/jndi/toolkit/ExceptionTranslator.toNamingException
    at weblogic/jndi/WLInitialContextFactory.toNamingException
    at weblogic/jndi/WLInitialContextFactory.newContext
    at weblogic/jndi/WLInitialContextFactory.getInitialContext
    at weblogic/jndi/Environment.getContext
    at weblogic/jndi/Environment.getInitialContext
    at weblogic/rmi/Naming.getContext
    at weblogic/rmi/Naming.lookup
    at HelloAppletLocal.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    --------------- nested within: ------------------
    weblogic.rmi.UnknownHostException: Could not init server [T3://sanjay:7001/HelloServer]
    - with nested exception:
    [[Root exception is weblogic.rmi.UnmarshalException: Unmarshalling return
    - with nested exception:
    [java.io.EOFException]]javax.naming.CommunicationException]
    at weblogic/rmi/Naming.getContext
    at weblogic/rmi/Naming.lookup
    at HelloAppletLocal.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run

  • Reading Objects using NIO

    I having problems reading an object using NIO APIs. I am end creating an Object and pass it through a socket. When I retrieve the data from the input stream within the socket I initialize a ByteBuffer by allocating a length. The problem is that there is NO way of knowing what to allocate that ByteBuffer when reading in the object. Below is within a method that allows me to read information from the socket.
    //Allocate the length ByteBuffer.
    ByteBuffer buffer = ByteBuffer.allocate(1024);
    //Read the data from the SocketChannel....PROBLEM IS WHAT IF I NEED TO DO MULTIPLE READS
    socketChannel.read(buffer);
    ///We will create a byte array from the ByteBuffer.
    byte[] b = buffer.array();
    //ByteArrayInputStream that we will create and put the byte array in.
    ByteArrayInputStream bis = new ByteArrayInputStream(b);
    //ObjectInputStream where we will use the ByteArrayInputStream.
    ObjectInputStream input = new ObjectInputStream(bis);
    //Object that we will read in.
    Object obj = input.readObject();
    //Message that we will end up receiving.     
    Message receivingMsg = null;
    //Once we have our Message we will end up closing the connection.
    bis.close();
    input.close();
    //We will clear the buffer.
    buffer.clear();
    //We will cast the object to a message object so
    //that we can end up sending it through the right
    //routine which will allow us to send a response
    //back to the client. *********SPECIAL Class that will cast our generic object into a Message Object.
    Message receivedFromClient = (Message) obj;
    //we will end up taking that message and returning it.
    Message returningMsg = communicate(receivedFromClient);
    //Here we will end up taking the Message and putting it into the ByteBuffer.          
    ByteBuffer bb = objectToOutputStreamByteBuffer(returningMsg);
    socketChannel.write(bb);
    ----The problem is if I have more data within that Object. I need to re-allocate the ByteBuffer object and read everything on that socket. I tried the following code but I really don't feel it will be optimized the best for performance. I guess my question is that should I even be using NIO in this situation or Blocking IO?
    Again, here is the code that will read multiple data from the socket until it is -1.
    //Here we will read the information we received by first allocating
    //a ByteBuffer object.
    ByteBuffer buffer1 = ByteBuffer.allocate(5);
    ByteBuffer buffer2 = ByteBuffer.allocate(0);
    //We will read the data from this object.
    while ((socketChannel.read(buffer1)) != -1) {
    //We will check the Buffers and then try to recreate a new ByteBuffer that will put the remaining
    //stuff within the buffer. NOT SURE IF THIS IS THE MOST EFFICIENT WAY OF DOING THIS
    //AND ACTUALLY DON'T HAVE THE CODE WORKING CORRECTLY. THIS IS WHERE I
    //NEED HELP ON THE CORRECT WAY TO DO THIS.
         if (buffer1.remaining() < buffer2.remaining()) {
              buffer1.flip();
              buffer2 = ByteBuffer.allocate(buffer1.remaining() + buffer2.remaining());
              System.out.println("tmp 2 Remaining : " + buffer2.remaining());
              //tmp.put(buffer2);
              //buffer2 = tmp;
              System.out.println("Buffer 2 Remaining : " + buffer2.remaining());
         buffer2.put(buffer1);
         buffer1.clear();
    //We will create a byte array from the ByteBuffer.                    
    byte[] b = buffer.array();
    //ByteArrayInputStream that we will create and put the byte array in.
    ByteArrayInputStream bis = new ByteArrayInputStream(b);
    //ObjectInputStream where we will use the ByteArrayInputStream.
    ObjectInputStream input = new ObjectInputStream(bis);
    //Object that we will read in.
    Object obj = input.readObject();
    //Message that we will end up receiving.     
    Message receivingMsg = null;
    //Once we have our Message we will end up closing the connection.
    bis.close();
    input.close();
    //We will clear the buffer.
    buffer2.clear();
    buffer1.clear();
    //We will cast the object to a message object so
    //that we can end up sending it through the right
    //routine which will allow us to send a response
    //back to the client.
    Message receivedFromClient = (Message) obj;
    //we will end up taking that message and returning it.
    Message returningMsg = communicate(receivedFromClient);
    //Here we will end up taking the Message and putting it into the ByteBuffer.          
    ByteBuffer bb = objectToOutputStreamByteBuffer(returningMsg);
    socketChannel.write(bb);
    Any help would be greatly appreciated.

    I use my own InputStream class overriding the two standard read functions read( byte[], index, length ) and read(). When you construct it pass in the channel you are reading from and read from the channel on demand. ie when a call to read comes in you read say 100 bytes from the channel. The call required only 80 so these are consumed and the other 20 are buffered. Another read call is made, this time for 50 bytes but we only have 20 buffered so another read of the channel is needed. It is up to you whether you break the contract of read( byte[], index, length ) to keep reading the channel until the full "length" is available, or handle this in your application code.
    Then because this class is InputStream you can wrap it up inside any stream you like such as the ObjectInputStream and the data will be serialized correctly.

  • Loader Object throwing #2148

    Hello:
    I have a swf file that I am developing to email to other
    users, basically a standalong swf. The file is created with
    localwithnetwork (using -use-network=false compiler parameter) so
    it has no local file system access. The reason this swf has
    localwithnetwork access is to open the hyperlinks in the swf. There
    are few images stored as bytearrays in the swf which is loaded
    using the Loader object using the following syntax:
    this._loader.loadBytes(cachedImage.getBytes(),new
    LoaderContext(false,ApplicationDomain.currentDomain));
    But now when I open the swf I get the following error :
    SecurityError: Error #2148: SWF file
    file://\\SSRV\Data\tmp\File.swf cannot access local resource
    file://\\SSRV\Data\tmp\File.swf/[[DYNAMIC]]/1. Only
    local-with-filesystem and trusted local SWF files may access local
    resources.
    at flash.display::Loader/get content()
    at
    aclient.core::ImageBytesObject/onLoadComplete()[C:\aclient\core\ImageBytesObject.as:169]
    I am not able to make out what is causing this error as I am
    not loading anything from the file system. Everything that is being
    loaded is from the swf itself and is in memory. So what could be
    causing this error.? If I ignore this error the images do not load
    and it shows a placeholder where the images should have been. I am
    really out of luck here. I have used Security.Allowdomain('*") as
    well but that also does not seems to work? Any help here would be a
    big help.
    Thanks!!

    Thanks Greg. But then how do i instruct the swf to ignore the
    cache image?

  • Problem in loading an applet using JRE 1.5

    Hi,
    I have an applet which is working fine under JRE 1.4, but the same applet failing to load by using JRE 1.5
    Problem Description:
    1. The images in the applet fails to load using JRE 1.5
    2. The Username and Password text box are also failing to initialize.
    Can anyone help me out in this.
    Is there any code changes required ?

    I wonder if you have the same problem as me... Maybe we can find a solution for us both, no need for me to open a new thread for this topic then...
    I wrote an applet using Swing and compiled it using JavaSDK 1.4.x. I also installed the 1.4.x JRE for both of my test browsers. In Mozilla 1.1 the applet displays properly all the time. In IE6 SP1 it sometimes works as intended but sometimes the applet simply stops working, as per my Java Console somewhere after invoking the "start" method. Parts of the applet simply become gray and when I resize it - I have a JFrame in my applet - the whole JFrame becomes gray and does not respond to input nor it redraws itself. Shutting down IE does not close the JFrame(although the java console reports normal program termination and cleanup) and the only way to close it is through the task manager. I am using Windows 98SE btw.
    Does it sound similiar to your problem? It happens ONLY with IE, not with Mozilla. Anybody has an idea on what it could be? I doubt there's an error in my code...

  • Problem in loading large data to SDE using Shp2sde command

    Hi,
    When we try load data to SDE (Oracle 8.1.5, Sun solaris 2.6)using shp2sde command, we get the following error message and the data is loaded partially:-
    " SDE: Shape #2560 is an invalid entity type for layer station.
    3337 features converted
    3337 features stored "
    The shape file had 4352 features of type point.
    If the same data is splitted into 2 (one having 1906 features and another having 2446 features), there is no problem in loading.
    The giomgr.log file had the following lines corresponding to this
    loading.
    Process 9512, R/T calls 14, features read 0, wrote 3337, locks 0,
    buffers 1, partial 0, buffered features 3337, buffered data 555K
    We suspect this is due some size specified somewhere which limits
    loading of all the data. So our DBA granted SDE user quota unlimited to SDE tablespace. After the granting, everything works fine, we can load the data. But when we restart the server, the same error appear again.
    We are encountering this error in production but not in the devt environment. We urgently need to solve this problem. Anyone has solution to this problem?
    Thanks.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Gerjan Walrecht ([email protected]):
    What is your commit interval? (-c ...)<HR></BLOCKQUOTE>
    My commit interval is 1000. Even if I reduce the commit to 500, the result is still the same.
    I was wandering is there anywhere where Oracle limit the size of the loading? or Kernel.. etc
    null

  • Beginner Has Problem With Loading JDBC Driver Using MySQL

    Hi, I am having problem with loading JDBC driver, and need your diagnotic help.
    1. I have installed MySQL (C:\mysql), created a databse (soup), and created a littel table (VIDEOS). I am able to see the table in the console:
    sql> select * from videos
    2. I have downloaded the latest version of Connector/J (mysql-connector-java-3.1.0-alpha.zip), and unzip the zip file into my C:\ directory.
    3. I copied the mysql-connector-java-3.1.0-alpha-bin.jar to the C:\j2sdk1.4.1_02\jre\lib\ext folder and it is in my CLASSPATH
    4. MySQL server is running
    C:\> C:\mysql\bin\mysqld-nt --standalone
    5. open another DOS window and use the database
    mysql>USE SOUP
    6. succesfully compiled a Java program (javac Test.java):
    import java.sql.* ;
    public class Test
    public static void main( String[] args )
    try
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    try
    Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/soup" );
    try
    Statement statement = con.createStatement();
    ResultSet rs = statement.executeQuery("SELECT TITLE FROM VIDEOS");
    while ( rs.next() )
    System.out.println( rs.getString( "TITLE" ) );
    rs.close();
    statement.close();
    catch ( SQLException e )
    System.out.println( "JDBC error: " + e );
    finally
    con.close();
    catch( SQLException e )
    System.out.println( "could not get JDBC connection: " + e );
    catch( Exception e )
    System.out.println( "could not load JDBC driver: " + e );
    7. when I run the Java program (java Test), I got
    the message:
    could not load JDBC driver: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    What am I missing?

    Hi,
    I missed to specify test in my last post.
    Try running your program by explicitly setting the classspath when
    running your program . java -classpath c:\mysql-connector-java-3.1.0-alpha-bin.jar test
    Make sure your jar file contains org.gjt.mm.mysql.Driver class

  • Problem occured when create a tree table for master-detail view objects using SQL queries?

    I am programming a tree table for master-detail view objects using SQL queries and these 2 view objects are not simple singel tables queries, and 2 complex SQL are prepared for master and view objects. see below:
    1. Master View object (key attribute is SourceBlock and some varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK,                   
            sum(                   
             case when cntr_list.cntr_size_q = '20'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr20 ,                   
            sum(                   
             case when cntr_list.cntr_size_q = '40'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr40 ,                   
             sum(                   
             case when cntr_list.cntr_size_q = '45'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr45                    
    FROM (       
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,       
               scn.CNTR_SIZE_Q,        
               count(scn.CNTR_SIZE_Q) AS cntr_qty        
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2       
        WHERE       
        scm.cmr_n = scn.cmr_n             
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                 
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                 
        AND scm.shift_mode_c = :ShiftModeCode                           
        AND scm.end_terminal_c = :TerminalCode      
        AND scm.start_terminal_c = yb1.terminal_c                  
        AND scm.start_block_n = yb1.block_n                  
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                  
        AND scm.end_terminal_c = yb2.terminal_c                  
        AND scm.end_block_n = yb2.block_n                  
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n           
        AND scn.status_c not in (1, 11)             
        AND scn.shift_type_c = 'V'             
        AND scn.source_c = 'S'       
        GROUP BY yb1.BLOCK_M, scn.CNTR_SIZE_Q       
    ) cntr_list       
    GROUP BY cntr_list.SOURCE_BLOCK
    2. Detail View object (key attributes are SourceBlock and EndBlock and same varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK,                
            sum(                     
             case when cntr_list.cntr_size_q = '20'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr20 ,                     
            sum(                     
             case when cntr_list.cntr_size_q = '40'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr40 ,                     
             sum(                     
             case when cntr_list.cntr_size_q = '45'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr45                      
    FROM (         
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,     
               yb2.BLOCK_M as END_BLOCK,  
               scn.CNTR_SIZE_Q,          
               count(scn.CNTR_SIZE_Q) AS cntr_qty          
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2         
        WHERE         
        scm.cmr_n = scn.cmr_n               
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                   
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                   
        AND scm.shift_mode_c = :ShiftModeCode                             
        AND scm.end_terminal_c = :TerminalCode        
        AND scm.start_terminal_c = yb1.terminal_c                    
        AND scm.start_block_n = yb1.block_n                    
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                    
        AND scm.end_terminal_c = yb2.terminal_c                    
        AND scm.end_block_n = yb2.block_n                    
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n             
        AND scn.status_c not in (1, 11)               
        AND scn.shift_type_c = 'V'               
        AND scn.source_c = 'S'         
        GROUP BY yb1.BLOCK_M, yb2.BLOCK_M, scn.CNTR_SIZE_Q         
    ) cntr_list         
    GROUP BY cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK
    3. I create a view link to create master-detail relationship for these 2 view objects.
    masterview.SourceBlock (1)->detailview.SourceBlock (*).
    4. I create a tree table using these 2 view objects with master-detail relationship.
    When I set default value for variable bindings of these 2 view objects and the matching records exist, tree table can work well. I can expand the master row to display detail row in UI.
    But I need to pass in dymamic parameter value for variable bindings of these 2 view objects, tree table cannnot work again. when I expand the master row and no detail row are displayed in UI.
    I am sure that I pass in correct parameter value for master/detail view objects and matching records exist.
    Managed Bean:
            DCIteratorBinding dc = (DCIteratorBinding)evaluteEL("#{bindings.MasterView1Iterator}");
            ViewObject vo = dc.getViewObject();
            System.out.println("Before MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            System.out.println("Before MasterView1Iterator ShiftModeCode="+ vo.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo.executeQuery();
            System.out.println("MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            DCIteratorBinding dc1 = (DCIteratorBinding)evaluteEL("#{bindings.DetailView1Iterator}");
            ViewObject vo1 = dc1.getViewObject();
            System.out.println("Before DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
            System.out.println("Before DetailView1Iterator ShiftModeCode="+ vo1.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo1.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo1.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo1.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo1.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo1.executeQuery();
            System.out.println("after DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
    5.  What's wrong in my implementation?  I don't have no problem to implement such a tree table if using simple master-detail tables view object, but now I have to use such 2 view objects using complex SQL for my requirement and variable bindings are necessary for detail view object although I also think a bit strange by myself.

    Hi Frank,
    Thank you and it can work.
    public void setLowHighSalaryRangeForDetailEmployeesAccessorViewObject(Number lowSalary,
                                                                              Number highSalary) {
            Row r = getCurrentRow();
            if (r != null) {
                RowSet rs = (RowSet)r.getAttribute("EmpView");
                if (rs != null) {
                    ViewObject accessorVO = rs.getViewObject();
                    accessorVO.setNamedWhereClauseParam("LowSalary", lowSalary);
                    accessorVO.setNamedWhereClauseParam("HighSalary", highSalary);
                executeQuery();
    but I have a quesiton in this way. in code snippet, it is first getting current row of current master VO to determine if update variables value of detail VO. in my case, current row is possibly null after executeQuery() of master VO and  I have to change current row manually like below.
    any idea?
                DCIteratorBinding dc = (DCIteratorBinding)ADFUtil.evaluateEL("#{bindings.SSForecastSourceBlockView1Iterator}");
                ViewObject vo = dc.getViewObject();           
                vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
                vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
                vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
                vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
                vo.executeQuery();
                vo.setCurrentRowAtRangeIndex(0);
                ((SSForecastSourceBlockViewImpl)vo).synchornizeAccessorVOVariableValues();

  • HibernateAssembler problem loading object

    I'm using LCDS (LiveCycle Data Services) 2.5.1 and I am
    trying to load a Java object using hibernate and have it given to
    my flex client.
    I followed this tutorial:
    http://blog.comtaste.com/2007/07/livecycle_data_services_and_hi.html
    Only issue is that when I attempt to use the DataService
    object (in flex client) to do a "getItem" I get the following
    error:
    Missing identity properties: id
    My "data-management-config.xml" has this:
    <destination id="hibernatePerson">
    <adapter ref="java-dao" />
    <channels>
    <channel ref="my-rtmp" />
    </channels>
    <properties>
    <source>flex.data.assemblers.HibernateAssembler</source>
    <scope>application</scope>
    <metadata>
    <identity property="id" />
    </metadata>
    <server>
    <hibernate-entity>foo.bean.Person</hibernate-entity>
    <update-conflict-mode>PROPERTY</update-conflict-mode>
    <delete-conflict-mode>OBJECT</delete-conflict-mode>
    <fill-configuration>
    <use-query-cache>false</use-query-cache>
    <allow-hql-queries>true</allow-hql-queries>
    </fill-configuration>
    </server>
    </properties>
    </destination>
    Any ideas?

    I got it. After reading some of the documentation on
    DataService.getItem I learned that the "ItemReference" object that
    is given back extends "AsyncToken". This means you should either
    bind to the "result" property of the ItemReference or add a
    responder to it (i.e. itemRef.addResponder).
    Then once the data is retrieved your "result" or "fault"
    methods (from the mx.rpc.IResponder interface) will be
    invoked.

Maybe you are looking for

  • Spinning ball, failed drive

    Not sure if this is a system problem or simply an internal hard drive issue, so I'm posting on both this board and the “Using your Power Mac G4” board. The hardware: PowerPC G4 dual 1.42 GHz with four internal drives: 1) IBM drive is the main drive w

  • File Adapter: Flat-file to XML

    New to the Oracle ESB. I am using the file adapter to read in a fixed-length flat file, have mapped it to an xsd and now I just want to dump the resulting xml into a directory. I don't see an obvious way to do this without converting it back to a fla

  • Cannot type in invitees in ical event.

    Hello, I am facing a problem in adding invitees when creating an ical event I cannot type an address that is not stored in my address book. Is there any way to help please? Thank you

  • Import one song to iphone

    how can I import one song to my iphone?

  • LR CC 2015 will not open after installing

    I installed the new application via my CC application manager and can not get LR CC 2015  open at all.  Any insights? It is showing that it is installed and up to date