Are enums in 1.5 Serializable?

Hi, just wondering if I defined an enum with a couple of methods, is this enum automatically Serializable, i.e. does it already implement Seriablizable? e.g. is the enum below automatically serializable or must i have to explicitly implement it:
public enum Ariithmetic {
ADD, SUBTRACT, MULTIPLY, DIVIDE;
public static Arithmetic getType( String type )
thanks in advance!
-los

public abstract class Enum<E extends Enum<E>>
extends Object
implements Comparable<E>, Serializable

Similar Messages

  • Are enums and inner classes allowed in taglib function signatures??

    Hi,
    I have a taglib with the following function definition:
    <function>
            <description>Determine if viewing a patient attribute is allowed</description>
            <name>isViewingPatientAttributeAllowed</name>
            <function-class>com.example.admin.authorization.UserAuthorizer</function-class>
            <function-signature>boolean isViewingPatientAttributeAllowed(com.example.bean.User, com.example.bean.Patient.PatientAttribute, com.example.bean.Patient)</function-signature>
            <example>
                ${ncvi:isViewingPatientAttributeAllowed(user, patientAttribute, patient)}
            </example>
    </function>Where com.example.bean.Patient.PatientAttribute is an enum (note package names have been changed to protect the innocent;-). When I try to compile my web app I get the following error:
    org.apache.jasper.JasperException: The class com.example.bean.Patient.PatientAttribute specified in the method signature in TLD for the function ncvi:isViewingPatientAttributeAllowed cannot be found. com.example.bean.Patient.PatientAttributeIf I change PatientAttribute to a static inner class of Patient, I still get the error. Are enums and inner classes allowed in function signatures?
    Thx.

    I think that you'll find it easier to define a non-inner abstract class RefBase, that exposes a removeFromQueue() method, then extend that for your Ref class. That way, the queue just deals with RefBase instances (or ? extends RefBase).
    I think that any other approach is going to get the compiler confused, because the compile-time Ref depends on the parameterization of its defining class.

  • Why are enums with constant-specifics  methods no enums?

    I'm working on an application which uses reflection to determine how a certain object should be represented in the GUI.
    If an object is an enum it will be represented as a drop-down box.
    Yesterday however our code broke on a newly added enum which uses constant-specifics methods.
    To illustrate it I'm taking a code example from :
    http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html
    public enum Operation {
    PLUS { double eval(double x, double y) { return x + y; } },
    MINUS { double eval(double x, double y) { return x - y; } },
    TIMES { double eval(double x, double y) { return x * y; } },
    DIVIDE { double eval(double x, double y) { return x / y; } };
    // Do arithmetic op represented by this constant
    abstract double eval(double x, double y);
    Now if you do Operation.PLUS.getClass().isEnum() to my surprise it returns false using 1.5.0_06.
    Is this a bug?

