Serialize a value object that implements Comparator T

Hi.
I'm implementing a VO like this:
public class RegionVO implements Serializable, Comparable<RegionVO>My problem is that i need that the class could be serialized completely.
The VO will be transfered throught EJB's and by past experiences with EJB 2 projects (the actual project is developed with EJB 3) and running the project in clusters, the application crashes to use VO defined like that.
I think that the problem is caused by implement Comparable too, this inteface isn't serializable and even if implement of Serializable interface, at least 1 method (compareTo(RegionVO o))not would serializable.
My question is if that is true, how to solve to serialize the entire VO.
Thanks.
Edited by: terinlagos on Jul 24, 2008 2:48 PM

terinlagos wrote:
Well, the question was because if eventually could have the same problem when in the future the application run in a clusterized server. Actually in my pc has no problem.Well at least you are thinking that clustering will introduce problems you don't have currently.
I suggest you start trying to cluster you application as early as possible, you undoubtedly will have allot of lessons to learn (I have never seen a cluster solution from an it-works-on-my-pc solution not run into unexpected problems)
Note: you can run a "clustered" solution on a single PC just in multiple JVMs (which would be deployed to different machines in your final solution)
You should make looking at this your top priority. IMHO.

Similar Messages

  • Error while using custom xslt: Cannot find the script or external object that implements prefix 'ScriptNS0'.

    Hi,
    We had a complex map. Because of some requirement, we used custom xslt on this map. Somehow at runtime that custom xslt is giving below error:
    Cannot find the script or external object that implements prefix 'ScriptNS0'.
    I checked below links, it seems this is a bug in Biztalk 2010/Visual stuio 2010.
    http://sandroaspbiztalkblog.wordpress.com/2012/07/29/biztalk-mapper-patterns-calling-an-external-assembly-from-custom-xslt-in-biztalk-server-2010/
    The above link suggest to add a xml element in the .btm file. I tried that as well but no luck. Can anyone suggest me reason and solution for this?
    Thanks, Girish R. Patil.

    When using the Custom XSLT option, you have to maintain the Extension Xml yourself, just as you would for inline custom Xslt that calls external Assemblies.
    Docs:
    http://msdn.microsoft.com/en-us/library/aa547368.aspx
    Sample:
    http://blog.vertica.dk/2013/03/20/using-custom-xslt-in-biztalk/

  • Value Object pattern implementation problem

    Hi All!
    I try to implement value object pattern in my bean as follows:
    /* Simplified code */
    public class Value implements Serializable {
    private String s;
    public setS(String value){
    s = value
    public getS(){return s}
    bean class:
    public class Bean extends Value implemets EntityBean {
    public Value getValue(){return this}
    Now question.
    When I try run this code I get next message
    org.omg.CORBA.MARSHAL: minor code: 0 completed: No
    org.omg.CORBA.portable.InputStream com.visigenic.vbroker.orb.GiopStubDelegate.invoke(org.omg.CORBA.Object, org.omg.CORBA.portable.OutputStream, org.omg.CORBA.StringHolder, org.omg.CORBA.Context, org.omg.CORBA.ContextList)
    org.omg.CORBA.portable.InputStream com.visigenic.vbroker.orb.GiopStubDelegate.invoke(org.omg.CORBA.Object, org.omg.CORBA.portable.OutputStream, org.omg.CORBA.StringHolder)
    org.omg.CORBA.portable.InputStream com.inprise.vbroker.CORBA.portable.ObjectImpl._invoke(org.omg.CORBA.portable.OutputStream, org.omg.CORBA.StringHolder)
    com.retailpro.cms.common.InventoryValue com.retailpro.cms.ejb._st_Inventory.getValue()
    void com.retailpro.cms.inventory.SetInventory._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
    void oracle.jsp.app.JspApplication.dispatchRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    void oracle.jsp.JspServlet.doDispatch(oracle.jsp.app.JspRequestContext)
    void oracle.jsp.JspServlet.internalService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    void oracle.jsp.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
    void oracle.lite.web.JupServlet.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.MimeServletHandler.handle(oracle.lite.web.JupApplication, java.lang.String, int, oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.JupApplication.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.JupHandler.handle(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.HTTPServer.process(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    boolean oracle.lite.web.HTTPServer.handleRequest(oracle.lite.web.JupInputStream, oracle.lite.web.JupOutputStream)
    boolean oracle.lite.web.JupServer.handle(oracle.lite.web.JupInputStream, oracle.lite.web.JupOutputStream)
    void oracle.lite.web.SocketListener.process(java.net.Socket)
    void oracle.lite.web.SocketListener$ReqHandler.run()
    Seems like object can't be serialized.
    But when I change my getValue() to next
    public Value getValue(){
    Value result = new Value();
    result.setS(s);
    return result;
    Everything goes fine!
    Can anybody comments this situation?
    Any information will be appreciated!
    Mike
    null

    Have you tried using our Business Components for Java framework to assist in developing your EJB components. BC4J is a design pattern framework that implements the J2EE Blueprints design patterns out of the box:
    [list][*]Session-Entity Fagade
    [*]Paged-List
    [*]Unified Data Access & Logic
    [*]Value Object
    [*]Model View Controller
    [list]
    and more...
    So many things you don't have to code yourself when you use BC4J to turbocharge your development... Also, using BC4J insulates you from having to choose once and for all at the beginning of your project that you ARE USING EJB AT ALL COSTS on your project.
    Many projects discover that they don't require a distributed objects configuration, but end up paying for it in architectural complexity and EJB's assumption that all beans might be located on remote VM's.
    With BC4J, you can build an app, deploy to EJB if you need EJB for a given project, or deploy to CORBA, or just to simple Java classes for improved performance without the remoting overheads. All without touching your application code.
    Pretty cool, I think. But of course, I'm biased :-)
    Steve Muench
    Lead Product Manager for BC4J and Lead XML Evangelist, Oracle Corp
    Author, Building Oracle XML Applications

  • Compile-time warning during javac of a Class that implements Comparable

    Hello All,
    I have defined a class as follows;
    public class CardTiles extends JButton implements Comparable{
    During normal compilation with javac, it tell me to use Xlint to compile and the warning it throws is below:
    CardTiles.java:4: warning: [serial] serializable class CardTiles has no definition of serialVersionUID
    public class CardTiles extends JButton implements Comparable{
    ^
    1 warning
    What does this warning mean?
    Many thanks!

    ejp wrote:
    you can choose to to differentiate between various versions of your CardTiles classThat's back to front. Serialization will always do that unless you stop it, which you can do via a fixed serialVersionUID. This tells Serialization that different versions of your class are compatible under serialization.I suppose I see it this way because I wouldn't have a serializable object without an ID. Without having an explicit ID the process isn't as transparent to me. It's the same sort of thing as using braces for statements when they're not necessary, e.g.
              if(check)
                   System.out.println("check is on");
              else
                   System.out.println("check is off");     versus     
              if(check) {
                   System.out.println("check is on");
              } else {
                   System.out.println("check is off");
              }

  • Abstract Class that implements Comparable

    I am trying to understand how a comparable interface works with an abstract class. Any help is greatly appreciated.
    I have a class ClassA defined as follows:
    public abstract class ClassA implements Comparable I have a method, compareTo(..), within ClassA as follows:
    public int compareTo(Object o) I have a sub-class ClassB defined as follows:
    public class ClassB extends ClassAI am receiving a compile error:
    Class must implement the inherited abstract method packagename.ClassA.compareTo(Object)
    Should or can the compareTo be abstract in ClassA and executed in ClassB? Just not sure how this works.

    ???? if you are inheriting from an abstract class your subclass must implement methods that were declared in the parent (abstract) class but not implemented
    When in doubt, refer to the Java Language Specification..

  • Java Object won't serialize to Value Object

    I downloaded the blazeds-turnkey-3.2.0.3978.zip. Using Eclipse I created the testdrive-update flex project and copied the source code from the flex-src.zip and also from the C:\BlazeDS\tomcat\webapps\samples directory. After using the C:\BlazeDS\sampledb>startdb.bat to start the database, I can run  the "testdrive-update" sample just fine from with in Eclipse. If I use the Flex Debugging perspective to look at what the srv.getProducts.lastResult returns, I can see that the Product.java was converted to the Product.as value object as seen in the next picture...
    I modified the testdrive-update to run a select againt a parts table in one of my databases. I modified the Product.java and Product.as to match the simple parts list that I am returning from the ProductService.Java.  When I run the code, it returns the parts. But, in debug mode I noticed that it is not using my value object when the data is passed back to the flex app. The data is stored as basic objects in an ArrayCollection as seen in the picture below.
    Why does it not use my Value Object?  
    I have tried a few different things and can't get the data to come back as Value Objects...
    Here is my code....
    <<<<<<<<<<<<<<<<<<< Product.as >>>>>>>>>>>>>>>>>>>>>
    package
        [Bindable]
        [RemoteClass(alias="flex.samples.product.Product")]
        public class Product
            public var partNum:String;
            public var description:String;
            public var active:String;
            public var uom:String;
            public function Product()
    <<<<<<<<<<<<<<< Product.java >>>>>>>>>>>>>>>>>>>>>>>>>>>
    package flex.samples.product;
    public class Product {
        private String partNum;
        private String description;
        private String active;
        private String uom;
        public Product() {
        public Product(String partNum, String description, String active, String uom) {
            this.partNum = partNum;
            this.description = description;
            this.active = active;
            this.uom = uom;
        public String getPartNum() {
            return partNum;
        public void setPartNum(String partNum) {
            this.partNum = partNum;
        public String getDescription() {
            return description;
        public void setDescription(String description) {
            this.description = description;
        public String getActive() {
            return active;
        public void setActive(String active) {
            this.active = active;
        public String getUom() {
            return uom;
        public void setUom(String uom) {
            this.uom = uom;
    <<<<<<<<<<<<<<<< ProductService.java >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    package flex.samples.product;
    import java.util.ArrayList;
    import java.util.List;
    import java.sql.*;
    import flex.samples.ConnectionHelper;
    import flex.samples.DAOException;
    public class ProductService {
        public List getProducts() throws DAOException {
            List list = new ArrayList();
            Connection c = null;
    //        try {
    //            c = ConnectionHelper.getConnection();
    //            Statement s = c.createStatement();
    //            ResultSet rs = s.executeQuery("SELECT * FROM product ORDER BY name");
    //            while (rs.next()) {
    //                list.add(new Product(rs.getInt("product_id"),
    //                        rs.getString("name"),
    //                        rs.getString("description"),
    //                        rs.getString("image"),
    //                        rs.getString("category"),
    //                        rs.getDouble("price"),
    //                        rs.getInt("qty_in_stock")));
            try {
                c = ConnectionHelper.getConnection();
                Statement s = c.createStatement();
                ResultSet rs = s.executeQuery("SELECT * FROM ae_i_inv_e ORDER BY PART");
                while (rs.next()) {
                    Product myProd = new Product(rs.getString("part"),
                                                 rs.getString("description"),
                                                 rs.getString("active"),
                                                 rs.getString("inv_uom"));
                    System.out.println("getPartNum:|"+myProd.getPartNum()+"|desc:"+myProd.getDescription()+
                                       "|active:"+myProd.getActive()+"|uom:"+myProd.getUom());
                    list.add(myProd);
    //                list.add(new Product(rs.getString("part"),
    //                                     rs.getString("description"),
    //                                     rs.getString("active"),
    //                                     rs.getString("inv_uom")));
            } catch (SQLException e) {
                e.printStackTrace();
                throw new DAOException(e);
            } finally {
                ConnectionHelper.close(c);
            return list;

    Hi, More info.. I built a new object from within the target doc and the same trouble is happening to the new object now too. All the other layers in the doc respond to keyframe changes. This new and only 3D object is behaving in the exact same fashion as the previous one. I tried to shift the order of the layers and no change. Here is a screen shot of the3D object and it's "ghost". with timeline screen shot too. This is truly baffling!! Any ideas? Anyone else with a similar experience? Is it something else in the doc that is interfering?  I could not find any other threads with this problem. thanks for ANY help you can offer.

  • Implementing Comparable

    I created an object to represent generic value and value's label.
    The object must implement Comparable.
    The question is: what should I return if
    this.value.compareTo(otherObject.value) != this.valueLabel.compareTo(otherObject.valueLabel);Should I return comparation result based on value or valueLabel?
    Here is the object:
    public class ValueObject implements Cloneable, java.io.Serializable, Comparable{
        protected Object value;
        protected String valueLabel;
        public ValueObject() {}
        public ValueObject(Object value, String valueLabel) {
            this.value = value;
            this.valueLabel = valueLabel;   
        public java.lang.Object getValue() {
            return value;
        public void setValue(java.lang.Object value) {
            this.value = value;
        public java.lang.String getValueLabel() {
            return valueLabel;
        public void setValueLabel(java.lang.String valueLabel) {
            this.valueLabel = valueLabel;
        public String toString(){       
            return this.valueLabel;
        public int compareTo(Object otherObj) {
            if (otherObj == null) {
                throw new NullPointerException("ValueObject is null");
            if (this.equals(otherObj)){
                return 0;
            ValueObject other = (ValueObject) otherObj;
            int i1 = this.valueLabel.compareTo(other.valueLabel);
            int i2 = ((Comparable) this).compareTo(otherObj);
            if (i1 > 0 && i2 > 0){
                return 1;
            }else if (i1 < 0 && i2 < 0){
                 return -1;
            //????????? this.value.compareTo(otherObject.value) != this.valueLabel.compareTo(otherObject.valueLabel);
            return 0;
        public boolean equals(java.lang.Object otherObj) {
            if (!(otherObj instanceof ValueObject)) {
                return false;
            ValueObject other = (ValueObject) otherObj;
            return ((value == null?other.value == null:value.equals(other.value)) 
              && (valueLabel == null?other.valueLabel == null:valueLabel.equals(other.valueLabel)));
        public int hashCode() {
            return ((value == null?-1:value.hashCode())
            ^ (valueLabel == null?-1:valueLabel.hashCode()));
    }TIA

    Huh? Not sure what you're asking. The general idea is something like this. Assume we're sorting Person by lastname, and then by firstname if last is equal. Null checks are ignored below cuz I'm lazy. public int compareTo(Object obj) {
        int rslt;
        Person that = (Person)obj);
        if (equals(that)) {
            return true;
        if ((rslt = last_.compareTo(that.last_) != 0) {
            return rslt;
        return first_.compareTo(that.first_)
    }Two "John Smith"s are indistinguishable from each other in a simple list of names.
    There could be a slight inconsistency with equals here if equals uses something besides last & first, for instance, address or phone number or SSN. If two John Smiths are unequal by that comparison, they could still show up as equal in compareTo. You need to either document that inconsistency, or have compareTo use all the fields that equals does. In fact, I often have equals call compareTo and check for a result of zero.
    Now, as to what you "should" do, that's entirely up to you and the semantics of your objects. On which fields do you want to sort them? What makes sense as a natural ordering?
    Also...
    > public int compareTo(Object otherObj) {
    if (otherObj == null) {
    throw new NullPointerException("ValueObject is null");
    if (this.equals(otherObj)){
    return 0;
    ValueObject other = (ValueObject) otherObj;
    int i1 = this.valueLabel.compareTo(other.valueLabel);
    int i2 = ((Comparable) this).compareTo(otherObj);What are you trying to do here? The above line will put you into an infinite recursion.

  • Serialization custom Class Object

    Hi,
    I'm kind of stuck with a problem.
    I've been writing a servlet and applet that are communicating over
    internet using a socket connection and Object Serialization.
    The objects that are passed are custom:
    public class mcuComObj implements Serializable{
        static final long  serialVersionUID = 2222;
        private String name;
        private Vector attributes;
        ...There are some more functions but those are not of any interest.
    In the vector attributes, I've planted a jPanel (swing).
    The weird thing is that this morning, it worked a few times...after that
    I'm getting the:
    javax.swing.JComponent; local class incompatible: stream classdesc serialVersionUID = 6954663636822719621, local class serialVersionUID = 5896976265092562486 ERROR message.
    The send code:
    Vector v = new Vector();
    Object objButton = (Object) jButton1;
    v.add(objButton);
    obj.setAttributes(v);  //obj = mcuComObj
    con.sendObject(obj);   //con = socket connection threadThe receive code:
    Object input= (Object) objInpStr.readObject();When I serialize the mcuComObj class, does it also serialize the
    embedded objects (in this case that are in the Vector)?
    The main question is...how can I solve this? I can not guarantee that
    both Servlet and Applet have the same JDK running...!
    Have anyone of you got any ideas?
    Thanks in advance,
    Chris van Diemen

    If the "magic numbers" (sent at the beginning of any writeObject() call) on the sending and receiving JDK differ, the object will not de-serialize properly on the receiving end.
    The easist solution would be to use a common format to transmit the data. Say! That sounds like XML.
    - Saish
    "My karma ran over your dogma." - Anon

  • How to get value object (entity abject) from ViewObject?

    How to get data from ViewObject in the form of value object? I know BC4J creates entity object for database table/view (looks like value object) but I did not find api to get entity object from ViewObject.
    Thanks.

    BC4J provides an implementation of the value object design pattern for you, so you don't have to waste time writing your own.
    I wrote a whitepaper illustrating how to take advantage of this at:
    Implement Collections of Value Objects for MVC Apps with BC4J
    This allows clients (like a servlet, a JSP, a Swing client, etc.) to get value objects from the collection of value objects that BC4J supports.
    However, if you are writing code inside your view object implementation class and want to access the entity object, just call the accessor that we generate into your view row implementation class for you. For example, for a VO named EmployeeView that uses an entity object named Employee, there will be a private accessor method getEmployee() that will give you the entity.

  • Best Practice Question - Business Logic in Value Objects?

    Just wondering what people's thoughts on best practices for setting properties of Value Objects.
    For instance, I have several getter/setters in one of my Value Objects with logic in the setter that uses the value to set values of other properties.
    For example, I have a Value Object that has the following properties:
    category (of type Category, which is another Value Object with properties "name" and "id")
    categoryId (of type int)
    categoryUpdated (of type Boolean)
    I have a collection of Category Objects in the Model. When I set the categoryId of this class, I set the "categoryUpdated" to true, and dispatch an CairngormEvent to that find the "category" with the specified "categoryId" and set the "category" property to this item.
    So what is the best practice? To simply make the "categoryId" a public variable, and create a new Event/Command to perform all this logic? Or is it ok to do it all in the Value Object setter?
    Thanks.

    Hi Eric,
    I can't speak for best practices, but the only logic I've ever added to a VO were getters: an example was a set of getters on an airline flight VO to get overall flight departure/arrival times/cities from an array of flight segments in a property of the VO.
    I feel uneasy (in the nicest possible way) about your VO for two reasons: firstly it has a strong dependency on bits of the Cairngorm framework to look up the category (and VOs normally don't need to depend on anything), and secondly the intent of Commands in Cairngorm is more to represent user gestures than to wire up VO properties (I often see people shoehorning stuff into Commands that might be better of as plain old business utility classes). I would rather see an UpdateCategoryCommand (that's what the user is trying to do?) that updates categoryId and hits a delegate to populate the category property.
    That said you might have a very good reason for doing this. Could you tell us where the code is that's setting categoryId, and if anything is using categoryUpdated?
    Cheers,
    Robin

  • Using a class or servlet that implements Serializable

    Hello everyone,
    Can someone please help me. I need to make a program that uses a class or servlet that implements Serializable and then use the values of the variables in servlets.
    The first is using it to validate login. then changing the color of the background, header and footer of each servlet.
    the variables in the Serialized file are all Strings for color, username, password, header text and footer text.
    I tried using the applet tag to run the class in the servlet but it is not working.

    It's not working because you seem to be making random guesses what servlets, serialization and files are

  • Serialization error while returning Value Object from Web Service

    Hi
    I have developed a sample Web Service (RPC based), it returns Customer Value Object
    when client calls getCustomer method.
    I have written a Client (attached the client source code) to invoke the web service
    when the client invokes the Web Service it throws an Exception , the Exception
    Exception in thread "main" serialization error: no serializer is registered for
    (null, {java:customer}Customer)
    at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:62)
    at com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPResponseSerializer.java:72)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(ReferenceableSerializerImpl.java:47)
    at com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCall.java:382)
    at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:364)
    at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)
    at ClientwithWSDL.main(ClientwithWSDL.java:63)
    CAUSE:
    no serializer is registered for (null, {java:customer}Customer)
    at com.sun.xml.rpc.encoding.TypeMappingUtil.getSerializer(TypeMappingUtil.java:41)
    at com.sun.xml.rpc.encoding.InternalTypeMappingRegistryImpl.getSerializer(InternalTypeMappingRegistryImpl.java:287)
    at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:47)
    at com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPResponseSerializer.java:72)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(ReferenceableSerializerImpl.java:47)
    at com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCall.java:382)
    at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:364)
    at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)
    at ClientwithWSDL.main(ClientwithWSDL.java:63)
    If someone can help me to fix the issue, it will be great.
    Thanks
    Jeyakumar Raman.

    I guess, this is because the RI client is not finding the
    codec to ser/deser your Value Object. You need to register
    the codec in the type mapping registry before you invoke
    the web service method.
    Here is a sample:
    Service service = factory.createService( serviceName );
    TypeMappingRegistry registry = service.getTypeMappingRegistry();
    TypeMapping mapping = registry.getTypeMapping(
    SOAPConstants.URI_NS_SOAP_ENCODING );
    mapping.register( SOAPStruct.class,
    new QName( "http://soapinterop.org/xsd", "SOAPStruct" ),
    new SOAPStructCodec(),
    new SOAPStructCodec() );
    BTW, you can do the same exact thing on the client by using
    WLS impl of JAX-RPC. Is there a reason for using RI on the
    client side?
    regards,
    -manoj
    "Jeyakumar Raman" <[email protected]> wrote in message news:[email protected]...
    Hi Manoj,
    Thanks for your information, Yes, my client is Sun's JAX-RPC based, but the Server
    Implementation is done using Weblogic 7.0. When I invoke the Client without WSDL.
    It works fine without any problem. But when I invoke the webservice using WSDL,
    I am getting this problem.
    Here is my Client Code :
    * This class demonstrates a java client invoking a WebService.
    import java.net.URL;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.namespace.QName;
    import customer.Customer;
    public class ClientwithWSDL {
    private static String qnameService = "CustomerService";
    private static String qnamePort = "CustomerServicePort";
    private static String BODY_NAMESPACE_VALUE =
    "http://jeyakumar_3957:7001/Customer";
    private static String ENCODING_STYLE_PROPERTY =
    "javax.xml.rpc.encodingstyle.namespace.uri";
    private static String NS_XSD =
    "http://www.w3.org/2001/XMLSchema";
    private static String URI_ENCODING =
    "http://schemas.xmlsoap.org/soap/encoding/";
    private static String method="getCustomer";
    private static String endpoint="http://jeyakumar_3957:7001/webservice/CustomerService?WSDL";
    public static void main(String[] args) throws Exception {
    // create service factory
    ServiceFactory factory = ServiceFactory.newInstance();
    // define qnames
    QName serviceName =new QName(BODY_NAMESPACE_VALUE, qnameService);
    QName portName = new QName(BODY_NAMESPACE_VALUE, qnamePort);
    QName operationName = new QName("",method);
    URL wsdlLocation = new URL(endpoint);
    // create service
    Service service = factory.createService(wsdlLocation, serviceName);
    // create call
    Call call = service.createCall(portName, operationName);
    // invoke the remote web service
    Customer result = (Customer) call.invoke(new Object[0]);
    System.out.println("\n");
    System.out.println(result);
    "manoj cheenath" <[email protected]> wrote:
    >
    >
    >Hi Jayakumar,
    >
    >From the stack trace it looks like you are using sun's
    >RI of JAX-RPC. I am not sure what is going wrong with RI.
    >
    >WLS 7.0 got its own implementation of JAX-RPC. Check
    >out the link below for details:
    >
    >http://edocs.bea.com/wls/docs70/webserv/index.html
    >
    >
    >Let us know if you need more details.
    >
    >--=20
    >
    >regards,
    >-manoj
    >
    >
    >
    > "Jeyakumar" <[email protected]> wrote in message =
    >news:[email protected]...
    >
    > Hi
    >
    > I have developed a sample Web Service (RPC based), it returns Customer
    >=
    >Value Object
    > when client calls getCustomer method.
    >
    > I have written a Client (attached the client source code) to invoke
    >=
    >the web service
    > when the client invokes the Web Service it throws an Exception , the
    >=
    >Exception
    >
    >
    > Exception in thread "main" serialization error: no serializer is =
    >registered for
    > (null, {java:customer}Customer)
    > at =
    >com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer=
    >(DynamicInternalTypeMappingRegistry.java:62)
    >
    > at =
    >com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPRespo=
    >nseSerializer.java:72)
    > at =
    >com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(Reference=
    >ableSerializerImpl.java:47)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCal=
    >l.java:382)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.ja=
    >va:364)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)
    > at ClientwithWSDL.main(ClientwithWSDL.java:63)
    >
    > CAUSE:
    >
    > no serializer is registered for (null, {java:customer}Customer)
    > at =
    >com.sun.xml.rpc.encoding.TypeMappingUtil.getSerializer(TypeMappingUtil.ja=
    >va:41)
    > at =
    >com.sun.xml.rpc.encoding.InternalTypeMappingRegistryImpl.getSerializer(In=
    >ternalTypeMappingRegistryImpl.java:287)
    > at =
    >com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer=
    >(DynamicInternalTypeMappingRegistry.java:47)
    >
    > at =
    >com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPRespo=
    >nseSerializer.java:72)
    > at =
    >com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(Reference=
    >ableSerializerImpl.java:47)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCal=
    >l.java:382)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.ja=
    >va:364)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)
    > at ClientwithWSDL.main(ClientwithWSDL.java:63)
    >
    > If someone can help me to fix the issue, it will be great.
    >
    > Thanks
    > Jeyakumar Raman.
    >
    >
    ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    ><HTML><HEAD>
    ><META http-equiv=3DContent-Type content=3D"text/html; =
    >charset=3Diso-8859-1">
    ><META content=3D"MSHTML 6.00.2713.1100" name=3DGENERATOR>
    ><STYLE></STYLE>
    ></HEAD>
    ><BODY bgColor=3D#ffffff>
    ><DIV><FONT face=3DCourier size=3D2>Hi Jayakumar,</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2>From the stack trace it looks like
    >=
    >you are using=20
    >sun's</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2>RI of JAX-RPC. I am not sure
    >=
    >what is going=20
    >wrong with RI.</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2>WLS 7.0 got its own implementation
    >of =
    >
    ></FONT><FONT face=3DCourier size=3D2>JAX-RPC. Check</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2>out the link below for =
    >details:</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT><FONT face=3DCourier=20
    >size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2><A=20
    >href=3D"http://edocs.bea.com/wls/docs70/webserv/index.html">http://edocs.=
    >bea.com/wls/docs70/webserv/index.html</A></FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2>Let us know if you need more=20
    >details.</FONT></DIV>
    ><DIV><BR>-- <BR><BR>regards,<BR>-manoj</DIV>
    ><DIV> </DIV>
    ><DIV><BR> </DIV>
    ><BLOCKQUOTE=20
    >style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
    >BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    > <DIV>"Jeyakumar" <<A=20
    > href=3D"mailto:[email protected]">[email protected]</A>>
    >=
    >wrote in=20
    > message <A=20
    > =
    >href=3D"news:[email protected]">news:[email protected]=
    >a.com</A>...</DIV><BR>Hi<BR><BR>I=20
    > have developed a sample Web Service (RPC based), it returns Customer
    >=
    >Value=20
    > Object<BR>when client calls getCustomer method.<BR><BR>I have written
    >=
    >a Client=20
    > (attached the client source code) to invoke the web service<BR>when
    >=
    >the client=20
    > invokes the Web Service it throws an Exception , the=20
    > Exception<BR><BR><BR>Exception in thread "main" serialization error:
    >=
    >no=20
    > serializer is registered for<BR>(null,=20
    > {java:customer}Customer)<BR>
    >=
    >at=20
    > =
    >com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer=
    >(DynamicInternalTypeMappingRegistry.java:62)<BR><BR> &nb=
    >sp; =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPRespo=
    >nseSerializer.java:72)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(Reference=
    >ableSerializerImpl.java:47)<BR> =
    >=20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCal=
    >l.java:382)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.ja=
    >va:364)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)<BR> =
    > =20
    > at ClientwithWSDL.main(ClientwithWSDL.java:63)<BR><BR>CAUSE:<BR><BR>no
    >=
    >
    > serializer is registered for (null,=20
    > {java:customer}Customer)<BR>
    >=
    >at=20
    > =
    >com.sun.xml.rpc.encoding.TypeMappingUtil.getSerializer(TypeMappingUtil.ja=
    >va:41)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.InternalTypeMappingRegistryImpl.getSerializer(In=
    >ternalTypeMappingRegistryImpl.java:287)<BR> =
    > =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer=
    >(DynamicInternalTypeMappingRegistry.java:47)<BR><BR> &nb=
    >sp; =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPRespo=
    >nseSerializer.java:72)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(Reference=
    >ableSerializerImpl.java:47)<BR> =
    >=20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCal=
    >l.java:382)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.ja=
    >va:364)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)<BR> =
    > =20
    > at ClientwithWSDL.main(ClientwithWSDL.java:63)<BR><BR>If someone can
    >=
    >help me=20
    > to fix the issue, it will be great.<BR><BR>Thanks<BR>Jeyakumar=20
    >Raman.</BLOCKQUOTE></BODY></HTML>
    >
    >
    [att1.html]

  • When opening certain websites or clicking links from google results, I get this popup message "Error: 'setTimeout' called on an object that does not implement i

    The message says: "Error: 'setTimeout' called on an object that does not implement interface Windows" Multiple message windows for this get open. And there is an OK button under it. I have to click on OK button on all the windows to be able to continue with working on the browser again.

    hello, can you try to replicate this behaviour when you launch firefox in safe mode once? if not, maybe an addon is interfering here...
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • How to identify a specific object that changed in a data table?

    I have a data table in my jsf page which populate by myList (a property of type List<myObject> in myBean) that contains a list of myObject objects.
    Within data table, the 'amount' property of myObject is in a h:inputText named 'amountText'.
    How can I recalculate another property (for example 'cost') of the specific myObject within one of the
    data table rows whenever user change the value of 'amountText' ?

    Hi Roger,
    I guess, it is up to your choice about design how you want to implement.
    you have two ways....
    1) Use valueChangeListener attribute of the text field, as it will be called for the row of the database on which the bind property value is actually changed.
    2) Not prefered, but you can use setterMethod of amount in the your object, and can compare its new value with the old one and can decide the consequence.
    Please let me know, if it solves your concern or you have a different concern.

  • Jsp:useBean and assigning a value to that bean

    Hello,
    I have a type called Country and I have declared a bean using the "jsp:useBean" syntax.
    I then try to assign a value to that bean in a scriptlet. Eventually I try to retrieve the values using "jsp:getProperty". The problem is that it appears to null.
    Here is the code of the jsp
    <%@ page language="java" %>
    <%@ page import="com.parispano.latinamericaguide.*" %>
    <%
    /* We retrieve the Countries object from the servlet context. */
    ServletContext sc = getServletContext();
    Countries cs = (Countries)sc.getAttribute("countries");
    %>
    <jsp:useBean id="country" class="com.parispano.latinamericaguide.Country"/>
    <%
    /* If the request contains a country id, then we set the variable. */
    country = cs.getCountryFromId(Integer.parseInt(request.getParameter("countryID")));
    %>
    <html>
    <head>
    <title>Country details</title>
    </head>
    <body>
    <table>
    <tr><td>Name</td><td><jsp:getProperty name="country" property="name"/><!-- This is not working--></td></tr>
    <table>
    <%
    out.println(country.getName());//This is working
    %>
    </body>
    </html>This is the code for the bean
    package com.parispano.latinamericaguide;
    * @author Julien Martin
    * Represents a country.
    public class Country implements Comparable {
         private int id;
         private String name;
         private int landArea;
         private String capital;
         private String currency;
         private String flag;
         private String internet_domain;
         private String dialling_code;
         private float literacy;
         private float male_life_expectancy;
         private float female_life_expectancy;
         private String map;
         private int population;
         private int population_year;
         private float birth_rate;
         private int birth_rate_year;
         private float death_rate;
         private int death_rate_year;
         private int gdp;
         private int gdp_per_head;
         private int gdp_year;
         private float unemployment_rate;
         private int unemployment_rate_year;
         public Country() {
         public Country(
              int id,
              String name,
              int landArea,
              String capital,
              String currency,
              String flag,
              String internet_domain,
              String dialling_code,
              float literacy,
              float male_life_expectancy,
              float female_life_expectancy,
              String map,
              int population,
              int population_year,
              float birth_rate,
              int birth_rate_year,
              float death_rate,
              int death_year_rate,
              int gdp,
              int gdp_year,
              float unemployment_rate,
              int unemployment_rate_year) {
              this.id = id;
              this.name = name;
              this.landArea = landArea;
              this.capital = capital;
              this.currency = currency;
              this.flag = flag;
              this.internet_domain = internet_domain;
              this.dialling_code = dialling_code;
              this.literacy = literacy;
              this.male_life_expectancy = male_life_expectancy;
              this.female_life_expectancy = female_life_expectancy;
              this.map = map;
              this.population = population;
              this.population_year = population_year;
              this.birth_rate = birth_rate;
              this.birth_rate_year = birth_rate_year;
              this.death_rate = death_rate;
              this.death_rate_year = death_year_rate;
              this.gdp = gdp;
              this.gdp_year = gdp_year;
              this.unemployment_rate = unemployment_rate;
              this.unemployment_rate_year = unemployment_rate_year;
         public float getBirth_rate() {
              return birth_rate;
         public int getBirth_rate_year() {
              return birth_rate_year;
         public String getCapital() {
              return capital;
         public String getCurrency() {
              return currency;
         public float getDeath_rate() {
              return death_rate;
         public int getDeath_rate_year() {
              return death_rate_year;
         public String getDialling_code() {
              return dialling_code;
         public float getFemale_life_expectancy() {
              return female_life_expectancy;
         public String getFlag() {
              return flag;
         public int getGdp() {
              return gdp;
         public int getGdp_per_head() {
              return gdp / population;
         public int getGdp_year() {
              return gdp_year;
         public int getId() {
              return id;
         public String getInternet_domain() {
              return internet_domain;
         public float getLiteracy() {
              return literacy;
         public float getMale_life_expectancy() {
              return male_life_expectancy;
         public String getMap() {
              return map;
         public String getName() {
              return name;
         public int getPopulation() {
              return population;
         public int getPopulation_year() {
              return population_year;
         public int getLandArea() {
              return landArea;
         public float getUnemployment_rate() {
              return unemployment_rate;
         public int getUnemployment_rate_year() {
              return unemployment_rate_year;
         public void setBirth_rate(float f) {
              birth_rate = f;
         public void setBirth_rate_year(int i) {
              birth_rate_year = i;
         public void setCapital(String string) {
              capital = string;
         public void setCurrency(String string) {
              currency = string;
         public void setDeath_rate(float f) {
              death_rate = f;
         public void setDeath_rate_year(int i) {
              death_rate_year = i;
         public void setDialling_code(String string) {
              dialling_code = string;
         public void setFemale_life_expectancy(float f) {
              female_life_expectancy = f;
         public void setFlag(String string) {
              flag = string;
         public void setGdp(int i) {
              gdp = i;
         public void setGdp_per_head(int i) {
              gdp_per_head = gdp/population;
         public void setGdp_year(int i) {
              gdp_year = i;
         public void setId(int i) {
              id = i;
         public void setInternet_domain(String string) {
              internet_domain = string;
         public void setLiteracy(float f) {
              literacy = f;
         public void setMale_life_expectancy(float f) {
              male_life_expectancy = f;
         public void setMap(String string) {
              map = string;
         public void setName(String string) {
              name = string;
         public void setPopulation(int i) {
              population = i;
         public void setPopulation_year(int i) {
              population_year = i;
         public void setlandArea(int i) {
              landArea = i;
         public void setUnemployement_rate(float f) {
              unemployment_rate = f;
         public void setUnemployment_rate_year(int i) {
              unemployment_rate_year = i;
         public String toString() {
              return name;
         public int compareTo(Object o) {
              Country c = (Country)o;
              int cmp = name.compareTo(c.name);
              System.out.println(cmp);
              return cmp;
    }Can anyone please help?
    Thanks in advance,
    Julien.

    Thanks,
    I have added scope="application". It still show "null" indicating that the bean is not initialized with the properties. I would like a quicker way to initialize a bean property than invoking the setProperty tag for each property.
    Here is a simple example that demonstrates the problem:
    <%@ page language="java" %>
    <%@ page import="com.tests.*" %>
    <jsp:useBean id="monBean" class="com.tests.MonBean" scope="application"/>
    <%
    MonBean mb = new MonBean();
    mb.setName("toto");
    monBean= mb;
    %>
    <html>
    <head>
    <title>Lomboz JSP</title>
    </head>
    <body bgcolor="#FFFFFF">
    <jsp:getProperty name="monBean" property="name"/>
    </body>
    </html>And the bean
    package com.tests;
    public class MonBean {
    private String name;
    public String getName() {
         return name;
    public void setName(String name) {
         this.name = name;
    }This show "null".
    Any other idea why this is not working?
    Thanks,
    Julien

Maybe you are looking for

  • How can I make my hotmail account delete emails that I delete on my phone?

    How can I make my hotmail account delete the messages that I delete on my Droid 3? I selected the "obey the other program" in my hotmail account, but nothing's being deleted. Thanks, Cesslie

  • HP 2700 connection to my MacG4 thru network

    HI! Can anyone please help me on how to be able to connect my HP 2700 printer to my Mac G4 thru wireless network? Thanks in advance for your kind assistance

  • How do I plot two variables when neither are time?

    I know how to plot a variable against time, but how do I plot two variables when neither one of them are time against each other. For example if I want to plot say force against distance what is the best approach to use? Thank you. Solved! Go to Solu

  • Error -1 in WSREG32

    WSREG-v3.0 This log file is reporting activity on a WM_SERVICE_START_EVENT event. WSREG-v3.0 While contacting the Work Station Import Service, an error -1 was encountered, and error description <Winsock gethostbyname() failed.> was reported. WSREG-v3

  • Casting Classes in jsp

    [att1.html]