EOFException when deserializing object in if statement

Hi,
I'm a java newbie and I've got a program in which I've got an method to open a serialized file.
I am running into problems when determining the class of the object to be deserialized.
When the code is as such everything works fine:
    ObjectInputStream ois;
    protected void open() {
        int returnVal = fc.showOpenDialog(this);
     if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();
            try {
             ois = new ObjectInputStream(new FileInputStream(file));     
          frameSeqA72 = (SeqA72) ois.readObject();
          getContentPane().add(frameSeqA72);
          frameSeqA72.setVisible(true);
          ois.close();                                                                                                           
         catch (IOException ioe) {ioe.printStackTrace();}
         catch (ClassNotFoundException cnfe) {}     
    }For some reason I don't understand everything changes when I use an if statement in the code as follows:
    ObjectInputStream ois;
    protected void open() {
        int returnVal = fc.showOpenDialog(this);
     if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();
            try {
             ois = new ObjectInputStream(new FileInputStream(file));     
          if (ois.readObject() instanceof SeqA72) {
              frameSeqA72 = (SeqA72) ois.readObject();
              getContentPane().add(frameSeqA72);
              frameSeqA72.setVisible(true);
              ois.close();                                                    
         catch (IOException ioe) {ioe.printStackTrace();}
         catch (ClassNotFoundException cnfe) {}     
    }An EOFException is thrown when this method is called -
"EOFException at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1267)..."
My serialized objects are of different classes so I want to determine the class before casting...so Im using "if (ois.readObject() instanceof SeqA72)".
Why would the first version work and the second throw an exception?
Am I going about this in a bad way?
Casey

You're calling readObject twice, so it's trying to read two objects.
Read it once and save a reference in a variable. Use that variable, instead of calling readObject again.

Similar Messages

  • [java.nio] StreamCorruptedException when deserializing objects

    Hello everybody!
    I made a messaging (chat) program using java.io where all the client-server communication is done by serializing small objects. Now I would like to covert the server side to the NIO concept and I'm already struck. I successfully pass objects to the client and the client deserializes them, but only the first one! When it try to read the second it fails with a StreamCorruptedException.
    Here�s a sample (testing) code. In the server run() method I first serialize a string, then get its byte array from ByteArrayOutputStream and in the loop periodically send this byte array through the channel. On the client side I just read the deserialized object.
    Server run():
    public void run() {
            try {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                ObjectOutputStream oos = new ObjectOutputStream(baos);
                oos.writeObject("abcdefgh");
                byte[] objectArr = baos.toByteArray();
                baos.close();
                oos.close();
                ByteBuffer buff = ByteBuffer.allocate(objectArr.length);
                buff.put(objectArr);
                buff.flip();
                while(true) {
                    selector.select();
                    Set keys = selector.selectedKeys();
                    for (Object o : keys) {
                        SelectionKey key = (SelectionKey)o;
                        if (key.isAcceptable()) {
                            ServerSocketChannel server = (ServerSocketChannel) key.channel();
                            clientChannel = server.accept();
                            if (clientChannel == null)
                                continue;
                            clientChannel.configureBlocking(false);
                            SelectionKey clientKey = clientChannel.register(selector, SelectionKey.OP_WRITE);
                        } else if (key.isWritable()) {
                            SocketChannel client = (SocketChannel) key.channel();
                            if (buff.hasRemaining()) {
                                client.write(buff);
                            } else {
                                buff.clear();
                                buff.put(objectArr);
                                buff.flip();
                    try {
                        Thread.currentThread().sleep(2000);
                    } catch (InterruptedException e) {
                        return;
            } catch (IOException e) {
                e.printStackTrace();
        }Client run():
    public void run() {
            try {
                soc = new Socket("localhost", 4000);
                ObjectInputStream ois = new ObjectInputStream(soc.getInputStream());
                while(true) {
                    Object d = ois.readObject();
                    System.out.println("data = " + d.toString());
            } catch (Exception ex) {
                ex.printStackTrace();
        }At the second read I get a StreamCorruptedException.
    Apart from this I would like some hints in how to implement the application with NIO. For example how can I tell the objects apart on the client side � should I send every time a byte array before the object, which tells the length of the next coming object? This is probably not a 100% bulletproof solution and presents additional data transfer?
    Than you in advance!

    OK, I found a solution but I don't like it, because I don't understand it.
    The ObjectOutputStream adds a header (4 bytes) to the stream - if I send the array with those four bytes I get an StreamCorruptedException. If I send the array without the header I also get a StreamCorruptedException: "invalid stream header".
    If I reconstruct the object, by calling ObjectOutputStream.writeObject() and get it's byte array from ByteArrayOutputStream.toByteArray(), every time I have to fill the ByteBuffer, then it works.
    Here's the modified sending block, for the above example:
    } else if (key.isWritable()) {
                            SocketChannel client = (SocketChannel) key.channel();
                            if (buff.hasRemaining()) {
                                client.write(buff);
                            } else {
                                //* ---- added code ---------
                                baos.reset();
                                oos.writeObject("abcdefgh");
                                objectArr = baos.toByteArray();
                                buff.clear();
                                buff.put(objectArr);
                                buff.flip();
                        }   I really don't understand why I have to write the object in the object stream every time. I used ObjectOS and ByteArrayOS, to get the object byte array and then I thought I could forget about those streams and use this array to fill the ByteBuffer. What changes if I send the object through this process with every iteration (and how this harms speed - it's like sending everything twice)? If someone would explain this to me I would appreciate it much.

  • Problems deserializing objects with Microsoft VM

    I am getting a 30 second delay when deserializing objects: using Java 1.1.8 ObjectOutputStream.defaultReadObject() causes a 30 second delay. This only happens on Internet Explorer using the Microsoft Virtual Machine.Any ideas what's causing this delay?

    HERE'S THE CODE ..
    URLConnection con = servlet.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    ObjectOutputStream out = new ObjectOutputStream(SecurityToolkit.openOutputStream(con));
    int numObjects = objs.length;
    for (int x = 0; x < numObjects; x++) {
    out.writeObject(objs[x]);
    out.flush();
    out.close();
    InputStream inStream = SecurityToolkit.openInputStream(con);
    ObjectInputStream in = new ObjectInputStream(inStream);
    return in;
    So .. this is the ObjectInputStream returned and objects are read off this stream. But reading hangs for 30 seconds and then starts reading again.

  • DML operations on a Replicated Object when it is in QUIZED State.

    Hi,
    How do we do DML operations on a Replicated object(Multi-Master Replication) when the object is in QUIZED State.
    As such my intenttion is to bring the Replication in a QUIZED State and then do some DML then bring up the Replicator and allow it to sync the Database.

    Hi Anita,
    Thank you so much for patiently explaining me about issues on Replication.
    Now, let me explain my objective. We are about to implement Oracle 8.1.6 Multi Master Replication. As a Fall back mechanism management is so concerned that "if anything goes wrong in Replication, how do we prevent the "stopshow" from carrying out the normal transaction till the issues gets settled.
    To achieve this objective, we are doing some investigation on this issue. As i am quite new to Oracle Replication I thought there is no way that i could do this in a very short "window" period.
    I tried to stop the Replication using the suggested method it worked well. Meaning i am able to do the DML transaction. Now the problem is when we decide to bring up the system back to Replication. How do we go doing that. As i thought that the DBMS package that resumes the replication would do the "sync" on both sides of the Replication. But it is not happening.
    I referred to the Oracle documentation on Replication and was quite eager to use the package DBMS_RECTIFIER_DIFF.DIFFERENCES and DBMS_RECTIFIER_DIFF.RECTIFY procedures.
    But i am yet to test this. If this works out for a specific table. Then my plan is to deploy a mechanism where in b4 i start the replication i would execute these packages for all the replicated tables.
    Hope you now understand what i intend to do and Pls advise me if i am on the right track on reaching my goal.
    Thanx in advance.
    Senthil.

  • PARSE_APPLICATION_DATA Error during XML = ABAP conversion: Response Message; CX_ST_DESERIALIZATION_ERROR in /1SAI/SAS0446CC11CC6EC1AD4789 Line 24 An error occurred when deserializing in the simple transformation program /1SAI/SAS0446CC11CC6EC1AD4789

    Hi Experts ,
    i have a scenario proxy to soap  where i am getting error while getting the response .
    we are sending the request successfully and getting response .some times we are getting in proxy level error below
    PARSE_APPLICATION_DATA Error during XML => ABAP conversion: Response Message; CX_ST_DESERIALIZATION_ERROR in /1SAI/SAS0446CC11CC6EC1AD4789 Line 24 An error occurred when deserializing in the simple transformation program /1SAI/SAS0446CC11CC6EC1AD4789 (Cha
    Please help us to fix this bug in proxy response.
    Regards
    Ravi

    Hello Ravinder,
    Can you please post the complete stack trace, it seems to be some fields are getting truncated i,e data sent from the program to the proxy object might be violating some length restrictions.
    Please check your message interface field lengths and what is being passed to the proxy.
    Regards,
    Ravi.

  • Error when using INSERT or DELETE statements

    I installed the database connectivity toolkit 1.01.
    I'm trying to run an application which uses the old SQL toolkit (version 5.0) VI's. It works but when I use other statements than SELECT, I always become the error -2146824584.
    Exception occured in ADODB.Recordset, Operation is not allowed when the object is closed.. Help Path is C:\WINNT\HELP\ADO210.CHM and context 0 in Get Number of Records.vi->Fetch Query Results.vi->Easy SQL.vi->SQL transaction.vi
    I'm working on a Windows NT4 machine with service pack 6, MDAC 2.6 SP1 and SQL Server 7.0.
    Does anyone have an idea ???
    ThanX

    Hi all,  I am facing a similar problem.
    I am using Labview 7.1, LabSQL, MySQL.
    See the pic below.
    What I want the program to do is:-
    1) write 6 values, altogether with SN (serial number) and timestamp with auto-increment testID in the table
    2) query to get testID based on SN and timestamp.
    3) continue to write 5 tables with testID.
    When I run the test, I manage to write only one first table and the other 5 tables did not show changes.
    What could it have gone wrong?
    Pls see the attached.
    pls help thanks.
    Attachments:
    problem.zip ‏729 KB

  • StreamCorruptedException when deserializing from a DatagramPacket

    Using jrockit 1.4.2_05 or jrockit 1.5.0_03 on Windows XP,I get some troubles when deserializing an object from a DatagramPacket received from a multicast socket. It seems that jrockit incorrectly read the object. Some fields are altered, and if the object is too long I get a StreamCorruptedException. When I run the receiver program with the Sun JDK, it works correctly.
    I have a sender program and a receiver program that exchange objects on a multicast address. The sender serializes the object into a ByteArrayOutputStream. Then I retrieve the byte[] array and put it in a DatagramPacket that is sent into the multicast socket.
    The receiver listens to the multicast socket, receive data into a datagram, retrieves the buffer (byte[]), wraps a ByteArrayInputStream from which it read the object.
    Here are some traces I get:
    At the sender:
    1140261074833 SENDER - SENT name=(Annapurna);heigth=8091;history=Lachenal et herzog - 1950.
    At the receiver:
    1140261075082 RECEIVER - RECEIVED (7) name=(Annande ;heigth=8091;history=Lachenal et herzog - 1950.
    With a longer (but still short !) message, I get:
    At the sender:
    1140261075333 SENDER - SENT name=(Everest );heigth=8848;history=Hillary : tensing 1953, tout le monde veut y aller, un vrai depotoir.
    At the receiver:
    java.io.StreamCorruptedException
    at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
    at java.io.ObjectInputStream.defaultReadFields(Ljava.lang.Object;Ljava.io.ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Ljava.lang.Object;Ljava.io.ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
    at grp.XCast.recv()Ljava.lang.Object;(XCast.java:44)
    at grp.XCast.run()V(XCast.java:145)
    at java.lang.Thread.run()V(Unknown Source)
    at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)
    Any idea where it comes from ?

    Hi,
    A bit more on this topic.
    I think I've got it.
    My code looks like this:
    - Class fields:
         DatagramPacket rpack = null;
         MulticastSocket xsock = new MulticastSocket(6789);
    - Constructor:
              byte[] rbuf = new byte[1024];
              rpack = new DatagramPacket(rbuf, rbuf.length);
    - Receive method:
    while (some condition) {
    xsock.receive(this.rpack);
    With Sun JDK, this sequence works well. With jrockit I ave to change it like following to make it works:
    while (some condition) {
    rpack.setLength(1024);
    xsock.receive(this.rpack);
    Looking at the J2SDK API, I read that:
    "The length of the packet is the number of bytes from the packet's data buffer that will be sent, or the number of bytes of the packet's data buffer that will be used for receiving data."
    With jrockit, it seems that the socket receive method modify the length returned by the DatagramPacket getLength method, so that if a first receive read a small message, the next call to receive will truncate the data if the latter message is longer than the former.
    Sun JDK seems to behave differently. The length seems to be based on the length of the buffer that was passed to the DatagramPacket constructor.
    Have you got a clue of who's right ?
    Or do I miss something else ?
    Anyway, it's borrowing to have such different behaviour from a JVM to the next.

  • Installed hotfix for error 3241 when you run RESTORE FILELISTONLY statement in SQL Server 2008 R2. But still get same errormessage.

    I ran into erro 3241 when you run RESTORE FILELISTONLY statement in SQL Server 2008 R2.
    Found the hotfix 
    Cumulative Update 13 for SQL Server 2008 R2 SP1.
    I have installed this hotfix, now running 10.50.2876.0
    But I still get the same error when trying to restore a backup.
    What else do I need to do?

    second to what bodo said Instead of installing SQL server 2012 SP1 CU13 it would be better to install
    SQL Server 2008 r2 Sp2 SP's are more throughly tested and would include all fixes for CU and Sp1
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Articles

  • How to know when an object is deleted?

    Hi,
    In Java, instances of classes are eliminate by garbage collector and programmers have no chance to do it.
    I need to do something, when the instance of a class ends its cycle-life .
    How do I know when an object is going to be deleted, in order to make some thing bounded to this event?
    thank you
    Regards
    Angelo

    Thank you for your help ...
    Here some code (I hope that I didn't forget something important):
    1. A class inside the JaveaBeans to manage events:
         * NavBean_EventsBroadcaster is a singleton class used in the JavaBean to manage (fire)
         * the events; and also to manage (add/remove) the listeners.
         * Events are raised when users push buttons with the purpose to change the display of
         * records (of the table) on the screen.
        public class NavBean_EventsBroadcaster implements Serializable {
            private transient Vector listeners;
            private static NavBean_EventsBroadcaster eventsBroadcaster_ForNavBeans = null;
             Method to get the instance of the singleton class
               static public NavBean_EventsBroadcaster getSingletonInstance() {
                    if (eventsBroadcaster_ForNavBeans == null) {
                        eventsBroadcaster_ForNavBeans = new NavBean_EventsBroadcaster();
                    return eventsBroadcaster_ForNavBeans;
                } // getSingletonInstance
            * fireTheEvent_X_navBean(): method that raise events
            public void fireTheEvent_X_navBean(
                    Object source,
                    NavigatorBean_eventsList_ENUM nbEvtENUM,
                    ResultSet rst,
                    int keyReg) {
                if (listeners != null && !listeners.isEmpty()) {
                    // object is going to be created (it contains the infos about the event)
                    NavBeanDB_EventDescriptor event_descr =
                            new NavBeanDB_EventDescriptor(
                            source, // dBbeanNavigator
                            nbEvtENUM,
                            rst,
                            keyReg);
                    // copy of the lisener to use it for add or remove
                    Vector targets;
                    synchronized (this) {
                        targets = (Vector) listeners.clone();
                    // proper event (select first, next, prev, last reg) is raised
                    Enumeration enumerat = targets.elements();
                    while (enumerat.hasMoreElements()) {
                        NavBeanDBListener_INTERFACE l =
                               (NavBeanDBListener_INTERFACE) enumerat.nextElement();
                        l.firedNavigationBeanEvents(event_descr);
                        System.out.println("Method fireTheEvent ----- key = " + priKeyOnTheScreen);
                }  // if
        } // fireTheEvent()
             * Adds a listener to the listener list.
             * @param l The listener to add.
            synchronized public void addNavBeanAddListener(NavBeanDBListener_INTERFACE l) {
                if (listeners == null) {
                    listeners = new Vector();
                listeners.addElement(l);
                System.out.println("E' stato registrato un nuovo ascoltatatore per navigationBar");
            } // addNavBeanAddListener()
         * Removes a listener from the listener list.
         * @param l The listener to remove.
        synchronized public void removeNavBeanRemoveListener(NavBeanDBListener_INTERFACE l) {
            if (listeners.contains(l)) {
                listeners.remove(l);
        }  // removeNavBeanRemoveListener()
        } // class NavBean_EventsBroadcaster2. The used interface
          * This is the interface that specifies the contract between a NavBeans
          * source and listener classes.
          * @author Owner
         public interface NavBeanDBListener_INTERFACE extends EventListener {
             public void firedNavigationBeanEvents(NavBeanDB_EventDescriptor evt);
         } // interface NavDB_BeansListener_INTERFACE3. the class adapter
        public abstract class DbNavigatorBean_Adapter implements NavBeanDBListener_INTERFACE {
             NavigatorBean_eventsList_ENUM navigatorBean_eventsList_ENUM;
             public DbNavigatorBean_Adapter() { // costruttore
             } // costruttore
              * This class have to be implemented from listeners to get events.
              * @param evt
             // NavigatorBean_eventsList_ENUM {user_chang, sequential_first, sequential_prev, sequential_next, sequential_last}
             public void firedNavigationBeanEvents(NavBeanDB_EventDescriptor evt) {
                 navigatorBean_eventsList_ENUM = evt.getEventType();
                 switch (navigatorBean_eventsList_ENUM) {
                     case user_chang:
                         toDoWhen_user_changeRegistration(evt);
                         break;
                     case sequential_first:
                         toDoWhen_setted_firstRegistration(evt);
                         break;
                     case sequential_prev:
                         toDoWhen_setted_prevRegistration(evt);
                         break;
                     case sequential_next:
                         toDoWhen_setted_nextRegistration(evt);
                         break;
                     case sequential_last:
                         toDoWhen_setted_lastRegistration(evt);
                         break;
                 } // witch case
             } // firedNavigationBeanEvents()
             abstract public void toDoWhen_user_changeRegistration(NavBeanDB_EventDescriptor evt); // { }
             abstract public void toDoWhen_setted_firstRegistration(NavBeanDB_EventDescriptor evt); // { }
             abstract public void toDoWhen_setted_nextRegistration(NavBeanDB_EventDescriptor evt); // { }
             abstract public void toDoWhen_setted_prevRegistration(NavBeanDB_EventDescriptor evt); // { }
             abstract public void toDoWhen_setted_lastRegistration(NavBeanDB_EventDescriptor evt); // { }
         } // class class DbNavigatorBean_Adapter_base4. the class used to describe the event
       Class used to dercribe the event that happened.
       public class NavBeanDB_EventDescriptor extends EventObject {
           private NavigatorBean_eventsList_ENUM navigationBean_events_ENUM;
           private int primaryKeyOfRegOnTheScreen;
           private ResultSet resultSet;
           private int totOfRegsRegistredOnTheTable;
            * Costructor: is used to describe the events
            * @param source
            * @param nbEvtENUM
            * @param rst
            * @param keyReg
           public NavBeanDB_EventDescriptor( // costruttore
                   Object source,
                   NavigatorBean_eventsList_ENUM nbEvtENUM,
                   ResultSet rst,
                   int keyReg) {
               super(source);
               this.navigationBean_events_ENUM = nbEvtENUM;
               this.resultSet = rst;
               this.primaryKeyOfRegOnTheScreen = keyReg;
               extractTotRegsInTheTable(rst);
       //        this.totOfRegsRegistredOnTheTable = rgsRegNmbr;
               System.out.println("Viene creata una istanza di event descriptor");
           }// costruttore
            * which possibe action caused the event,
            * was pushed the button (first, prev, next, last, user select...)
            * @return
           public NavigatorBean_eventsList_ENUM getEventType() {
               return navigationBean_events_ENUM;
           } // getEventType
            * primmary key of registration on the screen
            * @return
           public int getPrimaryKeyOfTheRegOnTheScreen() {
               return primaryKeyOfRegOnTheScreen;
           } // getKeyRegOnTheScreen
           * resultSet showed on the screen
           public ResultSet getTheFullRegistrationOnTheScreen() {
               return resultSet;
           } // getTheFullRegistrationOnTheScreen
           Number of registrations actually on the table.
           public int getTotRegsRegistredOnTheTable() {
               return this.totOfRegsRegistredOnTheTable;
           } // getRegsRegistredNmbr
            private classe that get data
           private void extractTotRegsInTheTable(ResultSet rst) {
               ResultSet localRst =rst;
               try {
                   int curRow = localRst.getRow();
                   localRst.last();
                   this.totOfRegsRegistredOnTheTable = localRst.getRow();
                   localRst.absolute(curRow);
               } catch (SQLException ex) {
                   Logger.getLogger(NavBeanDB_EventDescriptor.class.getName()).log(Level.SEVERE, null, ex);
       } // class NavBeansEvent5. a possible use of the JavaBeans
       public class TableClients extends JFrame
           implements LinkTablesToDlgThatRandomizeSelections_INTERFACE {
       private NavigationBean navigationBean;
       public TableClients() {   // constructor
            navigationBean = new NavigationBean();
            navigationBean.initializeDBbeanNavigator(...);
            this.add(navigationBean);
            navigationBean.addActionNavigatorListener(new DbNavigatorBean_Adapter() {
                        @Override
                        public void toDoWhen_user_changeRegistration(NavBeanDB_EventDescriptor nbdbed) {
                            // do something
                        @Override
                        public void toDoWhen_setted_firstRegistration(NavBeanDB_EventDescriptor nbdbed) {
                                // do something
                        @Override
                        public void toDoWhen_setted_nextRegistration(NavBeanDB_EventDescriptor nbdbed) {
                                // do something
                        @Override
                        public void toDoWhen_setted_prevRegistration(NavBeanDB_EventDescriptor nbdbed) {
                                // do something
                        @Override
                        public void toDoWhen_setted_lastRegistration(NavBeanDB_EventDescriptor nbdbed) {
                                // do something
    } // constructor
    } // class TableClientsthis code works well...
    But if I implement the javaBeans on more than one Dialogs (windows) and the user uses
    this dialogs sequentially, then the JavaBean responds to the events always as the caller is the
    first dialog that run...
    If I delete all listener (on the dialog) when the dialog is close then I have not problems
    still thank you
    Regards
    Angelo

  • Error when Querying Object

    Hope someone can help with this problem...
    I am querying an object based on the query results of an
    another object. If the Contact email does not exist, CF8 throws an
    error. What I need to do for this query is to substitute a default
    value for a contact record that does not have an email (or some
    other fix) so that the error does not occur.
    Once again, if the email contact email DOES exist, there is
    no problem.
    Below is the code for my query:
    <cfloop query="oppty">
    <cfset getContacts = myObject.QueryObject(
    "SELECT Id, accountID, Name, Email
    FROM Contact
    WHERE accountID ='#oppty.accountID#'").results>
    <cfoutput>#getContacts.email#<br></cfoutput>
    </cfloop>
    Any help would be greatly appreciated...!!
    Thanks!

    Sorry for not being clear. The error is as follows:
    Error Occurred While Processing Request
    You have attempted to dereference a scalar variable of type
    class java.lang.String as a structure with members.
    51 : ").results>
    52 : <cfoutput> #getContacts.ID#
    #getContacts.accountid# #getContacts.name#
    #getContacts.email#<Br></cfoutput> <!--- --->
    53 : </cfloop>
    54 :
    This error happens when the object is queried an no results
    come back. What is happening is in the query
    SELECT Id, accountID, Name, Email
    FROM Contact
    WHERE accountID ='#oppty.accountID#'"
    When no data comes back for "Email", I get that java error. I
    need to rewrite the query so that there is a default replacement
    email if an email does not come back in the query.
    Thanks!

  • When is object type decided?

    I'd like to know when "OLTP Object Type(*)" is decided.
    Though I created the planned order in APO, "OLTP Object Type" wasn't determined.
    I checked existed planned order in my system and I found some planned orders have already been assigned "5" for "OLTP Object Type" but the others haven't been assinged yet.
    When is object type decided? And how can we control this?
    *OLTP Object Type = R/3 Object Type = Order_Type (import parameter of "BAPI_MOSRVAPS_SAVEMULTI3"(Order Category in OLTP System))
    The selectable values are the following.
    0     Stock
    1     Purchase Requisition
    2     Purchase Order
    3     Sales Order
    4     Planning
    5     Planned Order
    6     Production Order
    7     Reservation
    8     APO Local Order
    9     Advanced Shipping Notification
    A     Order Confirmation
    B     Delivery
    I     Inspection Lot
    M     Maintenance Order
    P     Project Order
    R     Proposed Order
    T     Shipment
    V     VMI Stock Transfer Order
         Not yet determined
    You can check the "OLTP Object Type" from transaction code "/n/sapapo/om16" (Ordmap Anchor Table tab).

    Hello Shohei,
    "OLTP Object Type(*)"  is of more importance to the external system; surely, it would be assigned after the number is changed by the CIF .
    The document is created an send it to R/3 or ECC (if you have publication types, Integration models, etc...); when the external system confirm the document and return it to SCM via CIF, the  "OLTP Object Type(*)" should be assigned.
    Probably you only have this number for documents working on planning version 000, and not for other planning versions.
    At the end: "OLTP Object Type(*)" is decided by the external system, when documents go trough CIF.
    Please check the following documentation:
    "Order Category in OLTP System
    The (OLTP or R/3) order category is used in addition to the order number to identify an order that has been transferred from an external (or R/3) system to the APO system.
    Some examples of order categories are sales orders (fixed value 3), purchase orders (fixed value 2), and production orders (fixed value 6).
    You can use various (OLTP or R/3) order categories for certain APO business objects, such as production orders or in-house production.
    For example, a procurement order (BUS10502) in the APO system can contain both procurement orders (category 2) and purchase requisitions (category 1). In APO, the order category is only used to identify an order in combination with the order number. The category is also used in part to determine if an order/schedule line in the APO system can be changed by a user or not (a purchase order, for example, may no longer be changed, while a purchase requisition may still be changed). Generally, the order category is of more importance to the external system. For example, the R/3 system needs to know whether it is a purchase order or a purchase requisition that is being dealt with.
    If an SAP (e.g. R/3) system is not linked to the APO system, and this system is to be used to exchange the order information that requires a certain order category, we recommend that you use the standard values, for example category 2 for business object BUS10502.
    Orders that are created within an APO system, for example in a planning run, are not given an (OLTP) order category when created, since they were not transferred to the APO system from an external system. These orders all automatically receive (for example, when they are imported) the order category 8 (APO local order). These orders have an APO internal order category which distinguishes between criteria such as in-house production or external procurement. In a subsequent (optional) step, an external system can then decide whether an order created in APO is a purchase order (category 2) or a purchase requisition (category 1) and assign it an (OLTP) order category and an (external) order number.
    You find these values in the documentation of the respective function or of the domain fixed values.
    Note that certain functions (for example, configurations) are only possible for certain order categories."
    Regards,
    Gustavo Pérez

  • Please  tell me the difference between CREATE OBJECT & CREATE DATA ,statements in CRMTECHNICAL

    Please  tell me the difference between CREATE OBJECT & CREATE DATA ,statements in CRMTECHNICAL

    found it on my own . the best way to do this is use the RetriveLimitedHierTreeCommand  with a search on the taxonomy table.

  • Green guidelines (when lining objects up / aligning) missing

    Hi, as title suggests I no longer get the green guidelines which show when the object I am moving is aligned with the bottom/top/middle etc of another object in my document.  Tried a couple of things in 'View' but hasn't seemed to solve the problem - probably being stupid but I haven't got the time to spend ages doing it today!  So, yet again, I am here for your help...
    Thanks as always,
    Mark

    Hi all,
    Thanks for swift response.  Smart Guides are turned 'on', at least according to the little tick next to where it says 'Smart Guides'.
    As an example of what I'm doing, I create a rectangular box and place it anywhere on my page.  I then create another rectangular box (or whatever shape).  When using Illustrator before, I could move the box and some green lines would indicate when my new box was lined up to an edge or the middle of the first box.  It's useful for making sure everything is lined up neatly and accurately, but have no idea where the function has gone.
    Is this description any clearer?
    Thanks again,
    Mark

  • I want to know when we issue truncate table statement in oracle .

    i want to know when we issue truncate table statement in oracle .No log will be write in redo log .But we can recover data using flashback or scn.I want to know where is the actually truncate table statement log is stored in oracle database.Please explain me in detail step by step .

    Hi,
    I have truncated table after that i have restored that data.See below the example.I want to know from where it's restored.
    From which log file it's restored.
    create table mytab (n number, x varchar2(90), d date);
    alter table mytab enable row movement;
    Table altered.
    SQL> insert into mytab values (1,'Monsters of Folk',sysdate);
    1 row created.
    SQL> insert into mytab values (2,'The Frames',sysdate-1/24);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select CURRENT_SCN from v$database;
    CURRENT_SCN
    972383
    SQL> select * from mytab;
    N
    X
    D
    1
    Monsters of Folk
    30-DEC-12
    2
    The Frames
    30-DEC-12
    N
    X
    D
    SQL> set lines 10000
    SQL> /
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    SQL> select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;
    TO_CHAR(SYSDATE,'
    20121230 09:29:24
    SQL> set timing on
    SQL> truncate table mytab;
    Table truncated.
    Elapsed: 00:00:15.75
    SQL> select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    Elapsed: 00:00:00.28
    SQL> insert into mytab select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    2 rows created.
    Elapsed: 00:00:00.01
    SQL>

  • Error when transforming object data HELP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Hi
    I am running on NW04s. Working on WD for ABAP Interactive forms. whenever I open the Adobe editor thru SFP or Se80,  the editor opens up and I am able to do my operations. The moement I hit back button/Save or any other action which involves coming out of the adobe editor, it throws me an Fatal error - <b>Error when transforming object data</b>. I find that in most of the threads there are similar issues which are still open. Any Help would be appreciated.
    I have installed ADLC 7.1, xACF04s.
    Murali.

    I did the same installation on another PC, and to my suprise it works fine. Looks very strange

Maybe you are looking for