Document in xml - Not serializable?

Hi, I was working with the Document in xml.
I tried to serialize it, but it seems that the implemantation of it is not serializable.
The problem is that the object is created with a factory method, so also inheriting it is no use, since the creation is not in our hands.
The only solution i can see is to inherit also the Factory and to ovverde the creation method.
Any suggestion?
Thanks,
Doron

why do you want to serialize the document object?
you might as well serialize the xml file it represents and when or where needed, just parse it and get its document object, which would essentially be the same as the object you are trying to serialize.

Similar Messages

  • Document in xml - Not serializable? Well, I need to cache it.

    Can anyone tell me how can I serialize DOM Document.
    When we try to put it in cache, cache complains that it
    is not serializable (I believe ElementImpl is not Serializable).
    In javadoc it shows serializable form for this Element, but when I look in the source it does not implements Serializable (and none of its parent interfaces).
    My question is this?
    Does anyone know how to serialize Document.
    (I do need to Serialize Document, not XML.In my case it
    is too expensive to parse XML every time I come back
    from cache)
    How do I use Serializable form of one class or interface?
    Thank You.
    Edmon

    Sorry about not being very helpful earlier. The number of people who submit JDC forum questions without reading even the elementary intro docs is rather staggering, IMHO. Here is something more detailed:
    (a) "Serialized form" of a class as found in javadoc has little to do with whether or not the class has been declared as Serializable by the implementor.
    (b) what matters to Java serialization is whether the object in question is runtime-Serializable. In your particular case, org.w3c.dom.Document is an interface and it was not declared as Serializable by W3C. Perhaps justifiably so, because that imposes unfair requirements on parser implementors [seeing that not everybody is expected to want to serialize a DOM tree the way you do].
    However, a particular parser implementation is free to make its Document implementation class as Serializable. If that is the case, writeObject(obj) will succeed even if "obj" variable is of Document [not Serializable] type but happens to point to a Serializable implementation class.
    But, if you rely on this behavior you are locking yourself into that particular parser implementation. Should you choose a different XML parser in the future you will see serialization errors at runtime. With things like JAXP and a variety of XML parsers available this perhaps is not the way to go.
    Things would have been different if Document was declared to implement Serializable. Then all XML parsers would have had a standard behavior for the DOM trees they produced, regardless of implementation details. This is not the case, though.
    Vlad.

  • ALC-DSC-005-000: com.adobe.idp.dsc.DSCNotSerializableException: Not Serializable

    We've created a process with an input parameter (String) and an output parameter. There is only one "Query Single Row" node. The SQL we've put has been tested successfully. But when the client Java program invokes it, it got the exception of "ALC-DSC-005-000: com.adobe.idp.dsc.DSCNotSerializableException: Not Serializable"

    Hi,
    I got this Exception when I was trying to convert the BarCode into XML. Here is my client Program.
    import java.io.File;
    import java.io.*;
    import java.io.FileInputStream;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Properties;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import com.adobe.livecycle.barcodedforms.CharSet;
    import com.adobe.livecycle.barcodedforms.Delimiter ;
    import com.adobe.livecycle.barcodedforms.XMLFormat ;
    import com.adobe.idp.Document;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
    import com.adobe.livecycle.barcodedforms.client.*;
    public class Testmain {
    public static void main(String[] args) {
    try
    //Set LiveCycle ES service connection properties
    Properties ConnectionProps = new Properties();
    ConnectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "t3://rndvipdev02:80");
    ConnectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");
    ConnectionProps.setProperty("DSC_SERVER_TYPE", "Weblogic");
    ConnectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");
    ConnectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");
    //Create a ServiceClientFactory object
    ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);
    BarcodedFormsServiceClient barClient = new BarcodedFormsServiceClient(myFactory);
    //Specify a PDF document to convert to a XDP file
    FileInputStream fileInputStream = new FileInputStream("D:\\abc\\barcode.pdf");
    Document inDoc = new Document (fileInputStream);
    java.lang.Boolean myFalse = new java.lang.Boolean(false);
    java.lang.Boolean myTrue = new java.lang.Boolean(true);
    //Decode barcoded form data
    org.w3c.dom.Document decodeXML = barClient.decode(
    inDoc,
    myTrue,
    myFalse,
    myFalse,
    myFalse,
    myFalse,
    myFalse,
    myFalse,
    myFalse,
    CharSet.UTF_8);
    //Convert the decoded data to XDP data
    List extractedData = barClient.extractToXML(
    decodeXML,
    Delimiter.Tab,
    Delimiter.Tab,
    XMLFormat.XDP);
    //Create an Iterator object and iterate through
    //the List object
    Iterator iter = extractedData.iterator();
    int i = 0 ;
    while (iter.hasNext()) {
    //Get the org.w3c.dom.Document object in each element
    org.w3c.dom.Document myDom = (org.w3c.dom.Document)iter.next();
    //Convert the org.w3c.dom.Document object to a
    //com.adobe.idp.Document object
    com.adobe.idp.Document myDocument = convertDOM(decodeXML);
    //Save the XML data to extractedData.xml
    File myFile = new File("D:\\abc\\extractedData"+i+".xml");
    myDocument.copyToFile(myFile);
    i++;
    catch(Exception e)
    e.printStackTrace();
    //This user-defined method converts an org.w3c.dom.Document to a
    //com.adobe.idp.Document object
    public static com.adobe.idp.Document convertDOM(org.w3c.dom.Document doc)
    byte[] mybytes = null ;
    com.adobe.idp.Document myDocument = null;
    try
    //Create a Java Transformer object
    TransformerFactory transFact = TransformerFactory.newInstance();
    Transformer transForm = transFact.newTransformer();
    //Create a Java ByteArrayOutputStream object
    ByteArrayOutputStream myOutStream = new ByteArrayOutputStream();
    //Create a Java Source object
    Source myInput = new DOMSource(doc);
    //Create a Java Result object
    Result myOutput = new StreamResult(myOutStream);
    //Populate the Java ByteArrayOutputStream object
    transForm.transform(myInput,myOutput);
    //Get the size of the ByteArrayOutputStream buffer
    int myByteSize = myOutStream.size();
    //Allocate myByteSize to the byte array
    mybytes = new byte[myByteSize];
    //Copy the content to the byte array
    mybytes = myOutStream.toByteArray();
    com.adobe.idp.Document myDoc = new com.adobe.idp.Document(mybytes);
    myDocument = myDoc ;
    catch(Exception ee)
    ee.printStackTrace();
    return myDocument;
    Here is the Exception StackTrace
    ALC-DSC-005-000: com.adobe.idp.dsc.DSCNotSerializableException: Not Serializable
    Caused by: ALC-DSC-003-000: com.adobe.idp.dsc.DSCInvocationException: Invocation error.
    at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:210)
    at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:134)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:44)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTr ansactionCMTAdapterBean.java:336)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(Ej bTransactionCMTAdapterBean.java:212)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapter_z73hg_ELOImpl.doS upports(EjbTransactionCMTAdapter_z73hg_ELOImpl.java:145)
    at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:104)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:44)
    at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:44)
    at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:93)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:44)
    at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:113)
    at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:102)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.invoke(AbstractMessageReceiv er.java:298)
    at com.adobe.idp.dsc.provider.impl.ejb.receiver.EjbReceiverBean.invoke(EjbReceiverBean.java: 151)
    at com.adobe.idp.dsc.provider.impl.ejb.receiver.Invocation_fpvhue_EOImpl.invoke(Invocation_f pvhue_EOImpl.java:61)
    at com.adobe.idp.dsc.provider.impl.ejb.receiver.Invocation_fpvhue_EOImpl_WLSkel.invoke(ILweb logic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.OutboundResponse;Ljava.lang.Object;)Lweblog ic.rmi.spi.OutboundResponse;(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(Lweblogic.security.acl.internal.Authentic atedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.Privileged ExceptionAction;)Ljava.lang.Object;(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)
    Caused by: com.adobe.barcodedforms.decoder.DecodingException null: com.adobe.barcodedforms.decoder.processors.DataProcessorException: com.adobe.barcodedforms.decoder.processors.DataProcessorException
    at com.adobe.livecycle.barcodedforms.BarcodedFormsService.decode(BarcodedFormsService.java:2 97)
    at j

  • Generating document in XML in RM

    Hi,
    I have a function module where I create a document in XML and store it in RM.
    In the code of this funcion module, I first create the empty document using the FM SRM_DOCUMENT_CREATE, and then I add the content to this document with the FM SRM_DOCUMENT_CHECKIN_VIA_TAB.
    This has always worked in a 6.40 release. But now I have this same funcion module in a 6.20 release and it does not work properly. The document is generated correctly, but the content is not properly displayed. It has the spanish special characters (such as 'ñ', '´') replaced with rare characters. For example, instead of displaying "DISEÑO", it displays "DISEñO".
    I have no idea what the problem can be, I guess it has something to do with the codepage. But I can't find the solution.
    I have tried using the function module SCP_TRANSLATE_CHARS, but I don't know if I am using it correctly becuase it makes no change and does not replace the incorrect characters.
    Thanks in advance,
    Nerea.

    why do you want to serialize the document object?
    you might as well serialize the xml file it represents and when or where needed, just parse it and get its document object, which would essentially be the same as the object you are trying to serialize.

  • 'Payload not Serializable' with custom WSDL data types in message-style web service

    I'm implementing a message-style web service which publishes to a JMS Queue.
    I had the web service built and deployed, but noticed that the "sendRequest" message's
    part was of type "xsd:anyType." This is not specific enough for our interface,
    since it is externally facing and needs to describe the object we're expecting
    on the back end.
    So I replaced xsd:anyType with mynamespace:MyType, which is defined as a complex
    type in the same WSDL document.
    My problem is that when I test the web service with the new WSDL (using the client.jar),
    I get a server-side exception from the DestinationSendAdapter.doPost() method.
    The exception reads:
    javax.servlet.ServletException: Payload not Serializable
    at weblogic.soap.server.servlet.DestinationSendAdapter.doPost(DestinationSendAdapter.java:129)
    The domain object ('classic' JavaBean) that it should map to on the server side
    extends a class that implements Serializable, so it should inherit the trait.
    So my questions are:
    1) Did I properly go about trying to restrict the object type that gets sent to
    my Destination?
    2) If no, what is the correct way? If yes, why am I receiving the Payload not
    Serializable error if the domain object implements Serializable?
    Thanks in advance.

    Resolved:
    Apparently this is the right approach, as it boiled down to a classpath issue
    on the client-side. Thanks anyway.

  • Using XMLDOM to process document in XML DB

    I am new to XML and especially XML DB which I however see as an excellent platform on which to base XML based solutions. I have a specific question and apologise beforehand should any of my assumptions be incorrect.
    I wish to create an application which from a number of XML fragments, together with rules governing the behaviour of the fragments (insertion points, overwrite rules etc) are merged together to finally leave me with a complete and valid XML document in XML DB.
    I thought at first that I could use DBMS_XMLDOM to perform this low level processing required. I have however not managed to understand how this can be used together with XMLDB. I am reluctant to use XMLDOM without XMLDB as I am afraid that I will surpass the limits in XML document size apparently imposed by XMLDOM.
    I see a solution where I create a schema based resource in XML DB containing the initial XML structure and then processing any number of the above mentioned fragments to finaly be left with a complete XML document.
    Can I use XMLDOM to do this or am I barking up the wrong tree?
    I would be grateful for any input on techniques that I can apply to perform elementary search/replace/insert on an XML document which I am, from PLSQL, compiling.
    Thanks
    Hans Christiansen

    Hi
    The size of the documents I want to compose are expected vary from a few Kb to 1 or 2 Gb! In a FAQ found somewhere on OTN there was an entry which mentioned that somebody was having trouble with a 50Mb XML document. The recommendation was to use SAX but I am under the impression that this is more useful when the processing is of a more sequential nature.
    The main thread of my question is to gain clarity in the most suitable technique to use when actualy compsing the XML.
    What I want to do is:
    Create resource (XML document) in XML DB.
    Loop through XML fragments together with rules:
    For each fragment process according to rules and insert
    fragment or update existing XML based on fragment contents.
    At the end of the loop the XML document is complete and ready for further processing.
    XMLDOM seems to give me the tools to do this but I am unsure of how to do this and have XMLDOM work directly against the contents in the resource controlled by XML DB (making use of possible indexes and the scalable nature of XMLDB). I get the feeling that if I simply read the XML from XMLDB resource into a DOM document I am still using the memory based representation of the XML until I write the XML back to XMLDB - is this a correct assumption.
    Alternatively is it the functionality offered by XPath, extract(), updatexml() etc. that I should be looking at?
    Does this make my question more understandable?
    Hans

  • The document type does not match any of the given schemas

    Hi,
    I have created an envelope schema.To precisely process inbound envelope documents,in the xml disassembler component i have used the Documentspec and envelopespec properties.
    in the properties i have the the schema name,Assemblyname
    but i have got the error like The document type does not match any of the given schemas.
    I have verified the schemas have deployed properly.
    can you help me on this?

    Hi Sujith,
    As pointed out by Johns lot's of thing can cause this. You have to analyze lot of things, but this kind of error indicates that the message type that you are debatching is not deployed. For Example :
    If you are debatching on Order than Order schema should be deployed in the admin console.
    One more point that you need not to specifiy Documentspec and envelopespec properties until and unless there are multiple schema's of same message type deployed in different assembly. The dissasembler component will automaticaly disassemble the messages
    just looking after the body XPATH.
    Regards,
    Rahul Madaan

  • TS4009 The document "Name" could not be opened. (Numbers file @ iCloud)

    I have a file saved at iCloud that can not be opened anymore.
    Numbers says: The document “Name” could not be opened.

    I've solved my problem by following instructions here:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=308&mforum=iworktips ntrick
    Step-by-step:
    1. renamed .numbers-tef file to .pdf;
    2. control cliked - then - Show Package Contents
    3. double clicked index.xml.gz - index.xml has been created!
    4. renamed back .pdf to .numbers
    5. double cliked file and Bingo! Numbers opened the file.

  • A Pages file will not open due to index.xml not found, what is up with that?

    I recently saved a file on Pages 5.5.2. on my IMac hard drive.  Now I find that on attempting to open it the file will not open due to index.xml not found.  Hoe do I correct this?

    I have this issue, as well - although perhaps in a different content.  When I try to open a file I created in the previous version of Pages, I will frequently (but not always), received the "index.xml not found" message.  I am very concerned that I may lose access to some of these files.  The old Pages icon is still on my dashboard, although I've downloaded the new Pages (that icon only appears when I open a new document).  I thought I needed to upgrade the old documents to the new Pages, but this didn't work.  Does anyone have any ideas?  And, I'm not a techie - so you'll need to break it down for me. 

  • XML Document from XML Schema Bug

    When an XML document is generated from an XML Schema the XML document does not have all the elements specified in the XML Schema. The XML document only has the root element.
    1. Register an XML Schema.
    2. Create an XML document with File>New>General>XML>XML Document from XML Schema. The "Generate only Required Elements" is unchecked.
    3. The XML document has only the root element.
    In JDeveloper 10.1.3 all the elements in the XML Schema get generated.

    Also, the component palette for the XML document generated from the XML Schema does not list all the elements in the XML Schema, only the root element is listed. Even if elements are specified as required in the XML Schema with minOccurs="1" and the "Generate only Required Elements" checkbox is selected only the root element gets generated.

  • ALC-DSC-005-000: Not Serializable

    What does the message "ALC-DSC-005-000: Not Serializable" mean? I am trying the simple "Sending an email with an attachment" walkthrough in the training manual and I receive this error when trying to invoke the process.
    Does this mean that a configuration setting in the "Read Document" operation or the "Send With Document" operation is in error?

    You can check the step, in which you get the error, from adminui under
    Services > Process Management > Stalled Operation Errors.
    You are probably not setting a variable, typed document, as input/output.
    Oguz
    http://www.kgc.com.tr

  • Payload not Serializable

    Hi everyone,
    I have implemented an asynchronous web service based on a MDB EJB. Here is the part of the web-services.xml that describes this web service :
    <web-service name="MOCBean" targetNamespace="moc" uri="/MOCBean">
    <components>
    <jms-send-destination name="mocqueue" connection-factory="weblogic.jms.ConnectionFactory">
    <jndi-name path="jms/MOCJMSQueue"/>
    </jms-send-destination>
    </components>
    <operations>
    <operation invocation-style="one-way" name="getCourbesCharge" component="mocqueue">
    <params>
    <param name="listeSites" class-name="java.lang.String" style="in" type="xsd:string"/>
    </params>
    </operation>
    </operations>
    </web-service>
    When I call getCourbesCharge through generated classes, I get this error :
    java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: Exception during processing: javax.xml.rpc.JAXRPCException: Payload not Serializable. Java type is null
    I don't understand since there is an input parameter named listeSites of type String and no return parameter... Do you know what's happening ?
    Thanks in advance,
    Mark

    Well, I think I have identified the problem. When I create asynchronous web services and I pass the operation parameters which names are different from "string", "string0", "string1", etc, then "null" is unstacked from the SOAP message. I have to put the default names as parameters names to make it working... Though, it isn't necessary on synchronous web services. I think it's a Weblogic bug in client stub generation.
    Mark

  • Exporting web analysis document in .xml format

    Can anyone please let me how to export the web analysis document in .xml format

    Hi,
    I think you can only export WA documents/presentations in apt, ard or *arg files, not in XML.
    Kind regards
    André

  • Ignoring ApplicationStructure.xml; not on sourcepath

    I'm experimenting with the 'Building J2EE Applications with Oracle JHeadstart for ADF tutorial'. When I try and to build and deploy I get a couple of compile errors:
    ignoring C:\MyDemo\ViewController\properties\DomainDefinitions.xml; not on sourcepath
    ignoring C:\MyDemo\ViewController\properties\ApplicationStructure.xml; not on sourcepath
    I tried removing ApplicationStructure.xml and re-adding it but no joy. Any suggestions?

    It seems to me you are addressing several unrelated problems at the same time. For starters, the warnings about the Application Structure File not being on the source path and therefore being ignored is no 'error'. It means literally what it says. This file is 'metadata' for our generator but is not needed at runtime. Therefore we did not put it in the source path or HTML root of your application. The warning you get is just JDeveloper telling you that, although this file is included the project and (I guess being an xml file) would have been candidate to be deployed, but since it's not on the source path it will ignore it. Which is fine, so this warning should not be problem'.
    Then, you mention not being able to deploy your application on a 9.0.4.0.0 application server. Maybe this post on Steve Muench's Blog will help you:
    http://radio.weblogs.com/0118231/2005/05/20.html#a552
    as well as this document on a known ADF/iAS compatibility issue:
    http://radio.weblogs.com/0118231/stories/2005/05/27/workaroundForDeployingAdf1012AppUsingIntermediaDomainsToOracleAs904.html
    Kind regards,
    Peter Ebell
    JHeadstart Team

  • GetResource is called when document root is not set

    hi,
    During redeploy of a small application i get the following error
    [runjava] <Oct 17, 2005 12:40:26 AM PDT> <Alert> <HTTP> <BEA-101043> <[ServletContext(id=616697,name=rsbservice,context-pat
    h=/rsbservice)] getResource is called when document root is not set.>
    [runjava] <Oct 17, 2005 12:40:26 AM PDT> <Alert> <HTTP> <BEA-101043> <[ServletContext(id=616697,name=rsbservice,context-pat
    h=/rsbservice)] getResource is called when document root is not set.>
    Can someone help me find what would have gone wrong in my application?
    NOTE: this error does not occur when i try to start my application for the first time.

    You must always give the browser an either an absolute URL from the top of
              the web server (not the
              web application) or a relative path from the current page.
              Sam
              "Vijay Kumar" <[email protected]> wrote in message
              news:[email protected]..
              > Hi
              >
              > I get the 'getResource is called when document root is not set.' error
              > when I access any files in the webapp with their absolute path.
              >
              > Environment: WIN/NT SP3, WL5.1 SP5 as the webserver and app server.
              >
              > My webapp located in d:\temp is deployed as foo
              > weblogic.httpd.webApp.foo=d:/temp
              >
              > For example:
              > I can access a file in d:\temp\secured\home.html using
              > test
              >
              > However if with in an html I try to access the file using the abs path
              > from doc root
              > test I get an error
              >
              > and I guess the default servlet looks for the servlet-context named
              > 'secured'
              >
              > Can someone tell me if I can set the documentRoot in the web.xml or
              > weblogic.xml
              > file OR if there is any other way to access to the file using the abs path
              > of /secured/test/test.html
              >
              >
              > Thanks in advance
              >
              > Vijay
              >
              >
              >
              >
              

Maybe you are looking for