Serialization, Wrapping, Casting

Why is serialization useful?
Why is Wrapping & Casting used?
Cheers
RC

It's people like you who give programmers a bad name.
Poor sense of humour.
What tests can you have access to the internet?
Idiot.Well, pardon me.
Why is serialization useful?
Because with it you can deep copy live objects, taking a 'snapshot' if you will of that object ...along with current the values in its data members ...allowing you to do things such as stream it to disk or accross a network where it can be reconstructed 'alive'. It's very useful in things like RMI.
Why is Wrapping & Casting used?
Wrapping is when you form a class to hold a primitive datatype, like an int.. You are 'wrapping' the int because, being not an object ...the int can't be serialized and passed over, say, a network. By wrapping it in a class, you have turned the simple int into an object. This object can then be serialized and used as such.
Now if this isn't homework, my ass!! Plenty of tests allow you to remain online. Those are usiually the ones designed to test your ethics.
I'll leave the casting issue for now. My show is on.
Cheers.

Similar Messages

  • Attention All C# Gurus! Time to SPRING Into Action!

    April fools out of the way, now let's find an April genius!
    The name "April" is derived from the Latin verb "aperire", meaning "to open", as it is the season when trees, flowers AND MINDS start to open! And.. I can't wait to OPEN and read this month's community contributions!
    (groan, tenuous link!)
    Things are indeed heating up around TechNet. The Wiki has become a shining example of what the community has to offer, and talent is SPRINGING FORTH from all corners of our garden of knowledge. 
    If you can find the time to enrich us with your latest revelations, or some fascinating facts, then not only will you build up a profile and name for yourself within the gaze of Microsoft's very own glitterati, but you will be adding pages to the most respected
    source for Microsoft knowledge base articles. This could not only boost your career, but would benefit generations to come!
    So don't be an April fool. Please realise the potential of this platform, realise where we are going, and join us in growing this community, learning more about you, and opening the minds of others!
    All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something
    you had to solve for your own day's work today.
    Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!
    This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!
    HOW TO WIN
    1) Please copy over your Microsoft technical solutions and revelations to
    TechNet Wiki.
    2) Add a link to it on
    THIS WIKI COMPETITION PAGE (so we know you've contributed)
    3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.
    If you win, we will sing your praises in blogs and forums, similar to the
    weekly contributor awards. Once "on our radar" and making your mark, you will probably be
    interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!
    Winning this award in your favoured technology will help us learn the active members in each community.
    Feel free to ask any questions below.
    More about TechNet Guru Awards
    Thanks in advance!
    Pete Laker
    #PEJL
    Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over to
    TechNet Wiki, for future generations to benefit from! You'll never get archived again, and
    you could win weekly awards!
    Have you got what it takes o become this month's
    TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!

    3 articles so far:
    C#: Serialization and Casting values with XDocument by Yan
    Grenier
    Unsafe C# with Pointers
    by Isham Mohamed
    .NET 4.5 Read-Only Interfaces by Tom
    Mohan
    And 2 days to go!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Serializable class throwing class cast exception.

    All,
    I have a serializable class name 'Owner' and while login to the application, i put the object of this class in the session. Later in my application, when i am trying to retrieve this obejct from the session using the following code, throwing class cast exception.
    Owner owner =(Owner)request.getSession().getAttribute(     WebKeys.LOGGEDINOWNER_OWNER_KEY)
    This piece of code works fine in test enviornment(single server), but fails in production which is clustered enviornment.
    Any help will be appreciated

    What could be the problem with class loader ? How can
    i confirm that ? What is the solution ?Change it into:
    Object owner = request.getSession().getAttribute(WebKeys.LOGGEDINOWNER_OWNER_KEY);
    System.out.println(owner.getClass() + " : " + Owner.class);And see what it prints..

  • Casting primitive wrap type variable to primitive

    We have this code:
    float f = 22.2f;
    System.out.println((int)f);
    Which prints out "22".
    Float f = 22.2f;
    System.out.println((int)f);
    When i changed the variabile type from float to Float, code throw up a compile a error, that Float type cannot be casted to int. Can somebody tell me what's going on? Isnt compiler supposed to do unboxing the variable to primitive float and then primitive float to be casted to an int?
    System.out.println((int)f.floatValue());
    Isnt that what the compiler is supposed to do? Code which works perfectly fine.
    Thank for your help.

    Hello vcraescu,
    I think you are wondering why the compiler does not convert from Float to float (unboxing) and subsequently from float to short (your cast), so the bug report probably does not help you too much.
    Casts come into play when the compiler can not assure that the statement is semantically correct. The bytecode would be the same with or without the cast (if the compiler would accept omitting casts).
    Casting primitives:
    int i = 0;
    short s = (short)i;Purpose of the cast: The compiler has no idea whether the two higher bytes are relevant and you therefore need to specify that they are not.
    Casting reference types:
    With reference types there are two types of casts, the upcast and the downcast.
    class Exampe {
         public static void example(Object... objects) {
              for (Object object : objects) {
                   System.out.print(object);
                   System.out.print(' ');
              System.out.println();
         public static void main(String[] args) {
              Object[] objects = { "String", 123, 1.23 };
              example(objects);
              example((Object) objects);
    }The purpose of this (up)cast is that you want the object to be treated as beeing of a more general type.
    org.w3c.dom.Node node;
    switch(node.getNodeType()) {
         case org.w3c.dom.Node.ELEMENT_NODE:
              org.w3c.dom.Element element = (org.w3c.dom.Element) node;
         case org.w3c.dom.Node.TEXT_NODE:
              org.w3c.dom.Text element = (org.w3c.dom.Text) node;
         default:
    }These casts tell the compiler that you are certain the object node is of a more specific type.
    My point is that all these casts have a distinct purpose. Your cast on the other hand does not. Looking at your code I see a conversion from a wrapper to a primitive, not necessarily the loss of precision connected with it and that is what this cast should be about.
    With kind regards
    Ben Schulz

  • Weblogic BLOB Cast Exception

    We have an interesting situation where have to support our application on
    both Weblogic 6.1 SP2 using an Oracle Type 2 driver and iPlanet using an
    Oracle Type 4 driver. In our application we are using blob's, and in order
    for our blob's to work with the Type 4 driver we must do a two stage process
    where we insert an Oracle EMPTY_BLOB and then select the newly inserted
    blob, cast it to oracle.sql.BLOB and upload it using streams.
    Unfortunately, when this code runs on WLS the datasource/connection pool
    substitutes some wrapper classes (or something) behind the scenes and we get
    class cast exceptions as the blob is of type
    weblogic.jdbc.rmi.SerialOracleBlob.
    Is there any way to configure WLS connection pools/datasources so that it
    doesn't use any weblogic classes and only uses oracle classes? We currently
    have our 3rd Party Oracle drivers as the first entry in our classpath. We
    can't switch to Oracle Type 2 on iPlanet (too buggy), or this would all be
    moot and we'd simply use the more generic non-vendor specific way of
    uploading blob's. And we can't cast to weblogic classes, because then that
    would break on iPlanet.
    Here's the code snippet that we can't change, because we have to support
    Oracle Type 4 on iPlanet.
    ResultSet blobs = ustmt.executeQuery();
    blobs.next();
    Blob blob = blobs.getBlob(1);
    OutputStream blobOut = ((oracle.sql.BLOB)
    blob).getBinaryOutputStream();
    try {
    blobOut.write(attachment.getFile());
    } catch (IOException e) {
    throw new ServletException(e);
    } finally {
    try {
    blobOut.close();
    } catch (IOException e) {
    throw new ServletException(e);
    blobs.close();
    Thanks,
    Gary

    Hi Gary!
    Blob oracle extensions are implemented internally in weblogic as
    weblogic.jdbc.rmi.SerialOracleBlob. As we wrap objects internally for
    serialization purpose, we can not use oracle objects directly. So, you have to
    use SerialBlob in weblogic.
    Mitesh
    Gary Rudolph wrote:
    We have an interesting situation where have to support our application on
    both Weblogic 6.1 SP2 using an Oracle Type 2 driver and iPlanet using an
    Oracle Type 4 driver. In our application we are using blob's, and in order
    for our blob's to work with the Type 4 driver we must do a two stage process
    where we insert an Oracle EMPTY_BLOB and then select the newly inserted
    blob, cast it to oracle.sql.BLOB and upload it using streams.
    Unfortunately, when this code runs on WLS the datasource/connection pool
    substitutes some wrapper classes (or something) behind the scenes and we get
    class cast exceptions as the blob is of type
    weblogic.jdbc.rmi.SerialOracleBlob.
    Is there any way to configure WLS connection pools/datasources so that it
    doesn't use any weblogic classes and only uses oracle classes? We currently
    have our 3rd Party Oracle drivers as the first entry in our classpath. We
    can't switch to Oracle Type 2 on iPlanet (too buggy), or this would all be
    moot and we'd simply use the more generic non-vendor specific way of
    uploading blob's. And we can't cast to weblogic classes, because then that
    would break on iPlanet.
    Here's the code snippet that we can't change, because we have to support
    Oracle Type 4 on iPlanet.
    ResultSet blobs = ustmt.executeQuery();
    blobs.next();
    Blob blob = blobs.getBlob(1);
    OutputStream blobOut = ((oracle.sql.BLOB)
    blob).getBinaryOutputStream();
    try {
    blobOut.write(attachment.getFile());
    } catch (IOException e) {
    throw new ServletException(e);
    } finally {
    try {
    blobOut.close();
    } catch (IOException e) {
    throw new ServletException(e);
    blobs.close();
    Thanks,
    Gary

  • Serialization error while invoking a Java web service

    Hi,
    I've a requirement where I need to create a Java web service, which returns a collection (a set of records).
    The way I've created a web service is by having a Java Class, which internally calls a Pl/sql package returning Ref cursors and a bean Class, which wraps the method of the Java Class, to return the collection. I could create the web service successfully and could invoke the end point. The end point looks like this: http://localhost:8988/MyJavaWebService-New_JWS-context-root/MyWebService_finalSoapHttpPort
    The method exposed for the web service in my Java class is of type ArrayList, to fetch the collection element.
    After giving the input at the end point, while I say invoke, for the web service, I get the following error:
    <env:Envelope
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns0="http://mypkg/types/"
    xmlns:ns1="http://www.oracle.com/webservices/internal/literal">
    <env:Body>
    <env:Fault>
    <faultcode>env:Server</faultcode>
    <faultstring>Internal Server Error (serialization error: no serializer is registered for (class mypkg.EmpBean, null))</faultstring>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    I've tried making my exposed method of type Vector as well and re-generated the web service. But still I face the same issue at invocation.
    Can anybody help me out and hint me on how I should proceed? I'm not sure if my approach is correct and so please correct me if I'm wrong.
    Thanks in Advance,
    Gayathri

    Hi,
    do you use 10.1.2 or 10.1.3?
    Take a look at:
    Re: How to create a web service with ArrayList or Collection

  • How to cast an object to a class known only at runtime

    I have a HashMap with key as a class name and value as the instance of that class. When I do a 'get' on it with the class name as the key, what I get back is a generic java.lang.Object. I want to cast this generic object to the class to which it belongs. But I don't know the class at compile time. It would be available only at runtime. And I need to invoke methods on the instance of this specifc class.
    I'm not aware of the ways to do it. Could anybody suggest/guide me how to do it? I would really appreciate.
    Thanks a lot in advance.

    Thanks all for the prompt replies. I am using
    reflection and so a generic object is fine, I guess.
    But a general question (curiosity) specific to your
    comment - extraordinarily generic...
    I understand there's definitely some overhead of
    reflection. So is it advisable to go for interface
    instead of reflection?
    Thanks.Arguments for interfaces rather than reflection...
    Major benefit at run-time:
    Invoking a method using reflection takes more than 20 times as long without using a JIT compiler (using the -Xint option of Java 1.3.0 on WinNT)... Unable to tell with the JIT compiler, since the method used for testing was simple enough to inline - which resulted in an unrealistic 100x speed difference.
    The above tests do not include the overhead of exception handling, nor for locating the method to be executed - ie, in both the simple method invocation and reflective method invocations, the exact method was known at compile time and so there is no "locative" logic in these timings.
    Major benefit at compile-time:
    Compile-time type safety! If you are looking for a method doSomething, and you typo it to doSoemthing, if you are using direct method invocation this will be identified at compile time. If you are using reflection, it will compile successfully and throw a MethodNotFoundException at run time.
    Similarly, direct method invocation offers compile-time checking of arguments, result types and expected exceptions, which all need to be dealt with at runtime if using reflection.
    Personal and professional recommendation:
    If there is any common theme to the objects you're storing in your hashtable, wrap that into an interface that defines a clear way to access expected functionality. This leaves implementations of the interface (The objects you will store in the hashtable) to map the interface methods to the required functionality implementation, in whatever manner they deem appropriate (Hopefully efficiently :-)
    If this is feasible, you will find it will produce a result that performs better and is more maintainable. If the interface is designed well, it should also be just as extensible as if you used reflection.

  • Problem with RSA/AES and the wrapped Key

    Hallo!
    For a server-client communications, I would like to use a hybrid encryption.
    For this I create an object of a serializable class that contains several properties, including the data that are to be transferred from A to B (Object, encrypted by AES), and the AES key, but wrapped by RSA (byte []).
    My basic problem is, that if I send the wrapped key, I get at the destination another byte array and thus the key can not be decoded:
    java.security.InvalidKeyException: Invalid AES key length: 256 bytes
    When I look at the string representation of the byte array before sending and immediate after receiving, the byte arrays are diffrent. Why?
    Extract from the encrypt method:
    TransportObject obj = new TransportObject();
        KeyGenerator keygen = KeyGenerator.getInstance("AES");
        SecureRandom random = new SecureRandom();
        keygen.init(random);
        Key key = keygen.generateKey();
        Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding");
        cipher.init(Cipher.WRAP_MODE, publicKey);
        byte[] wrappedKey = cipher.wrap(key);
    // Here I put the byte array in the object to be transmitted
        obj.setKey(wrappedKey);Extract from the decrypt method:
    / / Here I read the byte array from the received object
    byte[] wrappedKey = obj.getKey();
    Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding");
    cipher.init(Cipher.UNWRAP_MODE, privateKey);
    Key key = cipher.unwrap(wrappedKey, "AES", Cipher.SECRET_KEY);Here is the class that is serialized:
    import java.io.Serializable;
    public class TransportObject implements Serializable {
        private static final long serialVersionUID = 5044061539587999682L;
        private byte[] key;
        private String type;
        private byte[] data;
        public static final int STRING = 1;
        public static final int INT = 2;
        public static final int CHAR = 3;
        public TransportObject() {}
        public TransportObject(byte[] key, String type, byte[] data) {
            this.key = key;
            this.type = type;
            this.data = data;
        public byte[] getKey() {
            return key;
        public void setKey(byte[] key) {
            this.key = key;
    }Sending is done via:
    TransportObject obj = rsa.encrypt(objectToSend, keys.getPublicKey());
    ObjectOutputStream os =
        new ObjectOutputStream(socket.getOutputStream());
    os.writeObject(obj);
    os.flush();Receiving via
    ois = new ObjectInputStream(
        new BufferedInputStream(socket.getInputStream()));
    TransportObject obj = (TransportObject) ois.readObject();
    Object receivedObject = rsa.decrypt(obj, keys.getPrivateKey());Somehow, I hang down here.
    Do I overlook something? Do I have an error in reasoning?
    Thanks for any help!
    Best regards
    Sebastian Gohres
    Edited by: Spencer82 on Aug 7, 2010 9:06 AM
    Edited by: Spencer82 on Aug 7, 2010 9:08 AM

    Do I overlook something? Do I have an error in reasoning?I think at least 2.
    1. Don't do this. The general problem has been solved. The solution is called TLS, and Java provides a API called the JSSE for you to use.
    2.If you insist on rolling your own, don't specify NoPadding. Use PKCS1Padding. If you are going to use NoPadding, then you must provide your own padding scheme, which you have not.

  • Error getting while creating the custom pof serializer class

    the error which i am getting is
    2011-07-19 15:16:38.767/4.840 Oracle Coherence GE 3.7.0.0 <Error> (thread=main, member=1): Error while starting se
    vice "AspNetSessionCache": (Wrapped) (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext")
    Wrapped: Unable to load class for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.testJavaClas
    )) (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.coherence.component.util.Daemon.start(Daemon.CDB:52)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:7)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:6)
    at com.tangosol.coherence.component.util.SafeService.startService(SafeService.CDB:39)
    at com.tangosol.coherence.component.util.safeService.SafeCacheService.startService(SafeCacheService.CDB:5)
    at com.tangosol.coherence.component.util.SafeService.ensureRunningService(SafeService.CDB:27)
    at com.tangosol.coherence.component.util.SafeService.start(SafeService.CDB:14)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureServiceInternal(DefaultConfigurableCacheFactory.
    ava:1102)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:934
    at com.tangosol.net.DefaultCacheServer.startServices(DefaultCacheServer.java:81)
    at com.tangosol.net.DefaultCacheServer.intialStartServices(DefaultCacheServer.java:250)
    at com.tangosol.net.DefaultCacheServer.startAndMonitor(DefaultCacheServer.java:55)
    at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:197)
    Caused by: (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext") (Wrapped: Unable to load c
    ass for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.testJavaClass)) (Wrapped) java.lang.Cl
    ssNotFoundException: examples.testJavaClass
    at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:46)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.instantiateSerializer(Service.CDB:1
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:32)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:4)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onEnter(Grid.CDB:26)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onEnter(Par
    itionedService.CDB:19)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:14)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: (Wrapped: Unable to load class for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.
    estJavaClass)) (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.io.pof.ConfigurablePofContext.report(ConfigurablePofContext.java:1254)
    at com.tangosol.io.pof.ConfigurablePofContext.createPofConfig(ConfigurablePofContext.java:956)
    at com.tangosol.io.pof.ConfigurablePofContext.initialize(ConfigurablePofContext.java:775)
    at com.tangosol.io.pof.ConfigurablePofContext.setContextClassLoader(ConfigurablePofContext.java:319)
    at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:42)
    ... 7 more
    Caused by: (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:269)
    at com.tangosol.io.pof.ConfigurablePofContext.loadClass(ConfigurablePofContext.java:1198)
    at com.tangosol.io.pof.ConfigurablePofContext.createPofConfig(ConfigurablePofContext.java:952)
    ... 10 more
    Caused by: java.lang.ClassNotFoundException: examples.testJavaClass
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.tangosol.util.ExternalizableHelper.loadClass(ExternalizableHelper.java:3056)
    at com.tangosol.io.pof.ConfigurablePofContext.loadClass(ConfigurablePofContext.java:1194)
    ... 11 more
    Exception in thread "main" (Wrapped) (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext")
    Wrapped: Unable to load class for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.testJavaClas
    )) (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.coherence.component.util.Daemon.start(Daemon.CDB:52)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:7)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:6)
    at com.tangosol.coherence.component.util.SafeService.startService(SafeService.CDB:39)
    at com.tangosol.coherence.component.util.safeService.SafeCacheService.startService(SafeCacheService.CDB:5)
    at com.tangosol.coherence.component.util.SafeService.ensureRunningService(SafeService.CDB:27)
    at com.tangosol.coherence.component.util.SafeService.start(SafeService.CDB:14)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureServiceInternal(DefaultConfigurableCacheFactory.
    ava:1102)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:934
    at com.tangosol.net.DefaultCacheServer.startServices(DefaultCacheServer.java:81)
    at com.tangosol.net.DefaultCacheServer.intialStartServices(DefaultCacheServer.java:250)
    at com.tangosol.net.DefaultCacheServer.startAndMonitor(DefaultCacheServer.java:55)
    at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:197)
    Caused by: (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext") (Wrapped: Unable to load c
    ass for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.testJavaClass)) (Wrapped) java.lang.Cl
    ssNotFoundException: examples.testJavaClass
    at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:46)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.instantiateSerializer(Service.CDB:1
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:32)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:4)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onEnter(Grid.CDB:26)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onEnter(Par
    itionedService.CDB:19)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:14)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: (Wrapped: Unable to load class for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.
    estJavaClass)) (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.io.pof.ConfigurablePofContext.report(ConfigurablePofContext.java:1254)
    at com.tangosol.io.pof.ConfigurablePofContext.createPofConfig(ConfigurablePofContext.java:956)
    at com.tangosol.io.pof.ConfigurablePofContext.initialize(ConfigurablePofContext.java:775)
    at com.tangosol.io.pof.ConfigurablePofContext.setContextClassLoader(ConfigurablePofContext.java:319)
    at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:42)
    ... 7 more
    Caused by: (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:269)
    at com.tangosol.io.pof.ConfigurablePofContext.loadClass(ConfigurablePofContext.java:1198)
    at com.tangosol.io.pof.ConfigurablePofContext.createPofConfig(ConfigurablePofContext.java:952)
    ... 10 more
    Caused by: java.lang.ClassNotFoundException: examples.testJavaClass
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.tangosol.util.ExternalizableHelper.loadClass(ExternalizableHelper.java:3056)
    at com.tangosol.io.pof.ConfigurablePofContext.loadClass(ConfigurablePofContext.java:1194)
    ... 11 more
    2011-07-19 15:16:38.825/4.898 Oracle Coherence GE 3.7.0.0 <D4> (thread=ShutdownHook, member=1): ShutdownHook: stop
    ing cluster node
    2011-07-19 15:16:38.826/4.899 Oracle Coherence GE 3.7.0.0 <D5> (thread=Cluster, member=1): Service Cluster left th
    cluster
    Press any key to continue . . .
    coherence-pof-config.xml is
    <?xml version="1.0"?>
    <!DOCTYPE pof-config SYSTEM "pof-config.dtd">
    <pof-config>
    <user-type-list>
    <user-type>
    <type-id>1001</type-id>
    <class-name>examples.testJavaClass</class-name>
    <serializer>
    <class-name>com.tangosol.io.pof.PortableObjectSerializer</class-name>
    <init-params>
    <init-param>
    <param-type>string</param-type>
    <param-value>1</param-value>
    </init-param>
    </init-params>
    </serializer>
    </user-type>
    </user-type-list>
    </pof-config>
    testJavaClass.CLASS file is
    package examples;
    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import com.tangosol.io.pof.PortableObject;
    import com.tangosol.util.Base;
    import java.io.IOException;
    public class testJavaClass implements PortableObject
    private String MembershipId;
    private String m_sStreet;
    private String m_sCity;
    public testJavaClass()
    public testJavaClass(String sName, String sStreet, String sCity)
    setName(sName);
    setStreet(sStreet);
    setCity(sCity);
    public void readExternal(PofReader reader)
    throws IOException
    setName(reader.readString(0));
    setStreet(reader.readString(1));
    setCity(reader.readString(2));
    public void writeExternal(PofWriter writer)
    throws IOException
    writer.writeString(0, getName());
    writer.writeString(1, getStreet());
    writer.writeString(2, getCity());
    // accessor methods omitted for brevity
    Thanks.

    Hi Wijk,
    I have created java class with using NetBeans IDE .
    and running with .NET client and i kept it in the folder (C:\Program Files\Oracle\Coherence for .NET\examples\ContactCache.Java\src\examples).
    Thanks....

  • XML Serialization Error- While testing BAPI turned Web service

    I have a requirement to create sales order in SAP R/3 from an e-commerce site. I went through many forums suggesting "exposing FMs into Web Service". I wrapped BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_TRANSACTION_COMMIT into one FM and exposed as Web Service. I did a successful test-sequence.
    When I tested the web service without giving values I got a response asking for "Sold-to Party or Ship-To Party". While testing the Web service with some values, I got the below error -
    XML Serialization Error. Object content does not correspond to Schema restrictions of type [urn:sap-com:document:sap:rfc:functions][numeric4].
    The e-commerce team tried to hit the Web service and got the below error-
    IWAB0383E Error validating parameters
    Note: Our servers does not have any ENHPacks. Only ECC 6.0.
    Please suggest what might have gone wrong and how to resolve this.
    Thanks!

    Hi Gourav Khare,
    I have created WSDL file through function module in SAP-ECC 5.0v.
    I have followed below steps:
    Crated FM (SE37)
    Crated Web-service (SE37)
    Generated WSDL file using (WSADMIN)
    And consumed WSDF file in SOAP UI (SOAP UI 4.5.2 Trailer version)
    Problem is: while consuming WSDL file in  SOAP UI I getting  ‘Serialisation failed’
    For your reference I have furnished xml string below.
    SOAP UI Input:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:rfc:functions">
    <soapenv:Header/>
    <soapenv:Body>
    <urn:YSDF_INV_PRINT_FINAL_RFC_WS_N>
    <!--Optional:-->
    <PWR_INVOICE>
    <INVOICE_SHIPPED_LINE>
    <!--Zero or more repetitions:-->
    <item>
    <POSITION1></POSITION1>
    <SALES_PART></SALES_PART>
                      <PART_DESC></PART_DESC>
    <PRICE></PRICE>
    <QUANTITY></QUANTITY>
    <CUSTOMER_TAX_NO></CUSTOMER_TAX_NO>
    <PROD_NONINVENTORY></PROD_NONINVENTORY>
    <PROD_TAXABLE></PROD_TAXABLE>
    <TAX_LEVEL></TAX_LEVEL>
    </item>
    </INVOICE_SHIPPED_LINE>
    <INVOICE_NO></INVOICE_NO>
    <ORDER_NO></ORDER_NO>
    <DATE_PRINTED></DATE_PRINTED>
    <DIV_CD></DIV_CD>
                <LAST_COST_INVOICE></LAST_COST_INVOICE>
    <DELETE_ZERO_COST></DELETE_ZERO_COST>
    <DELETE_NON_SHIPPED></DELETE_NON_SHIPPED>
    <GLOBALREF></GLOBALREF>
    <ORIGIN></ORIGIN>
    <ORIGINID></ORIGINID>
    </PWR_INVOICE>
    </urn:YSDF_INV_PRINT_FINAL_RFC_WS_N>
    </soapenv:Body>
    </soapenv:Envelope>
    SOAP UI Output:
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Body>
    <soap-env:Fault>
    <faultcode>soap-env:Client</faultcode>
    <faultstring xml:lang="en">Serialisation failed</faultstring>
    <detail>
    <n0:SimpleTransformationFault xmlns:n0="http://www.sap.com/transformation-templates">
    <MainName>/1BCDWB/WSS0130716111624448000</MainName>
    <ProgName>/1BCDWB/WSS0130716111624448000</ProgName>
    <Line>8</Line>
    <Valid>X</Valid>
    <ReferenceFault>
    <DescriptionText>Error accessing the ref. node 'INVOICE_ID'</DescriptionText>
    <RefName>INVOICE_ID</RefName>
    </ReferenceFault>
    <Caller>
                      <Class>CL_SRG_RFC_PROXY_CONTEXT</Class>
    <Method>IF_SXML_PART~DECODE</Method>
    <Positions>1</Positions>
    </Caller>
    </n0:SimpleTransformationFault>
    </detail>
    </soap-env:Fault>
    </soap-env:Body>
    </soap-env:Envelope>
    And one more things are
    I don't know the exact reason, but now the WSDL is working fine. No Idea, will it be consistent.
    No changes in import and export parameters of RFC and no change in code, even if the logic is changed it should not affect the output on SOAP UI but in my case it does.
    Wonder why all this happens, I cannot explain the exact reason technically because my RFC works fine every time, only issue is with SOAP UI.
    From SAP point of view FM is working fine, and input parameter of FM is optional, validations are done by the programming logic and it will capture the message and its details with respect to input data.
    I am not sure SOAP will work consistently and we are using ECC 5.0 most of the t-code not there like "SOAMANAGER" and all.  
    Kindly help me on this
    Thanks & Regards,
       Akshath.L.T

  • How to cast vector to vector with out using loop. and how to override "operator =" of vector for this kind of condition.

    Hi All How to TypeCast in vector<>...  typedef  struct ...  to class... 
    //how to cast the vector to vector cast with out using loop
    // is there any way?
    //================ This is Type Definition for the class of ClsMytype=====================
    typedef struct tagClsMytype
    CString m_Name;
    int m_Index;
    double m_Value;
    } xClsMytype;
    //================ End of Type Definition for the class of ClsMytype=====================
    class ClsMytype : public CObject
    public:
    ClsMytype(); // Constructor
    virtual ~ClsMytype(); // Distructor
    ClsMytype(const ClsMytype &e);//Copy Constructor
    // =========================================
    DECLARE_SERIAL(ClsMytype)
    virtual void Serialize(CArchive& ar); /// Serialize
    ClsMytype& operator=( const ClsMytype &e); //= operator for class
    xClsMytype GetType(); // return the typedef struct of an object
    ClsMytype& operator=( const xClsMytype &e);// = operator to use typedef struct
    ClsMytype* operator->() { return this;};
    operator ClsMytype*() { return this; };
    //public veriable decleare
    public:
    CString m_Name;
    int m_Index;
    double m_Value;
    typedef struct tagClsMyTypeCollection
    vector <xClsMytype> m_t_Col;
    } xClsMyTypeCollection;
    class ClsMyTypeCollection : public CObject
    public:
    ClsMyTypeCollection(); // Constructor
    virtual ~ClsMyTypeCollection(); // Distructor
    ClsMyTypeCollection(const ClsMyTypeCollection &e);//Copy Constructor
    DECLARE_SERIAL(ClsMyTypeCollection)
    virtual void Serialize(CArchive& ar);
    xClsMyTypeCollection GetType();
    ClsMyTypeCollection& operator=( const xClsMyTypeCollection &e);
    ClsMyTypeCollection& operator=( const ClsMyTypeCollection &e); //= operator for class
    void Init(); // init all object
    CString ToString(); // to convert value to string for the display or message proposed
    ClsMyTypeCollection* operator->() { return this;}; // operator pointer to ->
    operator ClsMyTypeCollection*() {return this;};
    public:
    vector <ClsMytype> m_t_Col;
    //private veriable decleare
    private:
    //===================================================
    ClsMytype& ClsMytype::operator=( const xClsMytype &e )
    this->m_Name= e.m_Name;
    this->m_Index= e.m_Index;
    this->m_Value= e.m_Value;
    return (*this);
    //==========================Problem for the vector to vector cast
    ClsMyTypeCollection& ClsMyTypeCollection::operator=( const xClsMyTypeCollection &e )
    this->m_t_Col= (vector<ClsMytype>)e.m_t_Col; // how to cast
    return (*this);
    Thanks in Advance

    Hi Smirt
    You could do:
    ClsMyTypeCollection* operator->() {
    returnthis;};
    // operator pointer to ->
    operatorClsMyTypeCollection*()
    {returnthis;};
    public:
    vector<ClsMytype>
    m_t_Col;//??
    The last line with "vector<xClsMytype>
    m_t_Col;". It compiles but I doubt that is what you want.
    Regards
    Chong

  • Client code cast error:EJB returning data in Collection of Objects

    Still trying to understand this EJB stuff.....
    My BMP EJB returns data to the client in a collection of objects;
      // Home interface (CountryHome) nothing unusual here
      public Collection findAllCountries()
      //Remote interface (Country) nothing unusual here
      public CountryModel getDetails()The data object is a serialised object;
      // data object - nothing strange here
      public class CountryModel implements Serializable {
        private int countryId;
        private String countryName;
        public CountryModel () {......etc etc
        public CountryModel getDetails()  {.......etc etc
        public String toString() { ...etcWhen I try and get at the data from the collection in the client code, calling getDetails() in CountryModel causes a cast exception. How can I get at the data?
      Collection a = home.findAllCountries();
      Iterator i = a.iterator();
      while (i.hasNext()) {
        Object obj = i.next();
        Country country = (Country)
             PortableRemoteObject.narrow(obj, Country.class);
        // this fails with class cast exception.....
        System.out.println(country.getDetails());And to add to the confusion, why does calling the remote interface's getPrimaryKey() method in the client code invoke the toString() method in the CountryModel class and work?
      while (i.hasNext()) {
        Object obj = i.next();
        Country country = (Country)
             PortableRemoteObject.narrow(obj, Country.class);
        // have no idea why this works.....but it does.....
        System.out.println(country.getPrimaryKey());Thanks, lebo

    hi,
    you are getting a collection of serializable objects and not remote objects. the narow method has to be applied only for remote objects (actually it is the stub that will be received on the client side).
    so you modify your code as,
    Collection a = home.findAllCountries(); Iterator i = a.iterator(); while (i.hasNext()) {    Object obj = i.next();    Country country = (Country)obj;
    this will definitely solve the problem.
    regards
    srini

  • Class Cast exception in JSP

    Hi All,
    Softwares used : UI--> JSP/Flex Grid/Dojo framwork
    Spring MVC
    Back end : EJB 3.0
    application Server : Jboss 4.2.2
    i have one Ajax call witch will update my flex grid after getting the data from Backend.
    i am able to get responce object but i am getting the class cast exception in the jsp.
    This ajax call used for upload the file.i have filter witch contains the wrap the request like
    (HttpServletRequest) Proxy.newProxyInstance(
                        (javax.servlet.http.HttpServletRequest.class).getClassLoader(),
                        getInterfacesForObject(request), new HttpServletRequestProxy(
                                  request, entries));
    exception given below
    19:54:04,372 ERROR [[ifx]] Servlet.service() for servlet ifx threw exception
    java.lang.ClassCastException: $Proxy333
         at org.apache.catalina.core.ApplicationDispatcher.unwrapRequest(ApplicationDispatcher.java:776)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
         at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:240)
         at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:258)
         at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1174)
         at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:901)
         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
         at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    Can you help me out for resolve this issue.
    Regards,
    Ritesh Kumar K.

    riteshkumar wrote:
    but we are using copying and pasting the application related lib's in the jboss\lib folder along with default jboss lib'sI am not sure if I understand you.
    any way i tried but it's not resolving my problem.No other causes comes to mind. Sorry, can't help you further. Good luck with solving.

  • Trying to serialize a simple object

    Hi,
    I can't seem to create an ObjectInputStream. The error is noted in the code below. I also noticd that the output file where I seemingly wrote the object without problems is empty.
    import java.io.*;
    //Class from which an object is serialized:
    class MyClass implements Serializable
         private int num;
         private String str;
         public MyClass(int num, String str)
              this.num = num;
              this.str = str;
         public MyClass()
              num = 0;
              str = null;
         public void show()
              System.out.println(num);
              System.out.println(str);
    public class DemoSerialization
         public static void main(String[] args)
              MyClass A = new MyClass(50, "hello serialization");
              A.show();
    /*Create output file:*****************/
              File myFile = new File("C:\\TestData\\javaIO.txt");
              try
                   myFile.createNewFile();
              catch(IOException exc)
                   System.out.println("couldn't create output file");
                   System.exit(1);
    /*Create output stream:*************/
              ObjectOutputStream out = null;
              FileDescriptor fd = null;     //FileDescriptor represents a connection to a file.  Then,
                                                           //you don't have to do all the file checking, etc, when
                                                           //you move the data in the other direction(see below)
              try
                   FileOutputStream fos = new FileOutputStream(myFile);
                   fd = fos.getFD();
                   out =      new ObjectOutputStream(
                                  new BufferedOutputStream(fos));
              catch(FileNotFoundException exc)
                   System.out.println("couldn't find the file while during creation of file output stream");
                   System.exit(1);
              catch(IOException exc)
                   System.out.println("io error creating output file stream");
    /**/     System.out.println("test1: " + fd); // "java.io.FileDescriptor@df6ccd"
    /*Serialize the object:***************/
              try
                   out.writeObject(A); 
              catch(InvalidClassException exc)
                   System.out.println("class definition of object being written to a file has a problem");
              catch(NotSerializableException exc)
                   System.out.println("class of the object did not implement Serializable");
              catch(IOException exc)
                   System.out.println("general file output error occurred");
    /*Create input file stream:***********/
              FileInputStream fis = new FileInputStream(fd);
              BufferedInputStream bis = new BufferedInputStream(fis);
    /**/     System.out.println("test2: " + bis);  // "java.io.BufferedInputStream@b89838"
              ObjectInputStream in = null;
              try
                   in = new ObjectInputStream(bis);      /*****ERROR--throws exception*****/
              catch(IOException exc     )
                   System.out.println("ObjectInputStream error");
    /**/     System.out.println("test3: " + in);  // "null"
    /*Read in the object:****************/
              MyClass B = null;
              try
                   B = (MyClass) in.readObject();  /***ERROR--NullPointerExecption(see above)***/
              catch(ClassNotFoundException exc)
                   System.out.println("no class definition exists in this program for the object read in");
              catch(InvalidClassException exc)
                   System.out.println("class def is present but there is something wrong with it");
              catch(StreamCorruptedException exc)
                   System.out.println("control info in stream is corrupt");
              catch(OptionalDataException exc)
                   System.out.println("attempted to read in a basic data type--not an object");
              catch(IOException exc)
                   System.out.println("general stream error occurred during read");
              B.show();
    }

    Your originaly source did not include the call to the
    close method of ObjectOutputStream which is why your
    file was created but empty. I assumed you added it
    after the call to writeObject.
    Well, that isn't the case. I posted that I added flush().
    Read the API docs on the FilterDescriptor class.
    This class basically represents an opened file (or
    r other open streams) in either an inputstream OR
    outputstream. So when you close the outputstream.
    The file is not open anymore and thus the
    e FileDescriptor object is no longer valid because it
    represents and open stream.
    I didn't have to read the API docs because to me that seemed like common sense: if I have an object that represents a connection to a file, and I close the connection, it makes sense to me that the object would no longer be valid. Therefore, I didn't use close() in my program.
    As far as avoiding lots of try blocks, why not wrap
    the whole program in a try block? I assume you're
    using all those System.out.println commands to help
    debug. It'd be more helpful if you called
    printStackTrace on the thrown exception when an error
    occurs.
    Ok, thanks.
    I've done some more tests, and the problem isn't specific to serialization. I'm also unable to use a FileDescriptor when reading a char from a file. I get the same "access denied" error:
    import java.io.*;
    class  DemoFileDescriptor
        public static void main(String[] args)
            //Create a file:
            File myfile = new File("C:\\TestData\\javaIO.txt");
            try
                myfile.createNewFile(); 
            catch(IOException exc)
                System.out.println(exc);
                System.out.println("io exception createNewFile()");
            //Create a FileInputStream:
            FileOutputStream out = null;
            try
                out = new FileOutputStream(myfile);
            catch(FileNotFoundException exc)
                System.out.println(exc);
                System.out.println("error creating FileOutputStream");
            //Get the FileDescriptor:
            FileDescriptor fd = null;
            try
                fd = out.getFD(); //a file connection
            catch(IOException exc)
                System.out.println(exc);
                System.out.println("trouble getting FileDescriptor");
            //Output something to the file:
            char ch = 'a';
            try
                out.write((int) ch);
            catch(IOException exc)
                System.out.println(exc);
                System.out.println("io error writing to file");
            //Create a FileInputStream using the FileDescriptor:
            FileInputStream in = new FileInputStream(fd);
            //Read back from the file:
            char input = ' ';
            try
                input = (char) in.read();  /**ERROR-access denied**/
            catch(IOException exc)
                System.out.println(exc);
                System.out.println("problem reading");
                exc.printStackTrace();
            System.out.println(input);
    } Here is the output and stack trace:
    ---------- java ----------
    java.io.IOException: Access is denied
    problem reading
    java.io.IOException: Access is denied
         at java.io.FileInputStream.read(Native Method)
         at DemoFileDescriptor.main(DemoFileDescriptor.java:69)
    Output completed (2 sec consumed) - Normal Termination

  • Casting DataHandler to complex user type.

    Hi guys,
    I am beginner and I have met a problem during invoking my Web Service. To create and run it I have used Axis2 v 1.4, Eclipse tools and Tomcat 6. I found out the problem are complex invoking parameters because when I run simple WS with basic type parameter like String everything works fine.
    What is wrong with my implementation?
    Service class:
    public class AccessLevelService implements AccessLevelContract {
         private AccessLevelDAO accessLevelDAO;
         public AccessLevelService() {
              String [] path = {"com/applicationContext.xml"};
              ApplicationContext applicationContext = new ClassPathXmlApplicationContext(path);
              accessLevelDAO = (AccessLevelDAO) applicationContext.getBean("accessLevelDAO");
         @Override
         public void add(AccessLevel entity) {
              accessLevelDAO.add(entity);
         @Override
         public List<AccessLevel> getAll() {
              return accessLevelDAO.getList(new AccessLevel());
         @Override
         public void modify(AccessLevel entity) {
              accessLevelDAO.modify(entity);
         @Override
         public void remove(AccessLevel entity) {
              accessLevelDAO.remove(entity);
    }Here is my AccessLevel class:
    public class AccessLevel implements Serializable{
         private int id;
         private String level;
         public AccessLevel() {
         public AccessLevel(String level) {
              this.level = level;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getLevel() {
              return level;
         public void setLevel(String level) {
              this.level = level;
    }Exception:
    [ERROR] javax.activation.DataHandler cannot be cast to com.rejkowicz.dataobject.AccessLevel
    java.lang.ClassCastException: javax.activation.DataHandler cannot be cast to com.rejkowicz.dataobject.AccessLevel
         at com.rejkowicz.ws.AccessLevelService.add(AccessLevelService.java:1)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
         at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(RPCInOnlyMessageReceiver.java:63)
         at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
         at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
         at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
         at java.lang.Thread.run(Thread.java:619)
    [ERROR] org.apache.axis2.AxisFault: javax.activation.DataHandler cannot be cast to com.rejkowicz.dataobject.AccessLevelBy,
    Luke

    Matthew,
    Edward has the right approach, though somewhere you two mis-communicated.
    You can create either a dynamic or static LOV within HTML DB that is not part of the "database end".
    If I'm understanding what you are saying correctly, using a static LOV (where within HTML DB you define the 4='Temp" relationship), on the form itself you'd basically be saying:
    select temp display_field, type_code return_value from your_LOV.
    HTML DB's LOV will display pretty much whatever you want (the display_field), and then return pretty much whatever you want (the return_value). Sometime's it's a little limited, only showing the one display_field, but you can sometimes work around it with some decode and concatenation.
    So, if you define a static LOV where you define the display value 'Temp' returns the number 4, everything should work fine.
    Bill Ferguson

Maybe you are looking for