Serializing & Deserializing objects through ObjectMessage

Hi,
I'm having trouble sending objects/instances of a class (Data) through the message queue. I also made Data to be serializable.
public class Data implements Serializable {
}The following are snippets of code from the Message producer side:
objectMessage = mySess.createObjectMessage();
MessageProducer myMsgProducer = mySess.createProducer(myQueue);
Data e = new Data();
objectMessage.setObject(e);
myMsgProducer.send(objectMessage);And the following are snippets of code from the message consumer:
public void onMessage(Message message) {
             if(message instanceof ObjectMessage ){
         try{
              ObjectMessage objMsg = (ObjectMessage) message;
              Data myData = (Data)objMsg.getObject();
         catch(JMSException e){
              System.out.println("Exception occured: " + e.toString());
}The result of attempting to cast the objMsg to a Data is an exception thrown.
i did noticed however, that when I was debugging the message consumer, that the byteArrayInputStream values for both message and objMsg are null meaning that the data is not being sent or received. Any help would be greatly appreciated, thanks!
Edited by: 883631 on Sep 13, 2011 4:09 PM
Edited by: EJP on 14/09/2011 09:22: added {noformat}{noformat} tags. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Sorry, the exception thrown is:
Exception occured: com.sun.messaging.jms.MessageFormatException: [C4015]: Deserialize message failed. - cause: java.lang.ClassNotFoundException: MsgSender.Data
Sep 14, 2011 8:53:50 AM com.sun.messaging.jmq.jmsclient.ExceptionHandler logCaughtException
WARNING: [I500]: Caught JVM Exception: java.lang.ClassNotFoundException: MsgSender.Data
where MsgSender is the name of the project that produces the messages to the queue.
Data is the class that is both on the sender and receiver side, and the exception is thrown as a result of casting the object message back into a type Data.
Data myData = (Data)objMsg.getObject();
I hope this isn't too confusing. What I'm wondering is if there are extra steps to serializing your object or if the ObjectMessage's setObject method automatically does that for you so as long as you declare your class to implement Serializable. And if that's the case, how do you deserialize it back to the original object?
Thank you

Similar Messages

  • Serializing/Deserializing Objects..Urgent !!!

    Hello Everyone,
    Out of the blue I got an exception like
    java.io.StreamCorruptedException: invalid stream header
         at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
         at java.io.ObjectInputStream.<init>(Unknown Source)
    I am implementing "Applet to Servlet communication".
    Actually i am trying to deserialize the object which was passed to the servlet.But when i read it back i am geting the above exception.
    Can anyone throw some light on it?
    Her is my code
    APPLET CODE:
    private void interactWithServlet() {
    WBObject result = null;
    try {
    // Create an object we can use to communicate with the servlet
    URL servletURL = new URL(sURL);
    URLConnection servletConnection = servletURL.openConnection();
    servletConnection.setDoOutput(true);
    servletConnection.setUseCaches(false);
    servletConnection.setRequestProperty("Content-Type", "application/octet-stream;charset=utf-8");
    ObjectOutputStream request = new ObjectOutputStream(
    new BufferedOutputStream(servletConnection.getOutputStream()));
    WBObject wbObj=m_whiteBoardComponent.getDesignPanel().getWBObject();
    int size=wbObj.getChildren().size();
    for(int i=0;i<size;i++){
    PickObject pick=(PickObject)wbObj.getChildren().get(i);
    System.out.println("the pick object name is"+pick.getName());
    int count=pick.getChildren().size();
    for(int j=0;j<count;j++){
    ItemObject item=(ItemObject)pick.getChildren().get(j);
    System.out.println("the item object name is"+item.getName());
    request.writeObject(wbObj);
    request.flush();
    request.close();
    ObjectInputStream response = new ObjectInputStream(
    new BufferedInputStream(servletConnection.getInputStream()));
    result = (WBObject)response.readObject();
    System.out.println("The object is"+(result instanceof WBObject));
    response.close();
    } catch (Exception e) {
    e.printStackTrace();
    SERVLET CODE:
    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
    IOException {
    WBObject o = null;
    ObjectInputStream inputStream = new ObjectInputStream(
    new BufferedInputStream(req.getInputStream()));
    try {
    o = (WBObject)inputStream.readObject();
    inputStream.close();
    } catch( ClassNotFoundException ex ) {
    ex.printStackTrace();
    // send response
    resp.setStatus(HttpServletResponse.SC_OK);
    resp.setContentType("application/octet-stream;charset=utf-8");
    ObjectOutputStream oos = new ObjectOutputStream(
    new BufferedOutputStream(resp.getOutputStream()));
    oos.writeObject(o);
    oos.close();
    Best Regards
    Ashish

    client
    URLConnection servletConnection = servletURL.openConnection();try
    HttpURLConnection servletConnection = (HttpURLConnection)servletURL.openConnection();server
    // send response
    resp.setStatus(HttpServletResponse.SC_OK);
    resp.setContentType("application/octet-stream;charset=utf-8");
    ObjectOutputStream oos = new ObjectOutputStream(
    new BufferedOutputStream(resp.getOutputStream()));
    oos.writeObject(o);
    oos.close();try
    // send response
    //resp.setStatus(HttpServletResponse.SC_OK);
    //resp.setContentType("application/octet-stream;charset=utf-8");
    ObjectOutputStream oos = new ObjectOutputStream(
    new BufferedOutputStream(resp.getOutputStream()));
    oos.writeObject(o);
    oos.flush();
    oos.close();

  • [java.nio] StreamCorruptedException when deserializing objects

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

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

  • JMS getObject() Error deserializing object for client

    I am using WL6.1 and having a problem deserializing an object for a
              client that doesn't have access to the corresponding implementation
              object in its CLASSPATH (it only deals with the interface). From
              previous posts, I read that upgrading to SP3 would fix this issue, but
              I am still having this problem on both Solaris and Windows using SP3.
              If I modify the client CLASSPATH to include the Server-side JAR file
              that contains the implementation class, I don't have the problem and I
              can successfully perform getObject() and deserialize the object. The
              following is the code for the client:
              public void onMessage(Message msg)
              String msgText;
              if(msg instanceof ObjectMessage)
              try
              ObjectMessage objMsg = (ObjectMessage) msg;
              ActivityCreationEvent msgEvent =
              (ActivityCreationEvent) objMsg.getObject();
              System.out.println("Got a creation event");
              catch(Exception ex)
              System.out.println("Error getting JMS message:" + ex);
              ex.printStackTrace();
              the following is the code for the server:
              objMsg = tSess.createObjectMessage(null);
              ActivityCreationEvent createEvent=new ActivityCreationEventImpl();
              objMsg.setObject(createEvent);
              tPublisher.publish(objMsg);
              and the following is the client stack trace:
              Error getting JMS message:weblogic.jms.common.JMSException: Error
              deserializing object
              weblogic.jms.common.JMSException: Error deserializing object
              at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:141)
              at com.test.producer.tck.CreateProducerByValue.onMessage(CreateProducerByValue.java:566)
              at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1865)
              at weblogic.jms.client.JMSSession.execute(JMSSession.java:1819)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.Kernel.execute(Kernel.java:257)
              at weblogic.kernel.Kernel.execute(Kernel.java:269)
              ----------- Linked Exception -----------
              at weblogic.jms.client.JMSSession.pushMessage(JMSSession.java:1733)
              at weblogic.jms.client.JMSSession.invoke(JMSSession.java:2075)
              at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:510)
              at weblogic.jms.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:149)
              at weblogic.jms.dispatcher.DispatcherImpl.dispatchOneWay(DispatcherImpl.java:429)
              at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              java.lang.ClassNotFoundException:
              com.test.activity.ri.ActivityCreationEventImpl
              at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:190)
              at weblogic.jms.common.ObjectMessageImpl$ObjectInputStream2.resolveClass(ObjectMessageImpl.java:277)
              at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:913)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
              at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1181)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
              at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:127)
              at com.test.producer.tck.CreateProducerByValue.onMessage(CreateProducerByValue.java:566)
              at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1865)
              at weblogic.jms.client.JMSSession.execute(JMSSession.java:1819)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.Kernel.execute(Kernel.java:257)
              at weblogic.kernel.Kernel.execute(Kernel.java:269)
              at weblogic.jms.client.JMSSession.pushMessage(JMSSession.java:1733)
              at weblogic.jms.client.JMSSession.invoke(JMSSession.java:2075)
              at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:510)
              at weblogic.jms.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:149)
              at weblogic.jms.dispatcher.DispatcherImpl.dispatchOneWay(DispatcherImpl.java:429)
              at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              The client doesn't need to have access to the implementation class for
              any other aspect of the code, and I would like to keep it that way.
              Does anyone have information as to the cause of the problem and a
              solution?
              Thanks in advance
              

    Hi James,
              Just having the interface is not sufficient, as the JVM must be able to
              find the implementation class of an object in order to unserialize it - this is not a WebLogic
              thing, it is a java thing. Either package the required class in the .ear that contains
              the MDB or put it in your classpath.
              Tom
              James J wrote:
              > I am using WL6.1 and having a problem deserializing an object for a
              > client that doesn't have access to the corresponding implementation
              > object in its CLASSPATH (it only deals with the interface). From
              > previous posts, I read that upgrading to SP3 would fix this issue, but
              > I am still having this problem on both Solaris and Windows using SP3.
              > If I modify the client CLASSPATH to include the Server-side JAR file
              > that contains the implementation class, I don't have the problem and I
              > can successfully perform getObject() and deserialize the object. The
              > following is the code for the client:
              >
              > public void onMessage(Message msg)
              > {
              > String msgText;
              >
              > if(msg instanceof ObjectMessage)
              > {
              > try
              > {
              > ObjectMessage objMsg = (ObjectMessage) msg;
              > ActivityCreationEvent msgEvent =
              > (ActivityCreationEvent) objMsg.getObject();
              > System.out.println("Got a creation event");
              > }
              > catch(Exception ex)
              > {
              > System.out.println("Error getting JMS message:" + ex);
              > ex.printStackTrace();
              > }
              > }
              > }
              >
              > the following is the code for the server:
              >
              > objMsg = tSess.createObjectMessage(null);
              > ActivityCreationEvent createEvent=new ActivityCreationEventImpl();
              > objMsg.setObject(createEvent);
              > tPublisher.publish(objMsg);
              >
              > and the following is the client stack trace:
              >
              > Error getting JMS message:weblogic.jms.common.JMSException: Error
              > deserializing object
              > weblogic.jms.common.JMSException: Error deserializing object
              > at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:141)
              > at com.test.producer.tck.CreateProducerByValue.onMessage(CreateProducerByValue.java:566)
              > at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1865)
              > at weblogic.jms.client.JMSSession.execute(JMSSession.java:1819)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.Kernel.execute(Kernel.java:257)
              > at weblogic.kernel.Kernel.execute(Kernel.java:269)
              > ----------- Linked Exception -----------
              > at weblogic.jms.client.JMSSession.pushMessage(JMSSession.java:1733)
              > at weblogic.jms.client.JMSSession.invoke(JMSSession.java:2075)
              > at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:510)
              > at weblogic.jms.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:149)
              > at weblogic.jms.dispatcher.DispatcherImpl.dispatchOneWay(DispatcherImpl.java:429)
              > at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown
              > Source)
              > at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              > at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              > at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              > java.lang.ClassNotFoundException:
              > com.test.activity.ri.ActivityCreationEventImpl
              > at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
              > at java.security.AccessController.doPrivileged(Native Method)
              > at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
              > at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
              > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
              > at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
              > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
              > at java.lang.Class.forName0(Native Method)
              > at java.lang.Class.forName(Class.java:190)
              > at weblogic.jms.common.ObjectMessageImpl$ObjectInputStream2.resolveClass(ObjectMessageImpl.java:277)
              > at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:913)
              > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
              > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
              > at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1181)
              > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
              > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
              > at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:127)
              > at com.test.producer.tck.CreateProducerByValue.onMessage(CreateProducerByValue.java:566)
              > at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1865)
              > at weblogic.jms.client.JMSSession.execute(JMSSession.java:1819)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.Kernel.execute(Kernel.java:257)
              > at weblogic.kernel.Kernel.execute(Kernel.java:269)
              > at weblogic.jms.client.JMSSession.pushMessage(JMSSession.java:1733)
              > at weblogic.jms.client.JMSSession.invoke(JMSSession.java:2075)
              > at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:510)
              > at weblogic.jms.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:149)
              > at weblogic.jms.dispatcher.DispatcherImpl.dispatchOneWay(DispatcherImpl.java:429)
              > at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown
              > Source)
              > at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              > at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              > at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              > The client doesn't need to have access to the implementation class for
              > any other aspect of the code, and I would like to keep it that way.
              > Does anyone have information as to the cause of the problem and a
              > solution?
              >
              > Thanks in advance
              

  • Error deserializing object

    Hi all,
    I am posting a serializable object as message to MDB Queue and trying to deserialize it in onMessage() method. But, getting below error
    "Exception in onMessage weblogic.jms.common.JMSException: Error deserializing object"
    Here is my onMessage method. Please help me !!!
    public void onMessage(Message msg) {
         ProcessQuery prQuery = null;          
         try {
              ObjectMessage message = (ObjectMessage) msg;
              ProcessQuery pQ = (ProcessQuery) message.getObject();
              prQuery = pQ.execute();
         catch(JMSException ex) {
              System.out.println("Exception in onMessage " + ex);
              ex.printStackTrace();
    ProcessQuery is a serializable object.
    Thanks in advance,
    Anitha

    Hi all,
    I am posting a serializable object as message to MDB Queue and trying to deserialize it in onMessage() method. But, getting below error
    "Exception in onMessage weblogic.jms.common.JMSException: Error deserializing object"
    Here is my onMessage method. Please help me !!!
    public void onMessage(Message msg) {
         ProcessQuery prQuery = null;          
         try {
              ObjectMessage message = (ObjectMessage) msg;
              ProcessQuery pQ = (ProcessQuery) message.getObject();
              prQuery = pQ.execute();
         catch(JMSException ex) {
              System.out.println("Exception in onMessage " + ex);
              ex.printStackTrace();
    ProcessQuery is a serializable object.
    Thanks in advance,
    Anitha

  • How to send data to bam data object through java code

    how to send data to bam data object through java code

    I've made a suggestion in other thread: https://forums.oracle.com/thread/2560276
    You can invoke BAM Webservices (Using Oracle BAM Web Services) or use JMS integration using Enterprise Message Sources (http://docs.oracle.com/cd/E17904_01/integration.1111/e10224/bam_ent_msg_sources.htm)
    Regards
    Luis Fernando Heckler

  • Accessing setters in parent view object through view link

    Hi,
    I want to access the setters in a parent view object from a child view object through the view link. I have not been able to find an example, can someone point me to one? This is possible isn't it?
    Thanks,
    Jim

    Hi,
    have a look at the developer guide, it has one
    http://download-uk.oracle.com/docs/html/B25947_01/toc.htm
    Frank

  • How to organize the context object through out the application process

    Hi,
    Here in my application is using the following steps for a process.
    - Login
    - Search
    - Update
    - Logout
    In those above steps, Login, Search, and Update actions are touching to database/LDAP every time. In each time, Im creating new Context object, I think this is a bad approach. When I hit the login, I need to get the connection object and use that for rest of the actions(search and update).
    So can we organize the single context object through out the application? And where do we need to close the Context object?

    Don't worry about it. The provider will reuse connections behind the scenes. They're not tied directly to Contexts.

  • Objects through servlet

    How to pass the object through servlet?

    I can venture a guess that the OP wants to 'send' an object as a request parameter or a form field.
    You'd have to turn the object into some data representation that can later on be translated back into the object; serialization comes to mind. It might be easier to just send the properties of the object as seperate request/form fields though!

  • How to create object through  transaction snro

    Hi ,
       I want to create an object through Snro transaction.
    I dont know how to use this transaction.
    Please Help.
    Thanks in advance.
    Nikita

    Nikita,
    Based on the transaction code, respective function consultant will create number range.
    If u want a number series for some other purpose in ur program u can create object in snro as below.
    1. Enter a object name and click 'CREATE' button
    2. In the next screen give relevant description
    3. In 'Number length domain' field u can specify the length of number .. example if u give char10, then it will be a ten digit number series.
    4.Enter warning percentage.. the purpose is to throw warning message 10 % before when ur number series about to exhaust.
    5. After entering those details --> press save button.
    6. Again come to main screen (SNRO initial screen) then click number raneg tab inthe application tool bar.it will take u to next screen.
    7. In that click internal change push button
    8. IN the resulting screen enter ur number range series,
    example
    01     00000001     09999999
    02     10000000     19999999 etc
    9. click save button..NOw ur number series is ready for use.
    Regards,
    Aswin.

  • Problems deserializing objects with Microsoft VM

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

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

  • The Proper way to go - Passing Serialized Java Objects vs. Web Services?

    The team which I am apart of in our little "community" is trying to convince some "others" (management) that we should not use web services to communicate (move large data) within the same application (allbeit a huge application spanning across many servers).
    Furthermore these "others" are trying to tell us that in this same application when two small apps. inside of this large app. are both java we should not communicate via serialized java objects but instead we should use Web Services and XML. We are trying to convince them that the simplest way is best.
    They have asked us to provide them with proof that passing serialized java objects back and forth between two smaller java applications inside of a larger one is an Industry Standard. Can anyone help either straighten my fellow workers and I out or help us convince the "others" of the proper way to go?

    When I was a consultant we always gave the client what they wanted. Even if it was the wrong choice. Suck it up.
    I'm glad I wasn't one of those customers. Although I agree that a customer is the one who decides what to do, when I pay someone for consultancy, I expect them to consult me. If they know I'm trying to do something that I shouldn't be doing, I expect a good consultant to be able to show me that there's a better way (not just tell me I'm not doing it right, mind you).
    We pass a lot of data using XML and we don't have any transmission or processing speed issues.
    Then you either have a much better network than our customer did, or we're not talking about the same amounts of data here.
    I used the JAX-RPC RI ...
    That's cool... our customer was, unfortunately, infected with Borland products, so we had to use BES. The web services on BES were run by Axis.
    How large were these messages?
    Huge... each element had about 15 attributes, so 1,200 elements would require 19,200 XML nodes (envelope not included). By comparison, the serialized messages weren't even a quarter that size. It's not just about what you send across the network; it's also the effort of parsing XML compared to desrializing Java objects. Our web service wasn't exactly the only process running at the server.
    Anyone who understand the fundamental difference between ASCII (XML) and binary (serialized) formats realizes that no web service can possibly achieve the performance of binary Java services. Why do you think that work is being put into binary web services? I'm not saying XML is never a good thing; just that it's not The Holy Grail that a lot of people are making it look like.
    http://issues.apache.org/jira/browse/AXIS-688
    Ouch.

  • Un-serializing java objects.

    Hi,
    I have a serialized java object.How can I convert it to a normal object or string object?
    Thanks
    Vivek

    Hi,
    I am not writing object into a file.I am
    just creating a objectoutputstream object.I have to
    convert it to string which i guess can be done using
    objectInputstream object .So is there any way out?
    Thanks
    vivekI'm confused by what you are trying to accomplish. An ObjectOutputStream is intended to write objects to a file. You can't convert an ObjectOutputStream to a String, they aren't related. Are you trying to write the objects to a String? I don't see the point of that.

  • Transport of PCD and Content objects through JDI.

    Hi all,
    Pls share the views about the trasport procedure for PCD and Content objects.
    Is it possible to transport PCD and Content objects through JDI?
    If it is possible, could you pls share how to configure the JDI setup?
    Thanks in advance,
    Kishore.

    Hi Kishroe,
    First, there is no supported, out of the box way to handle content objects in the JDI (now NWDI- NetWeaver Development Infrastructure) With that said, since it is a repository you could export your content package. Make it a zip file or something like that and add it to the repository.
    Again, I believe this is theoretically possible. I'm sure some of the other SDN members can provide an automated approach to do this.
    Good luck,
    John

  • How to access the LOB objects through databaselinks?

    How to access the LOB objects through databaselinks?

    Abhii wrote:
    How to access the LOB objects through databaselinks?You can refer to this link
    http://dbaforums.org/oracle/index.php?showtopic=4790
    I've found it by simple google-ing...
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

Maybe you are looking for

  • Looking to delete App Store

    Looking for answers from someone OTHER THAN PETE, (who seems to have no life other than to troll the forums) to either help from a technical part of apple to disable certain updates that I cannot seem to turn off or a developer (or coding) for deleti

  • Icon status bar question

    I had a button to turn my 3G on and off at the top of the notification bar...and after recent updates were installed i now have an airplane mode button in it's place and cannot figure out how to get that off and the 3G back on there..it's been a real

  • Tabs and JSTL?

    Hi all ! Im trying to develop a nice app that should show dates for a certain day and I need to use tabs to show the different deparments and their dates... Can that be possible using JSTL? Wich is the best approach? Any tut? Thanks a lot ! Juan Ma

  • How to avoid cross tab

    I'm trying to create CR report. In this report there should be mapped data for 5 years. The year depends on meaning of dinamic filter. Also data differes from each other by one parametre - plan or fact. To limit data by year and type of fact, I made

  • How do I open/chose a dokument in pages or Adobe to paste it in a webbrowser

    How do I open/chose a dokument in pages or Adobe to paste it in a webbrowser