JMS and object serialization

My Code is mentioned below
public class PMLCommandDTO  implements Serializable {
    ConfigureTagFilter cfgTagFltrObj;
    WriteTagData writeTagDataObj;
    ExtensionCommand  extnCmdObj;
   // all getter setter method.
}Now I set ConfigureTagFilter object (which is not serialized) to the
PMLCommandDTO class.
PMLCommandDTO serializedObj;
serializedObj = new PMLCommandDTO();
serializedObj.setCfgTagFltrObj(cfgTagFltrObj);Now Can I my "serializedObj" is serialized and can I use it to
javax.jms.ObjectMessage ---- > setObject(Serializable) method.

Cross post, already being responded in
http://forum.java.sun.com/thread.jspa?threadID=5214314&tstart=0
db

Similar Messages

  • Servlet and Object Serialization

    Hi,
    I am developing a routing server in Java
    2 Instances of the same server will be running in 2 different data centers.
    The servers have a Jetty server embedded with a Servlet inside.
    Server 1 will use a GET method to talk to the Server 2 -> Servlet which will write the state of an object back which will read by Server 1 and reconstruct the object back.
    Do you find any issues in Object Serialization/DeSerialization in the Servlet.
    What are the factors that I need to consider in this case?
    Regards,
    Jana

    Make sure that your servlet handles the transaction in the same thread that doPost() or doGet() is called in.
    I ended up porting some old ServerSocket based code to a servlet, and was handing off the request and response objects to a handler thread on the server side. I ended up with a ton of intermittent errors like this.
    Once I started handling the transactions in the same thread things worked heartbreakingly well.

  • EOFException and Object Serialization

    Hello, I am trying to build a distributed file storing system by using Multicast Sockets and I experience a problem the past 2 days.
    I have to use multicast sockets because it is not my decision.
    The problem appears when i have to transfer a file between 2 machines via UDP Datagrams.
    I know that the size of the byte array that is contained in a datagram is quite small so I built a function that breaks the file in to small byte arrays that have the size of 9500 bytes each.
    I insert these byte arrays in a new object that I call message and has additional information and I serialize the message object
    I send this byte array through the UDP socket and when I try do deserialize it on the other side I receive an EOFException that comes from the ObjectStream and particularly the method read() of the ObjectInputStream returns -1 which means it found the EOF in message that is been transported.
    I checked the bytes that are contained in the byte array with the partition of the file that is being transferred and I noticed that inside the file there are a number of negative numbers., which, as far as I know, shouldn't be happening.
    do you have any ideas for the reason these are happening?
    Thank you.
    Vagelis

    You can get negative bytes in an object stream.
    Try ensuring you have sent the length of the data and the data has been received in the correct order. Note Datagrams don't guarentee the order that packets were sent is the order they will be received.
    I would put a check sum at the end of your data to ensure the data is sound before attempting to decode it.
    If your packets are large, one option may be to compress the data with DeflatorOutputStream and InflatorInputStream. This can compress large object streams very well.

  • NIO and object serialization

    I try to use the new IO API to implement a non-blocking multi-threaded server that communicates with client applications by exchanging serialized objects. I started from the code in the JavaWorld article at http://www.javaworld.com/javaworld/jw-09-2001/jw-0907-merlin.html .
    With the new features of J2SDK 1.4.0, you don't have to create a separate thread per connected client. That is a big improvement.
    But when I read an object with ObjectInputStream, I get a java.nio.channels.IllegalBlockingModeException.
    Has anybody successfully implemented such a server since the release of the new io API?
    Thanks.
    Jean-Robert

    Hi,
    I tried to decode it and reconstruct the object as follows:
    buffer.flip();
    // Decode buffer
    decoder.decode(buffer, charBuffer, false);
    // Display
    charBuffer.flip();
    String str = charBuffer.toString();
    try
         ByteArrayInputStream bis = new ByteArrayInputStream(str.getBytes());
         ObjectInputStream ois = new ObjectInputStream(bis);
         Object obj = ois.readObject();
         if (obj != null)
         System.out.println(obj.getClass().getName());
         System.out.println("Construction successful");
    catch (Exception e)
         e.printStackTrace();
    I think it is constructing the object. But it gave me the following exception:
    java.io.InvalidClassException: MessageValueObject; local class incompatible: stream classdesc serialVersionUID = -1062950779601993928, local class serialVersionUID = -1038743931604855240
         at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:454)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1511)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1616)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
         at com.csxwt.zodiac.client.common.NIOPushletClient.run(NIOPushletClient.java:254)
         at java.lang.Thread.run(Thread.java:536)
    Whe I compared the bytes of returned object with the actual object I noticed that two bytes were different from the orignal. They were replaced with '?' (byte code 063) in the reconstructed byte stream.
    If anybody have a clue please help me too

  • Servlets and Object Serialization

    Say, you have a Servlet which sends Objects across an ObjectOutputStream which is obtained from its corresponding HttpServletResponse.
    res.getOutputStream().writeObject(myObject);
    From what I observe it is impossible to obtain an ObjectInputStream from the URLConnection of the calling servlet until it is finished processing.
    Does anyone know if there is a way to do this?
    URLConnection conn = _myUrl.openConnection();
    conn.setDoOutput(false);
    conn.setUseCaches(false);
    conn.setRequestProperty("Content-Type", "application/octet-stream");
    ObjectInputStream in = new ObjectInputStream(conn.getInputStream());
    System.out.println("This won't get called until the calling Servlet has finished processing, is it possible to retrieve before???");
    String s = in.readObject().toString();

    hi , I made a similar query some time ago and came up with the following solution.
    serverUrl_ = new URL(url_);
                   HttpURLConnection con_ = (HttpURLConnection)serverUrl_.openConnection();
                   con_.setRequestMethod("POST");
                   con_.setDoOutput(true);
                   con_.setDoInput(true);
                   con_.setUseCaches(false);
                   ObjectOutputStream out_ = new ObjectOutputStream(con_.getOutputStream());
                        out_.writeObject(new String("a test example to string"));
    The servlet would read this in as follows:
         protected void doPost(HttpServletRequest request_, HttpServletResponse response_){
              try{
                   //get required io streams
                   ObjectInputStream ois_ = new ObjectInputStream(request_.getInputStream());
                   ObjectOutputStream object_ = new ObjectOutputStream(response_.getOutputStream());
                   String test_ = (String)ois_.readObject();
                   if(test_ instanceof String){
                        System.out.println("String value is: "+test_);
                   } else {
                             System.out.println("error reading string")
              } catch(Exception ioe){
                   ioe.printStackTrace();
    this should give you the basic idea how to pass objects through http.
    Hope it helps
    rob

  • JMS Destination object not found

    Hi everyone,
    I have a weird problem with SunONE Message Queue 3.
    I have a queue and a connection factory defined (using the SunONE Application Server 7 Admin Console) as well as a physical resource.
    I can verify their existance using asadmin....
    asadmin>list-jmsdest -u admin server1
    queue_1 queue {}
    asadmin>list-jms-resources -u admin server1
    jms/newqueue_1
    jms/newQCF_1
    When I attempt to deploy a message driven EJB I get the following error
    SEVERE ( 1484): javax.naming.InvalidNameException: JMS Destination object not found:`jms/newqueue_1`
    This question has already been asked on the App Server board here http://swforum.sun.com/jive/thread.jspa?threadID=15517&tstart=0 (that post is nine months old btw).
    I am posting this here in the hope that someone more familiar with MQ3 may have an idea of how to help us.
    Thanks in advance.

    I have now solved this problem. External JNDI resources are required in the AppServer.
    They can be created with the following commands:
    asadmin>create-jndi-resource jndilookupname jms/newQCF_1 resourcetype javax.jms.QueueConnectionFactory factoryclass com.sun.jndi.fscontext.RefFSContextFactory enabled=true --property java.naming.provider.url=file\:///c\:/java/mqjndi:java.naming.security.authentication=none newQCF_1
    asadmin>create-jndi-resource jndilookupname jms/queue_1 resourcetype javax.jms.Queue factoryclass com.sun.jndi.fscontext.RefFSContextFactory enabled=true --property java.naming.provider.url=file\:///c\:/java/mqjndi newqueue_1
    Both these commands assume that the file system context is being used however the LDAP commands are similar (just more properties).
    This step, which seems vital, is missing from the AppServer documentation (in fact it specifically states that this step is not necessary). The irony is that I found the answer in the IBM MQ documentation!

  • Pros and Cons of using REST over JMS (and other technologies)

    Hey all,
    I am working on a project where we were using JMS initially to send messages between servers. Our front end servers have a RESTful API and use JEE6, with EJB 3.1 entity beans connected to a mysql database and so forth. The back end servers are more like "agents" so to speak.. we send some work for them to do, they do it. They are deployed in GlassFish 3.1 as well, but initially I was using JMS to listen to messages. I learned that JMS onMessage() is not threaded, so in order to facilitate handling of potentially hundreds of messages at once, I had to implement my own threading framework. Basically I used the Executor class. I could have used MDBs, but they are a lot more heavyweight than I needed, as the code within the onMessage was not using any of the container services.
    We ran into other issues, such as deploying our app in a distributed architecture in the cloud like EC2 was painful at best. Currently the cloud services we found don't support multi-cast so the nice "discover" feature for clustering JMS and other applications wasn't going to work. For some odd reason there seems to be little info on building out a scalable JEE application in the cloud. Even the EC2 techs, and RackSpace and two others had nobody that understood how to do it.
    So in light of this, plus the data we were sending via JMS was a number of different types that had to all be together in a group to be processed.. I started looking at using REST. Java/Jersey (JAX-RS) is so easy to implement and has thus far had wide industry adoption. The fact that our API is already using it on the front end meant I could re-use some of the representations on the back end servers, while a few had to be modified as our public API was not quite needed in full on the back end. Replacing JMS took about a day or so to put the "onmessage" handler into a REST form on the back end servers. Being able to submit an object (via JAXB) from the front servers to the back servers was much nicer to work with than building up a MapMessage object full of Map objects to contain the variety of data elements we needed to send as a group to our back end servers. Since it goes as XML, I am looking at using gzip as well, which should compress it by about 90% or so, making it use much less bandwidth and thus be faster. I don't know how JMS handles large messages. We were using HornetQ server and client.
    So I am curious what anyone thinks.. especially anyone that is knowledgeable with JMS and may understand REST as well. What benefits do we lose out on via JMS. Mind you, we were using a single queue and not broadcasting messages.. we wanted to make sure that one and only one end server got the message and handled it.
    Thanks..look forward to anyone's thoughts on this.

    851827 wrote:
    Thank you for the reply. One of the main reasons to switch to REST was JMS is strongly tied to Java. While I believe it can work with other message brokers that other platforms/languages can also use, we didn't want to spend more time researching all those paths. REST is very simple, works very well and is easy to implement in almost any language and platform. Our architecture is basically a front end rest API consumed by clients, and the back end servers are more like worker threads. We apply a set of rules, validations, and such on the front end, then send the work to be done to the back end. We could do it all in one server tier, but we also want to allow other 3rd parties to implement the "worker" server pieces in their own domains with their own language/platform of choice. Now, with this model, they simply provide a URL to send some REST calls to, and send some REST calls back to our servers.well, this sounds like this would be one of those requirements which might make jms not a good fit. as ejp mentioned, message brokers usually have bindings in multiple languages, so jms does not necessarily restrict you from using other languages/platforms as the worker nodes. using a REST based api certainly makes that more simple, though.
    As for load balancing, I am not entirely sure how glassfish or JBoss does it. Last time I did anything with scaling, it involved load balancers in front of servers that were session/cookie aware for stateful needs, and could round robin or based on some load factor on each server send requests to appropriate servers in a cluster. If you're saying that JBoss and/or GlassFish no longer need that.. then how is it done? I read up on HornetQ where a request sent to one ip/hornetq server could "discover" other servers in a cluster and balance the load by sending requests to other hornetq servers. I assume this is how the JEE containers are now doing it? The problem with that to me is.. you have one server that is loaded with all incoming traffic and then has to resend it on to other servers in the cluster. With enough load, it seems that the glassfish or jboss server become a load balancer and not doing what they were designed to do.. be a JEE container. I don't recall now if load balancing is in the spec or not..I would think it would not be required to be part of a container though, including session replication and such? Is that part of the spec now?you are confusing many different types of scaling. different layers of the jee stack scale in different ways. you usually scale/load balance at the web layer by putting a load balancer in front of your servers. at the ejb layer, however, you don't necessarily need that. in jboss, the client-side stub for invoking remote ejbs in a cluster will actually include the addresses for all the boxes and do some sort of work distribution itself. so, no given ejb server would be receiving all the incoming load. for jms, again, there are various points of work to consider. you have the message broker itself which is scaled/load balanced in whatever fashion it supports (don't know many details on actual message broker impls). but, for the mdbs themselves, each jee server is pretty independent. each jee server in the cluster will start a pool of mdbs and setup a connection to the relevant queue. then, the incoming messages will be distributed to the various servers and mdbs accordingly. again, no single box will be more loaded than any other.
    load balancing/clustering is not part of the jee "spec", but it is one of the many features that a decent jee server will handle for you. the point of jee was to specify patterns for doing work which, if followed, allow the app server to do all the "hard" parts. some of those features are required (transactions, authentication, etc), and some of those features are not (clustering, load-balancing, other robustness features).
    I still would think dedicated load balancers, whether physical hardware or virtual software running in a cloud/VM setup would be a better solution for handling load to different tiers?like i said, that depends on the tier. makes sense in some situations, not others. (for one thing, load-balancers tend to be http based, so they don't work so well for non-http protocols.)

  • Error publishing plsql webservice (xml schema mapping and/or serializer)

    Hi guys,
    I'm with a problem when publishing plsql webservices from JDeveloper 11.
    The scenario is something like this:
    1) I have a connection with a database 9i, and the objects (packages, object types, etc) are all in there.
    2) In this case, i can publish the package spec using the option "Publish as JAX-RPC Web Service" normally.
    3) A database 11g was created, and i compiled the objects in this environment.
    4) Then i've created a new connection with a database 11g.
    5) In this case, when i'll publish the webservice, the error occurs: "The following types used by the program unit do not have an XML Schema mapping and/or serializer specified: REC_DMP_REMESSA"
    I have no idea in how to solve this case. Someone can help?
    Thank in advance.
    Best Regards,
    Gustavo

    Duplicate of https://forums.oracle.com/thread/2610823
    Timo

  • 2D objects Serialization problem

    Welcome!
    I'm making a net game using RMI and I have this problem.
    When I'm trying to join my client with the server an error occures:
    Error: error marshalling arguments; nested exception is:
         java.io.NotSerializableException: java.awt.geom.Ellipse2D$Double
    My client contains an Object extending a JPanel class. There are 2D object used to make the map, and that's why this error occures.
    It's a funny thing, cause I'm not sending a whole Object of my client, but only it's refference (using "this" in the join() method) so I dont know why does the 2D object need to be serialized and sent :|?
    Any way, my question is how to make 2D objects serializable!? I have jdk1.5.0_06 and as far as I remember they should be srializable in this version. Mabey I'm dooing something wrong!? Mabey it's nessesary to ad an appropreate code-line or import sth... i don't know
    please help me... I have little time to finish my project, and this thing is blocking my work.
    Big thanks to anybodey who will help.
    regards floW

    I'll tel u the whole story then, my problem is as follows:
    public class BounceThread{
       public static void main(String[] args)   {
          JFrame ramka = new BounceFrame();
             ramka.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             ramka.setVisible(true);
    class BounceFrame extends JFrame{
    public BounceFrame()
          setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
          setTitle("MiniGolf v 1.0");
          panel = new BallPanel(); // this contains maps made with 2D objects
          panel.setBackground(Color.green);
          panel.setVisible(panel.czy_widać_panel());
          add(panel, BorderLayout.CENTER);
    // I add a menu bar, that starts a net game:
    JMenuBar pasekMenu = new JMenuBar();
              setJMenuBar(pasekMenu);
              JMenu menuGra = new JMenu("Game");
           // and so on... and finaly I add an option:
              menuGame_Nowa.add(new
                        AbstractAction("Net game")
                             public void actionPerformed(ActionEvent event)
                                  net_game(panel);
    // here i write my net_game method:
    public void net_game(BallPanel aPanel)
         //here, i make an Client object, and connect him with my server
         client = new mgClient(panel);
         client.join();
         // I give panel as a paramete, cause I cant think of another way of leting my server to uce it's (panels) methods
         // If I join only a name of my client, then how can I change the panel in my BounceFrame from the Clients method
         // "shouted" by the server!? It has to be a field in the client's object.
         // Is there any other way out!?
    // Class BouceFrame holds the panel as a field:
    private mgClient client;
    private BallPanel panel;
    //and so on...
    }and that's the real problem I'm facing here. Is there any solution!? I think, that making a Client's field out of my panel is the only way ot. And that means I need those 2D objects serialized... :(
    Please help if u can.
    Regards floW

  • WebLogic JMS and MQ JMS Mix

              I am writing a bean that reads a message from MQ (using MQJMS) and then write it
              onto a WebLogic JMS ( something lika a bridge). However I don't want to use bridge.
              Question/Problem Statement:
              Once I include mq jms jar files in class path. Would that in conflict with WebLogic
              JMS. How do in my program I make sure that it is using the MQ or WLS JMS implementation.
              I can have InitialContext() setup for mq in File and for WebLogic it is WebLogic's
              Initial Context. Thats is the only thing that I can tell in the program.
              Basically, I am trying to see what will make it ( fully qualified JMS Objects
              or what) decide which implmenatation to use.
              Chris
              

    The WebLogic JMS and MQSeries JMS classes won't conflict. Each JMS provider
              provides different classes that implement the same interfaces, so you can
              have a whole bunch of providers in your classpath and things should be OK.
              Most code that's written to the JMS API (including the code inside WLS that
              receives messages for MDBs) gets the JMS "ConnectionFactory" via JNDI, and
              uses that to create the other objects. (It also has to look up the
              "Destination" objects from JNDI.) When you code to the JMS standard only,
              then the only thing that "tells" your program which provider is being used
              is the ConnectionFactory class that you create or get out of JNDI.
              Below is my usual plug for the white paper that helps explain some of this
              stuff:
              http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers
              Look for "Using foreign JMS provdiesr with WLS".
              greg
              "Chris" <[email protected]> wrote in message
              news:[email protected]...
              >
              > I am writing a bean that reads a message from MQ (using MQJMS) and then
              write it
              > onto a WebLogic JMS ( something lika a bridge). However I don't want to
              use bridge.
              >
              > Question/Problem Statement:
              > Once I include mq jms jar files in class path. Would that in conflict with
              WebLogic
              > JMS. How do in my program I make sure that it is using the MQ or WLS JMS
              implementation.
              > I can have InitialContext() setup for mq in File and for WebLogic it is
              WebLogic's
              > Initial Context. Thats is the only thing that I can tell in the program.
              >
              > Basically, I am trying to see what will make it ( fully qualified JMS
              Objects
              > or what) decide which implmenatation to use.
              >
              > Chris
              

  • Getting started with JMS and weblogic 10

    Hi,
    Do anyone have the refer doc or tell me do i create a simple Sender client and reciever client tht use JMS Admin object on Web logic server.
    I tried with weblogic example but they run in their directory.
    How do i write separate program in notepad and run from command prompt.?????
    What is the classpath requiered to set??
    what are the jars required and where do i get those jars??
    Plzzz help i m tryibg to learn JMS on weblogic.
    Thanks
    Rohan Lopes

    Hi,
    I tried running my First JMS code, but it seems there is some problem on my ConnectionFactory setup. Here is the exception stacks:
    Exception in thread "Main Thread" javax.naming.NameNotFoundException: Unable to resolve 'QueueConnectionFactorAllwyn'. Resolved '' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'QueueConnectionFactorAllwyn'. Resolved '']; remaining name 'QueueConnectionFactorAllwyn'
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:217)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
         at weblogic.jndi.internal.ServerNamingNode_1000_WLStub.lookup(Ljava.lang.String;Ljava.util.Hashtable;)Ljava.lang.Object;(Unknown Source)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:379)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:367)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at jms.QueueSend.init(QueueSend.java:53)
         at jms.QueueSend.main(QueueSend.java:94)
    Caused by: javax.naming.NameNotFoundException: Unable to resolve 'QueueConnectionFactorAllwyn'. Resolved ''
         at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1138)
         at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:251)
         at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:171)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:205)
         at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:479)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:475)
         at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:59)
         at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:1016)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    My Code where queues and connection factory is defined is:
    // Defines the JNDI context factory.
    public final static String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
    // Defines the JMS context factory.
    //public final static String JMS_FACTORY="weblogic.examples.jms.QueueConnectionFactory";
    public final static String JMS_FACTORY="QueueConnectionFactorAllwyn";
    // Defines the queue.
    //public final static String QUEUE="weblogic.examples.jms.exampleQueue";
    public final static String QUEUE="exampleQueueAllwyn";

  • Byte [] to Object and Object to byte[]

    Hi,
    I am quite new to java and need some help. My question is how can I convert an Object to byte [] and convert back from byte [] to Object.
    I was thinking of something like:
    From object to byte []
    byte [] object_byte=object.toString().getBytes();
    When I try to do:
    String obj_string=object_byte.toString();
    But obj_string is not even equal to object.toString().
    Any suggestions?
    Thanks

    well nnneil, if you try to convert and Object into a byte[] in that way you only convert the string representation of the object in bytes.
    If you remenber an object is more than a simple bytes stream, an object have Class, Methods, Attributes and other things, if you wanna, you can use serializable to convert your object in a bytes stream.
    Or if your problem if pass something like {0x01,0x02,0x0f,...} in an object you can use a simple casting over your variable.
    try with this:
    public class Main
    public static void main(String[] args)
    try
    byte[] bs = {0x00,0x00,0x00};
    Object o = (Object)bs;
    System.out.print("Object:[" + o.toString() + "]");
    System.out.print("<- That does not equals to ->");
    int i = 0;
    while(i < bs.length)
    System.out.print("[" + bs[i++] + "]");
    catch(Exception e){
    e.printStackTrace();
    output is: Object:[[B@df6ccd]<- That does not equals to ->[0][0][0]
    if you see [B@df6ccd is the internal represent of bs object.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Creating the JMS Administered Objects

    Hi.. All
    I am new to JMS..... I have written two simple programs which are given in the examples SimpleQueueSender.java and SimpleQueueReciever.java..
    I successfully Compiled the programs..
    But When I am trying to run the SimpleQueueSender I am getting the following error...
    D:\jms>java SimpleQueueSender MyQueue 3
    Queue name is MyQueue
    BEFORE
    AFTER
    JNDI API lookup failed:javax.naming.NameNotFoundException: Unable to resolve MyQueue. Resolved: '
    ' Unresolved:'MyQueue' ; remaining name ''
    The structure of config.xml is as follows....
    <JMSConnectionFactory JNDIName="SeshuConnectionFactory"
    Name="MyQueue" Targets="myserver"/>
    I am using Weblogic 6.1 Server. I suppose the problem should be in creating the MyQueue JMS Administration Object...
    Please help me out in solving this problem..
    The portion of the code where exactly the exception is rising is as follows....
    System.out.println("BEFORE");
    queueConnectionFactory =(QueueConnectionFactory)jndiContext.lookup("SeshuConnectionFactory");
    System.out.println("AFTER");
    queue =(Queue)jndiContext.lookup(queueName);

    have you configured your queues, topic, connection factory in weblogic through its admin console?
    Ashwani

  • Customizing Forte object serialization

    Forte supports serialization of arbitrary object graphs into streams.
    However, there do not seem to be any well documented ways to customize
    this serialization, e.g. by using a different encoding scheme. It would
    seem there must be some support in there somewhere. I suppose at the
    very least, one could parse a serialized object (once one decoded the
    Forte encoding scheme) and do the conversion from that. That seems
    suboptimal, though.
    Has anyone done this? Any thoughts on how it might be done?
    Regards,
    Coty
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/forte>

    JavaFunda wrote:
    Object serialization is the process of saving an object's state to a sequence of bytes. Does it saves only the instance variable or also the object methods(like getter and setter methods) ? Only the state--the instance variables. It doesn't save the class definition. That has to be available separately (via classloader) at deserilaization time. In other words, you cannot deserialize an instance of a class that is not on your classpath.
    Once we we write the object to outputstream or some text file, how does it get transmitted over network?The same way any other bytes get transmitted. You have a Socket. You get its OutputStream. You wrap that in an ObjectOutputStream. When you write to the ObjectOutputStream, that writes through to the Socket's OutputStream, which is responsible for putting the bytes on the wire.
    Does we write the java object to text file only duuring serialization?We write the objects to wherever the other end of the ObjectOutputStream is connected to. Just like any other I/O.

  • Runtime Object serialization

    Hi,
    Could someone explain the concept of Runtime Object Serialization with a simple example?
    Thanks

    import java.io.*;
    /* you NEED to make the class implement Serializable */
    class Client implements Serializable {
        private String name;
        private String address;
        public String getName() { return name; }
        public String getAddress() { return address; }
        public void setName(String name) { this.name = name; }
        public void setAddress(String address) { this.address = address; }
        public String toString() { return "name='" + name + "' and address= " + address + "'"; }
    public class Test17 {
        public static void main(String[] args)  throws Exception {
            ObjectOutputStream oos = new ObjectOutputStream (new FileOutputStream ("test.bin"));
            Client myClient = new Client();
            myClient.setName("Steve Jobs");
            myClient.setAddress("1 Infinite Loop; Cupertino, CA 95014");
            System.out.println (myClient);
            oos.writeObject (myClient);
            oos.close();
            ObjectInputStream ois = new ObjectInputStream (new FileInputStream ("test.bin"));
            Client yourClient = (Client) ois.readObject();
            System.out.println (yourClient);
    }Run the program above. It creates an object of the class "Client", serializes it into a file named "test.bin" and recreates the object reading it from the same file.
    Dumping the binary file you get this:
    0000    AC ED 00 05 73 72 00 06  43 6C 69 65 6E 74 F1 D7   ....sr..Client..
    0010    74 76 C4 64 FD 43 02 00  02 4C 00 07 61 64 64 72   tv.d.C...L..addr
    0020    65 73 73 74 00 12 4C 6A  61 76 61 2F 6C 61 6E 67   esst..Ljava/lang
    0030    2F 53 74 72 69 6E 67 3B  4C 00 04 6E 61 6D 65 71   /String;L..nameq
    0040    00 7E 00 01 78 70 74 00  24 31 20 49 6E 66 69 6E   .~..xpt.$1 Infin
    0050    69 74 65 20 4C 6F 6F 70  3B 20 43 75 70 65 72 74   ite Loop; Cupert
    0060    69 6E 6F 2C 20 43 41 20  39 35 30 31 34 74 00 0A   ino, CA 95014t..
    0070    53 74 65 76 65 20 4A 6F  62 73                     Steve JobsYou can see a lot of things in the serialization of the object Client - the name of the class is written, the names of the fields, the type (java/lang/String), and the values of the fields as UTF-8 encoded strings.

Maybe you are looking for

  • Free Goods from One Material Group to Another Material Group

    Salute Masters!!  I need your valuble suggestion, please provide. I need to configure Free Goods of Material Group to Material Group. User want: 1) Free Goods from one Material Group to another Material Group, like F010 to F040 2) User should have op

  • How to create check box in tabular form

    Dear Friends i have craeaed tabular form .Recently all column are default text field but i want to change some column from text field to check box . i have try it with simple check box but there is no option to pass return value in to table. How to c

  • I cant seem to import video clips from lumix fz35 into iphoto '11

    Help please.......i dont know what im doing wrong,but i cant seem to do this,has anyone got any advice?

  • Optimize_Index in Oracle Text

    Hi All, I have tried the option Optimize_index in oracle text and it removed the un-necessary data from the $I table. I have used the Sub-String option in my index, so it created the $P table. During optimize_index, only the $I table gets cleaned up

  • Installing Veritas on Solaris 9

    Hi, I am new to solaris and am having a few problems installing veritas Netbackup 5 on Solaris 9. The CD mounts fine but when I type in ./install to start the installation I get an error message saying: install: not found Any help would be appreciate