    Oh, looking at the source code would have been an option, yes ... sigh
    I see that there's a lot to learn when it comes to enums (at least for me). So based on what I believe to know about the matter, I'd say the issue was not overlooked. From a quick experiment, I saw that enum constants without constant-specific methods use an instance of their respective enum subclass as "representation", which in this case is not abstract (contrary to Operation, which is).
    So while from a logical point of view, enum constants with and without constant-specific methods should be considered equal(?), implementation-wise, they are not. I think the distinction between enums and enum constants is more of a Java language thing -- the JVM/bytecode is not really aware of it (much like inner classes) -- and is introduced by javac, using little "hacks" to implement the special abilities (which I'll definitely have to investigate when time permits).
    After all, isEnum() is invoked on the actual Class object representing the type of an instance. With reflection, you deal with the raw type, no support by javac magic. And indeed, Operation and Operation.PLUS are different types. Operation.PLUS exhibits different behaviour than Operation, and is missing some fields and methods (which could cause certain implications, I guess). Maybe one has to look at isEnum() more from an implementation perspective: isEnum() indicates that the respective class directly supports certain operations (i.e., is declared enum type in the Java source code), while Classes where isEnum() returns false do not. Yeah, the method name is a bit ambiguous, and intuition fools you here, as all the Classes, enums as well as enum constants, are subclasses of java.lang.Enum.
    PS: Enum.getDeclaringClass() deals with this issue, too.
    EDIT:
    Code wise it is not an elegant solution:
    - change my framework to check the modifiers iso.
    using isEnum
    or
    - implement the method using a switch statementClass theClass = anObject.getClass();
    if (anObject instanceof Enum) {
    if ( !theClass().isEnum())
    theClass = ((Enum) anObject).getDeclaringClass();
    (just a suggestion...)
    Message was edited by:
    oebert

  • Problem in Activation of the SFC after SFC serialization

    Hi Experts,
    I am trying to do SFC serialization. I am able to do it.However after serialization , the old SFC  became INVALID but new SFC is not
    becoming active at next operation. I am trying as follows in Activity Hook at PRE_START hook point.
    SplitSerializeServiceInterface   serializeService = (SplitSerializeServiceInterface )ServiceLocator.getService("com.sap.me.production",
    "SplitSerializeService");
    SerializeSfcRequest request = new SerializeSfcRequest();
    request.setSfcRef("OLD_SFC") ;
    List<SerializeSfcDetail> newSfcList = new ArrayList <SerializeSfcDetail> ();
    SerializeSfcDetail serializeSfc =new SerializeSfcDetail();
    serializeSfc.setSfc("NEW_SFC");
    newSfcList.add(serializeSfc);
    request.setNewSfcList(newSfcList);
    serializeService.serializeSfc(request );
    // If I try as follows.
    We are trying to do SFC serialization as follows in an activity at PRE_START hook point. We are able to see new SFC in SFC table of WIP DB. Also SEQUENCE is 2, REASON is S in SFC_ID_HISTORY table. However, the old SFC is not becoming invalid and we could not find the new SFC anywhere in the POD. Could you please help us where we are missing and how we can make sure that SFC is serialized. Code snippet given below.
       SerializeSfcRequest request = new SerializeSfcRequest();
                request.setSfcRef(sfcBO.toString());
                request.setOperationRef(operationBO.toString());
                request.setResourceRef(resourceBO.toString());
                request.setQuantityToSerialize(BigDecimal.valueOf(1.0));
                List<SerializeSfcDetail> newSfcList = new ArrayList <SerializeSfcDetail> ();
                SerializeSfcDetail serializeSfc = new SerializeSfcDetail();
                serializeSfc.setSfc(strNewSFC);
                serializeSfc.setLocation("");       // Is Location compulsory? If yes then what needs to be put here? Resource or Operation or something else?
                newSfcList.add(serializeSfc);
                request.setNewSfcList(newSfcList);
                splitSerializeService.serializeSfc(request);
    Thanks in advance,
    Eswaraiah M
    Edited by: Eswaraiah M on Feb 24, 2012 2:06 PM

    Can you just lemme know what field is that?
    i hope its ot an automatic generated field which are created automatically for the amount or quantity fields.
    morever if this is not the case then please try to refresh the tree.. u might see the diffrence.
    Thanks,
    Purva

  • Concurrent Serializable Transaction Conflict

    Hi,
    We are planning to use the Serializable isolation level in the transactions. I am wondering if somebody can give me some suggestions on how to handle the following scenarios.
    My assumptions are as follows ( when I use the transactions with Serializable isolation level):
    If transaction A updates a particular record r of table T, and concurrently, transaction B updates or deletes the same record r of table T, then anexception is thrown at the point at which either transaction (A or B whichever is last) is committed. But if the two transactions update or delete different records of the same table, there will be no problems.
    Are these assumptions are correct. If the oracle jdbc driver throws an exception, what would be the exception ( what would be the class and the error code - how i can differntiate from other SQLExceptions)
    TIA,
    Krishna Balusu

    If two serializable transactions attempt to update the same row, the second transaction to attempt to update the data will wait for the first transaction to commit. Then, it will return the error "ORA-08177: can't serialize access for this transaction". This error won't be deferred until the second transaction attempts to commit.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • What is the disadvantages of using Serialization?

    HAi all,
    I want to store objects in a file. I am preferred to use serialization. But I want to know what are the disadvantages of using Serialization over other methods (direct file, Keyed File)?
    Can we store as many records using serialization? Is there any limit? Is there any security related issues?
    Pls help me.
    regards,
    namanc

    I don't think there is disadvantage using serialization compare to direct i/o access to file or any storage, except that you need to design your code such as it is serializable (hence, you may want to use transient keyword, or use externalizable, to be able to store/load the object properly).
    Use serialization if possible, it saves you from inventing new+uncompatible mechanism of doing something in java.

  • Serializable transactions and initrans parameter for version enabled tables

    Hi,
    we want to use serializable transactions when using version enabled tables, so we need to set initrans parameter >= 3 for such tables.
    Change made during BEGINDDL - COMMITDDL process is not done for LT table. I think that initrans parameter is not checked at all during BEGINDDL-COMMITDDL process, because skeleton table has initrans=1 even if LT table has different value of this parameter.
    -- table GRST_K3_LT has initrans = 1
    exec dbms_wm.beginddl('GRST_K3');
    alter table grst_k3_lts initrans 3;
    exec dbms_wm.commitddl('GRST_K3');
    -- table GRST_K3_LT has initrans = 1
    During enableversioning this parameter is not changed, so this script succesfully set initrans for versioned tables.
    -- table GRST_K3 has initrans = 1
    alter table grst_k3 initrans 3;
    exec dbms_wm.enableversioning('GRST_K3','VIEW_WO_OVERWRITE');
    -- table GRST_K3_LT has initrans = 3
    We use OWM 10.1.0.3 version.
    We cannot version disable tables. I understand that change can be done after manually disabling trigger NO_WM_ALTER.
    Are there any problems with using serializable transactions when reading data in version enabled tables? We will not use serializable transactions for changing data in version enabled tables.
    thanks for Your help
    Jan VeleÅ¡Ãk

    Hi,
    You are correct. We do not currently support the initrans parameter during beginDDL/commitDDL. However, as you indicated, we will maintain any value that is set before enableversioning. If this is a critical issue for you, then please file a TAR and we can look into adding support for it in a future release.
    Also, there are no known issues involving serializable transactions on versioned tables.
    Thanks,
    Ben

  • Custom serialization - could you do this?

    Hi
    I'll describe a partially hypothetical situation to allow me to ask the questions I want with some context.
    Let's say someone gave you the responsibility of implementing the following API with the specified contract:
    * Convert <code>object</code> to a serialized format and save in the file
    * <code>saveDestination</code>. You are free to choose the serialization format.
    public void serializeAndSave(java.io.Serializable object, java.io.File saveDestination);
    * Deserialize objects serialized by the <code>serializeAndSave()</code> method.
    public java.io.Serializable deserialize(java.io.File file);
    Additionally, let's say the following were conditions and restrictions were specified by the person asking you to implement these methods:
    * The version of the class for <code>object</code> or any of the super-classses in its class hierarchy or the type of any fields will never change.
    * The fields of <code>object</code> will probably be private. Fields consistent with the java.io.Serializable contract, must be serialied (for instance, transient fields do not need to be serialized).
    * You will never have any information about how any declared methods in <code>object</code> relate to declared fields, so you cannot rely on declared methods for getting field values when serializing or setting field values when deserializing.
    * You will never have information about how parameters in declared constructors relate to declared fields, so you cannot rely on declared constructors for setting field values when deserializing.
    * Besides the java.io.Serializable interface and the contract specified by Java when implementing the Serializable interface (eg. empty constructor), <code>object</code> will not necessarily conform to any interface or API that you will have prior knowledge of.
    * <code>object</code> may have an inheritance hierarchy to any depth. Super-classes in the class hierarchy may have fields too.
    * Super-classes in the object hierarchy, and their fields, are subject to the same conditions and constraints described here for <code>object</code>
    OK, there's a description of the hypothetical task someone has asked you to complete.
    Luckily, this is very easy to do. You can simply rely on Java's inbuilt serialization mechanisms. You can use java.io.ObjectOutputStream and java.io.ObjectInputStream - it's all very easy. Java's inbuilt serizlization/deserialization has no problem with private fields and no problems with super-classe fields even if private.
    Now let's say I changed your task by changing the contract for the serializeAndSave() method as follows:
    * Convert <code>object</code> to an XML serialization format and save in the file
    * <code>saveDestination</code>.
    public void serializeAndSave(java.io.Serializable object, java.io.File saveDestination);
    Notice that the class must now be serialized in XML format*.
    How would you implement the serializeAndSave() and deserialize() methods now? In particular:
    * In serialzeAndSave(), how would you obtain the values of private fields in any of the super-classes in the object hierarchy?
    * In deserialize(), assuming you succussfully implemented the serializeAndSave() method, how would you set the value of any of the private fields in <code>object</code> or any of the super-classes in <code>object</codes>'s class hierarchy?
    Cheers.

    >>>
    What you're proposing is a feeble solution, but if you insist on using it, it's genuinely laughably trivial to implement. What have you been doing for the last 15 years?
    <<<
    Yeah been getting that a lot. Funny thing is, no-one can back it up.
    Here's your opportunity for you to show that you are right and I a wrong. Provide the implementation for showValueOfA(), setValueOfA(), setValueForB(). I'll go out on a limb right now and tell you that you cannot do it, despite you trying to make out that you have a complete understanding of the technical issue at hand.
    package com;
    import java.lang.reflect.Field;
    public final class DisplayUnderstanding{
         public static void showFields(Data data){
              Class clazz = null;
              Field[] fields = null;
              Field field = null;
              clazz = data.getClass();
              fields = clazz.getDeclaredFields();
              for(int i = 0, n = fields.length; i < n; ++i){
                   field = fields;
                   System.out.println(field.getName() + ": " + field.getType());
         * Will write to <code>System.out</code> the value of the field <code>a</code>
         * in the instance <code>data</code>.
         public static void showValueOfA(Data data){
              /* IMPLEMENTATION REQUIRED */
         * Will change the value of the field <code>a</code> in the instance
         * <code>data</code> to <code>value</code>.
         public static void setValueOfA(Data data,int value){
              /* IMPLEMENTATION REQUIRED */
         * Will change the value of the field <code>b</code> in the instance
         * <code>data</code> to <code>value</code>.
         public static void setValueOfB(Data data,int value){
              /* IMPLEMENTATION REQUIRED */
         public static class Data extends AbstractData{
              private int b = 0;
              public Data(int a,int b){
                   super(a);
                   this.b = b;
         public static abstract class AbstractData{
              private int a = 0;
              public AbstractData(int a){
                   this.a = a;

  • A question about Serializable

    Hi,
    I have a simple question.
    What is the functions of Serializable interface and why we need using it in our program. Some examples are welcome.
    Thanks
    vq

    First there are no methods of the Serializable interface. Seems weird huh. By implementing the serializable interface, if allows the object to be "Serialized", go figure. Much like the Clonable interface, except that no methods need to be overridden. Basically, serializing an object stores the objects class, fields, methods, and data into a byte code text file so that it might be retrieved later. This is done with an ObjectOutputStream and ObjectInputStream
    How to use it effectively? People have written whole chapters on that. My advice is to go the Library and check out a Java 2 book.

  • Serialization of InitialDirContext

    Hello,
    I have two Session beans, session bean X creates a connection to a LDAP server and returns the connection encapsulated inside a ValueObject or TransferObject and session bean Y receives this transfer object as a parameter and uses the connection object to perform an LDAP query.
    So I created a test class that will call SessionBean X first and get the connection transfer object and pass this transfer object to SessionBean Y.
    Since the DirContext (and its implementing class InitialDirContext) are both not serializable, i had to implement the Externizable interface to handle the serialization...
    So in my bean X I create a connection as follows
    DirContext dctx = new SerializableInitialDirContext(env);
    DirectoryContextTransferObject ctx;
    ctx.setDirContext(dctx);SerializableInitialDirContext and DirectoryContextTransferObject are my classes, the code for this is as follows
    public class SerializableInitialDirContext
         extends InitialDirContext
         implements Externalizable {
          * Constructor for SerializableInitialDirContext.
          * @param lazy
          * @throws NamingException
         public SerializableInitialDirContext(boolean lazy) throws NamingException {
              super(lazy);
          * Constructor for SerializableInitialDirContext.
          * @throws NamingException
         public SerializableInitialDirContext() throws NamingException {
              super();
          * Constructor for SerializableInitialDirContext.
          * @param environment
          * @throws NamingException
         public SerializableInitialDirContext(Hashtable environment)
              throws NamingException {
              super(environment);
          * @see java.io.Externalizable#readExternal(ObjectInput)
         public void readExternal(ObjectInput in)
              throws IOException, ClassNotFoundException {
              try {
                   myProps = (Hashtable) in.readObject();
                            // I AM NOT ABLE TO DO THIS
                   //defaultInitCtx = (Context) in.readObject();
                   gotDefault = in.readBoolean();
              } catch (Exception e) {
                   e.printStackTrace();
          * @see java.io.Externalizable#writeExternal(ObjectOutput)
         public void writeExternal(ObjectOutput out) throws IOException {
              try {
                   out.writeObject(myProps);
                   out.writeObject(defaultInitCtx);
                   out.writeBoolean(gotDefault);
              } catch (Exception e) {
                   e.printStackTrace();
    public class DirContextTransferObject implements Externalizable {
         private DirContext dirContext = null;
         //private SerializableInitialDirContext dirContext = null;
          * Constructor for NamingEnumerationTransferObject.
         public DirContextTransferObject() {
              super();
          * Constructor for NamingEnumerationTransferObject.
         public DirContextTransferObject(DirContext dirContext) {
              super();
          * Returns the dirContext.
          * @return DirContext
         public DirContext getDirContext() {
              return dirContext;
          * Sets the dirContext.
          * @param dirContext The dirContext to set
         public void setDirContext(DirContext inDirContext) {
              dirContext = inDirContext;
          * @see java.io.Externalizable#readExternal(ObjectInput)
         public void readExternal(ObjectInput in)
              throws IOException, ClassNotFoundException {
              try {
                   dirContext = (DirContext) in.readObject();
              } catch (Exception e) {
                   e.printStackTrace();
          * @see java.io.Externalizable#writeExternal(ObjectOutput)
         public void writeExternal(ObjectOutput out) throws IOException {
              try {
                   out.writeObject(dirContext);
              } catch (Exception e) {
                   e.printStackTrace();
    }Although I wasnt able to do this
    // defaultInitCtx = (Context) in.readObject();
    in my SerializableInitialDirContext class, method readExternal(ObjectInput in)...in my test class I was still able to get the values correctly from the transferObject , I could check this by doing
    System.out.println("OK " + dirCtx.getDirContext().getEnvironment().toString());However when I call SessionBean Y, The stub classes throw an exception
    org.omg.CORBA.BAD_PARAM: com.sun.jndi.ldap.LdapCtx is not serializable
    minor code: 4F4D0006 completed: Maybe
    So my questions is
    1. Why am I not able to call SessionBean Y with the same transfer object when gets marshalled and unmarshalled from SessionBean X?
    2. Have I done something wrong perhaps in the SerializableInitialDirContext class, method readExternal(ObjectInput in)...
    3. When I can do a readObject() on all the variables of InitialDirContext in my SerializableInitialDirContext class, method readExternal(ObjectInput in), why am I not able to do this
    //defaultInitCtx = (Context) in.readObject();

    Ok, i'll give it a try.
    I am asuming your dircontext object only contains a number of configuration paramaters and not a socket or similar object, because that would be bad :)
    To answer your questions
    1
    To state the obvious first :D com.sun.jndi.ldap.LdapCtx is not Serializable. this class is either a superclass of your dircontext or it is refferenced somewhere in a superclass.
    Still asuming you are only passing parameters wouldnt it be possible to create a brandnew object to contain those parameters or one of the collection classes could be used.
    2
    Havent seen anything, although i am puzzled why you are using externalizable instead of Serializable. I don't think speed is the issue here.
    3
    my guess is that your defaultInitCtx is responsible for throwing the exception. Therefor it is not on the stream and you cannot read it back.
    I hope i have been of any help to you,
    Mr Mean

  • Servlet doing serialization

    Hi all,
    I'm designing a small app in order to perform compilation test on struts framework using flash tools. The project is organized this way: the user tells how many "compilation test" he wants to perform on the main page and then these informations are passed to a servlet which generates fake informations about the user and perform the compilation of a Flash animation. All these informations (first name, last name, mail, various informations and path to flash animation) are stored inside a separate class which also reads the content of the flash file and stores it into an attribute. This class implements the serializable interface. When things are done, I try to serialize the object.
    Problems are beginning at this point: I'm not able to serialize my object. In fact, I generate a random filename and pass it to a FileOutputStream, so it is supposed to create my file. Despite of this, I get an *annoying* Error 500 which tells me the following:
    java.io.FileNotFoundException: /var/lib/tomcat5/webapps/struts_test/WEB_INF/classes/objects/aGdsPhOboRJgf.ser (No such file or directory)
         java.io.FileOutputStream.open (Native Method)
         java.io.FileOutputStream.<init> (FileOutputStream.java:179)
         java.io.FileOutputStream.<init> (FileOutputStream.java:70)
         java.io.FileWriter.<init> (FileWriter.java:46)
         struts_test.IdentifyAction1.execute (IdentifyAction1.java:76)
         org.apache.struts.action.RequestProcessor.processActionPerform (RequestProcessor.java:421)
         org.apache.struts.action.RequestProcessor.process (RequestProcessor.java:226)
         org.apache.struts.action.ActionServlet.process (ActionServlet.java:1164)
         org.apache.struts.action.ActionServlet.doPost (ActionServlet.java:415)
         javax.servlet.http.HttpServlet.service (HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service (HttpServlet.java:802)
         sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke (Method.java:597)
         org.apache.catalina.security.SecurityUtil$1.run (SecurityUtil.java:243)
         java.security.AccessController.doPrivileged (Native Method)
         javax.security.auth.Subject.doAsPrivileged (Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute (SecurityUtil.java:272)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege (SecurityUtil.java:161)This stacktrace guides us to the idea that we don't have deployed the right security policy, but it isn't. My catalina.policy contains the following:
    grant codeBase "file:${catalina.home}/webapps/struts_test/-" {
         permission java.io.FilePermission "/var/lib/tomcat5/webapps/struts_test/WEB-INF/classes/struts_test/flash/-", "read,write";
         permission java.io.FilePermission "/var/lib/tomcat5/webapps/struts_test/WEB-INF/classes/objects/test.ser", "write,read";
    };So I've tried to tell it a nice permission java.security.AllPermission; and this results in the non-appearance of the error message, but the file is *NOT* created... It's going to drive me nuts... So if anyone has an idea, I'd be honoured to read it :)
    Thanks!
    System Configuration:
    OS: Ubuntu Linux 7.04
    Tomcat: version 5.0
    Java: JDK1.6.0_02
    SE with some Ant and Struts-related libraries and

    Are you sure the path is correct?
    ava.io.FileNotFoundException: /var/lib/tomcat5/webapps/struts_test/WEB_INF/classes/objects/aGdsPhOboRJgf.ser (No such file or directory)
    Should it not be "WEB-INF" instead of "WEB_INF"?

  • How do I serialize an array of custom objects?

    I need to serialize this array:
    public class MyData
       public Triplet[,] MyArray = new Triplet[12, 12];
       ...etc...
    where:
    public class Triplet
       public Int16 X;
       public Int16 Y;
       public Int16 Z;
       public bool Modified;
    I get this error:
    "Cannot serialize object of type Triplet[,]. Multidimensional arrays are not supported."
    The serialization code in MyData is as follows:
       XmlSerializer serializer = new XmlSerializer(this.GetType());
       using (StreamWriter writer = new StreamWriter(fileName))
          serializer.Serialize(writer, this);
    Do you know how I should serialize MyArray?
    Thank you.

    XMLSerializer does not support multi-dimentional array.
    use binary serialization
    https://social.msdn.microsoft.com/Forums/en-US/90c98754-2580-404a-81ae-aedba5f2604d/serialize-multidimensional-arrays?forum=csharplanguage
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Serializable vs Externalizable ?

    Hi,
    I try to build a RMI server that initiate a connection. The
    client uses this RMI server connection. When he needs to execute
    statements, the RMI server also instantiate a class for the
    client whose execute them. At this moment, the RMI server give
    me this error:
    profile DataManagement.DMLoginImpl_SJProfile0 not found:
    java.io.InvalidClassException: [Ljava.lang.Object;; Serializable
    is incompatible with Externalizable
    Where DataManagement.DMLoginImpl_SJProfile0 is the Profile.
    I use JDK 1.2 with SQLJ 8.1.5.
    Need help !
    Thanks
    Daniel
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Serializable is simpler to implement (The minimum is to just "implements Serializable) and simpler to extend (e.g. it manages inheritance)
    Externalizable gives you most control, but you have to do more yourself.
    If you are starting out, just use Serializable. It turns out to be inadequate then you can convert the classes which need Externalizable to be be those.
    Note: You don't have to just use one or the other.

  • What does enum constant do?

    Hi
    I have a program that I need to understand. There are enum constants at many places and I do not know what they do. When I find all instances it shows me many with other different named enum constants. Like enum "Read Queue" and "Initialize" are two enums and both are of the same instances. Can someone tell me what exactly an Enum is.
    Thanks

    Enum is an "enumerated" datatype.
    You have values of 0, 1, 2, ....   But those values are meaningless.  (Is "read queue" value #1?  Intialize value 0?)  So meaningful names are given to each of the values.  So if you want to initialize, you just have to pick that item in the enum rather than remembering an arcane number.
    A constant is a specific value.  Note: when working with enums, it is HIGHLY recommended that they be typedef's so that if you ever need to add an item to an enum, that all instances of the constans get that new item added to it automatically.
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • Enum size question

    The following code compiles with gcc but not the Sun compiler:
    #include <limits.h>
    enum a  { aA = ~(1<<10) } ;
    enum b  { bA  = ULONG_MAX } ;
    enum c  { cA = ~(1<<10), cB  = ULONG_MAX } ;
    CC -c -m32 test.cpp"test.cpp", line 4: Error: c is not within the range of a long or unsigned long.
    From a quick browse, it appears gcc enums are of type unsigned but Sun enums are signed. But if that is the case the above is rather confusing:
    - firstly the error message does not indicate which member of c is causing the problem
    - the error is ambiguous. What is the limit, is it long or unsigned long? If the latter I believe it should be ok. The fact the error says "or unsigned long" means that must be an option - if so, can I enable enums to be of type unsigned somehow?
    - Why does it give me an error for enum c but not a or b, which contain the same values?
    Our code is full of enums using ~x and using unsigned UINT_MAX values, so this looks like it could be a showstopper for us in our Sun compiler evaluation. Any information is appreciated.

    Sun C++ follows the C++ standard (refer to section 7.2).
    An enumeration type has an underlying type that is large enough to hold all the enumeration values. The type shall not be larger than int unless the value won't fit in an int or unsigned int. Other possible underlying types include long and unsigned long.
    In this case, the enumeration values are -1025 and ULONG_MAX. That range of values cannnot be represented in a 32-bit environment by type long (can't represent ULONG_MAX) or unsigned long (can't represent a negative value). The error message does not point to either value because either one is OK by itself -- the combination is not OK.
    Experimenting with g++ shows that it uses type long long for the underlying type, a non-standard language extension. Sun C++ does not support enums larger than long or unsigned long.
    To make your code conform to the requirements of the C++ Standard, you must restrict the range of the enum values. Depending on whether you intend ~(1<<10) to be treated as negative or as unsigned, two choices are enum c  { cA = unsigned(~(1<<10)) ,  cB  = ULONG_MAX } ;
    enum c  { cA = ~(1<<10) ,    cB  = LONG_MAX } ;

Maybe you are looking for

  • Report with difference of prices from Inventory Valuation

    Hello! I need report with result from Inventory Valuation: Difference of prices= New price - Current Cost. Report can show last 7 documents and i should choose item code. Can u help me? Greetings from Poland

  • Evaluating OS X Lion Server

    Hi everyone, I am new to OS X Lion and plan to buy that soon. Few questions:- a) Will there be a mountain lion server version? should i wait for that? when is the release? b) I have few iMac, macbook pro mostly on lion. 1 macbook on snow leopard and

  • Question on buying a phone outright to keep my unlimited Verizon contract.

    Howdy I have a contract that I've had for about 8+ years its totally unlimited. My old DroidX is on it's last leg. Verizon wants me to buy a new phone and contract, limiting my limits. I seldom reach their minimum basic account, they say I don't need

  • STO with WM with shipping and transportation process

    Hi , Can anyone explain the process STO with WM with shipping and transportation?. What are all the config needs to be done for shipping and transportation? Regards, abi

  • ETM: Customer Internal Settlement

    Hi every body, How I can create a correct "Customer Internal Settlement"? I want to create a recipient in /vd01 but this Error appear: Customer # is not a sold-to party this error is related to Cust.int.settl field what are the correct "reference typ