Org.apache.xml.serialize.XMLSerializer

Hi,
I am using Eclipse for Weblogic 10.3.4 (OEPE1111). I imported a j2ee project. It doesn't include xercesImpl jar. Where should I add them in? On the Java Build Path screen, there are so many options. Thanks!

I added. But I got Classpath Dependency Validator Message warning. Is it normal? I just ignore those?
I have log4j for every projects. Do I have to add it for each? Is there an easier way to do?
Thanks!

Similar Messages

  • Help on jar file for org.apache.xml.serialize.OutputFormat

    Hi all, I need help regarding on org.apache.xml.serialize.OutputFormat
    and org.apache.xml.serialize.XMLSerializer. May I know which jar files
    contain these? Thanks

    After installing jdk 1.5 the problem is now resolved and after prefexing a few of the import statements with com.sun.
    There are however some more classes as part of the Xerces 2.7.1 jar file as compared to the JWSDP 1.6 installed and this requires the xercesimpl.jar to be included in the classpath.
    Rgds,
    Seetesh

  • Import org.apache.xml.serialize.*;

    .java:66: package org.apache.xml.serialize does not exist
    import org.apache.xml.serialize.*;
    ^
    i am getting this error while running a java program, which i downloaded from a open source.
    i am using J Creator.
    i suppose i need to add a class path or package.
    can anybody tell me how to do this.
    and where can i find that package.
    if i can't find that in my system, where can i get it on net.

    .java:66: package org.apache.xml.serialize does notThe org.apache.xml.serialize.* package is part of Xerces:
    http://xml.apache.org/xerces-j/
    http://xml.apache.org/xerces2-j/index.html

  • Where to download java jar file with org.apache.xml.serialize.OutputFormat?

    Dear Friends,
    I try one program, it import org.apache.xml.serialize.OutputFormat;
    but I cannot fine it after I google a while.
    where can I find and download jar file that contain this:
    org.apache.xml.serialize.OutputFormat
    I use JDK1.6
    Thanks
    sunny

    So, to clear things up, there is no org.apache.xml.serialize.OutputFormat.JAR
    OutputFormat is a class.
    As I said in my previous post if you go at the xerces project home page (here) you will find a compiled version of xerces [here - direct link -> (fool proof)|http://archive.apache.org/dist/xml/xerces-j/Xerces-J-bin.1.4.4.zip]. If you extract the archive you will find a compiled jar called xerces.jar. Open that one with winrar/winzip or whatever, browse to org\apache\xml\serialize\OutputFormat.class and there you go, you have it, just link this xerces library to your project...
    PS. Try searching on Google for "Google tutorial"

  • Which jar file has the org.apache.xml.serialize.*

    classes ?

    found here
    C:\bea\jrockit81sp1_141_03\console\lib\xercesImpl.jar
    and
    also C:\bea\weblogic81\workshop\lib\xerces.jar

  • Xml/serialize/XMLSerializer error in weblogic 7.0 SP6 app

    I am using weblogic 7.0sp6 and solaris 9
    We recently migrated app to another physical server but the same weblogic version.
    Once the application is deployed when we try to access that application it give us an exception.....
    java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer
    The same code/app is running successfull on the old server (solaris 9 and weblogic 7.0sp6)
    I compared the weblogic "lib" folder on both the servers and they looks identical...
    Any thoughts on why this is happening?

    We faced with the similar issue in WLS 7.X after below Assertion error after restoring services we were able to resolve this issue for time being as per the weblogic there is a patch provided by BEA and this sort of issue is resolved.
    This issue has been identified and updated under cars CR103525
    Regards,
    CSR
    BEA Analyst

  • Org.apache.xml

    Hi Guys,
    I'm getting the following error message when I create JAR file of my application and run:
    Caused by: java.lang.ClassNotFoundException: org.apache.xml.serializer.TreeWalkerIf I execute my program from Eclipse then no error shows up. But if I create a JAR and try to run it, only then I get this error. I guess I am missing an external jar for xml. If I'm right, could you guys tell me which jar I will need and where can I find it.
    Thanks in advance.

    Hi all,
    Thanks for all of your cooperation... I think I should let you guys know about my experience(tedious !?!) so that people will be aware of this kind of error from now on....
    Here's what I found...
    The problem was not about apache jar.. The problem was with the xsl files; while I was in Eclipse environment and ran my program it easily finds all my xsl files... I was accessing those xsl file by
    Source xsltSource = new StreamSource(this.class.getResource(factorXslFileLocation).getPath()); no trouble so far....
    BUT when I packaged it as a JAR and run it... it always complain about all kind of different xml/xsltc/xalan jars..
    Then I downloaded all possible jars and added with my manifest file(xalan.jar, xercesImpl.jar, xsltc.jar,serializer.jar). Still didn't work.
    Finally I tried with the following way to access my xsl files and it worked( I had to remove all external jars from manifest file...)
    Source xsltSource = new StreamSource(this.getClass().getResourceAsStream(factorXslFileLocation)); If any one is using jre1.5 or above, then no need to add external jars for any xml or xsl stuff. I found so far what I needed is already built in there.

  • Xslt conversion not working: nosuchmethoderror:org.apache.xml.dtm.ref.sax2d

    hi all, iam trying to convert xml file to html using xslt.
    for that iam using xalan implementation 2.6. this was working fine when i checked it from the application, no iam using servet which instantiates a object of the class and calls the method...and it not working now.
    it is giving this errror
    java.lang.NoSuchMethodError: org.apache.xml.dtm.ref.sax2dtm.SAX2DTM.(Lorg/apache/xml/dtm/DTMManager;Ljavax/xml/transform/Source;ILorg/apache/xml/dtm/DTMWSFilter;Lorg/apache/xml/utils/XMLStringFactory;ZIZZ)V
         at org.apache.xml.dtm.ref.sax2dtm.SAX2DTM2.(SAX2DTM2.java:1901)
         at org.apache.xalan.xsltc.dom.SAXImpl.(SAXImpl.java:767)
         at org.apache.xalan.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:390)
         at org.apache.xalan.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:267)
         at org.apache.xalan.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:477)
         at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:637)
         at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:317)
    ...can anyone tell me what the problem is? iam setting the system property at runtime like,
    java -Djavax.xml.transformer.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl GetTestiam using the standard way of instantiating the trnaformer like
    TransformerFacotry fac= transformerFactory.newinstance() etc.etc.
    is it beaucse iam not specifiying the imlementation in the application???if so how can i do that.
    thankyou.

    found the answer !!!
    i was using a buggy implementation of xalan. on loading the good xalan.jar and xercesImpl.jar files it started working.
    found that there was a memory leak in 2 places. not sure what that meant but some how the virtual machine wasnt getting the right values for the transformer.
    cheers.

  • Character reference in Apache xml serializer

    Hi,
    I am having some issues with XML serializer while having control characters in the String.
    The control characters are getting converted to character reference in apache XML serializer.
    Could anyone help me to disable the control characters getting converted to character reference?
    or Do we have anyway to suprees/remove these control characters?
    Could anyone please help us on this issue?
    Thanks a lot!!!
    Rajkumar R.

    Since this is an apache product I suggest you look at the apache documentation on the apache web site or have a look at the apache forums.
    You shouldn't need to worry about control characters being converted because the reader should convert them back again. If it doesn't it is probably a bug on the readers side.

  • Deploying war in Weblogic 10 ; NoClassDefFoundError: org/apache/xml/utils/D

    How do I set a jar in setDomainEnv.cmd ? C:\mydirectory\repository\xalan\jars\xalan-2.7.0.jar
    If I set this one, will it resolve?
    <27-Nov-2012 6:08:26 o'clock PM PST> <Notice> <Log Management> <BEA-170019> <The server log file C:\bea10\user_projects\domains\mediation_te
    st\servers\MediationServer\logs\MediationServer.log is opened. All server side log events will be written to this file.>
    <27-Nov-2012 6:08:29 o'clock PM PST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
    <27-Nov-2012 6:08:31 o'clock PM PST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
    <27-Nov-2012 6:08:31 o'clock PM PST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <27-Nov-2012 6:08:34 o'clock PM PST> <Error> <HTTP> <BEA-101216> <Servlet: "action" failed to preload on startup in Web application: "tel-reference_ods-usage-web.war".
    java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    Truncated. see log file for complete stacktrace
    Caused By: org.apache.commons.logging.LogConfigurationException: java.lang.NoClassDefFoundError: org/apache/xml/utils/DefaultErrorHandler (Caused by java.lang.NoClassDefFoundError: org/apache/xml/utils/DefaultErrorHandler)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
    at org.apache.struts.action.ActionServlet.<clinit>(ActionServlet.java:228)
    Truncated. see log file for complete stacktrace
    Caused By: java.lang.NoClassDefFoundError: org/apache/xml/utils/DefaultErrorHandler
    at com.tel.framework.config.PropertyNodeTypedXmlParser.parse(PropertyNodeTypedXmlParser.java:106)
    at com.tel.framework.config.PropertyNodeTypedXmlParser.parse(PropertyNodeTypedXmlParser.java:71)
    at com.tel.framework.config.file.FileXmlProvider.loadConfigurationComponent(FileXmlProvider.java:105)
    at com.tes.framework.config.ConfigProvider.loadConfiguration(ConfigProvider.java:120)
    at com.te.framework.config.ConfigContext.init(ConfigContext.java:176)
    Truncated. see log file for complete stacktrace
    Caused By: java.lang.ClassNotFoundException: org.apache.xml.utils.DefaultErrorHandler
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:280)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:253)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Truncated. see log file for complete stacktrace
    >
    <27-Nov-2012 6:08:34 o'clock PM PST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application 'tel-reference_ods-usage-web'.
    weblogic.application.ModuleException: [HTTP:101216]Servlet: "action" failed to preload on startup in Web application: "tel-reference_ods-usage-web.war".
    java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at weblogic.servlet.internal.WebComponentContributor.getNewInstance(WebComponentContributor.java:225)
    at weblogic.servlet.internal.WebComponentContributor.createServletInstance(WebComponentContributor.java:249)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:255)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
    at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1976)
    at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1950)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1869)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3126)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1512)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
    at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)

    how do I SET classpath in setDomainEnv.cmd ? there are many types of classpaths.
    1.PRE_CLASSPATH
    POST_CLASSPATH
    EXT_PRE_CLASSPATH
    EXT_POST_CLASSPATH
    WLP_POST_CLASSPATH
    POST_CLASSPATH
    WEBLOGIC_CLASSPATH
    I used PRE_CLASSPATH for my case, first path worked, but second does not seem to work.
    set PRE_CLASSPATH=C:\myprojects\t91_rds_10_u_dev\vobs\rds_src\rds\ts-refe_ds-us-web\conf\conf-env\dv\;C:\mydirectory\repository\xalan\jars\ xalan-2.7.0.jar;
    How do I add class path to the first one? if i separate by ; will it work?
    If I want to add appCtx.properties C:\myprojects\t91_rds_10_u_dev\vobs\rds_src\rds\ts-refe_ds-us-web\conf\conf-app\appCtx.properties .
    Thanks

  • Build failed due to - org/apache/xml/dtm/ObjectFactory$ConfigurationError

    Hi,
    Webcenter spaces deployment fails with the following error:
    BUILD FAILED
    weblogic.Deployer$DeployerException: weblogic.deploy.api.tools.deployer.DeployerException: Task 7 failed: [Deployer:149026]redeploy application webcenter on WLS_Spaces.
    Target state: redeploy failed on Server WLS_Spaces
    java.lang.NoClassDefFoundError: org/apache/xml/dtm/ObjectFactory$ConfigurationError
    I am using JDev 11.1.1.3.0 with webcenter extension. Does any other extension is required to rectify this ?
    Thanks & Regards.

    I'v placed the xsltc.jar into the location specified C:\Oracle\Middleware\jdeveloper\ant\lib
    But still it is not working and I am getting this error , don't know why. I am using Jdeveloper 11g 11.1.1.3.0.
    I am trying to build the extend webcenter spaces sample from Oracle.com website
    The stack trace is like ....
    BUILD FAILED
    weblogic.Deployer$DeployerException: weblogic.deploy.api.tools.deployer.DeployerException: Task 58 failed: [Deployer:149026]redeploy application webcenter on WLS_Spaces.
    Target state: redeploy failed on Server WLS_Spaces
    java.lang.NoClassDefFoundError: org/apache/xml/dtm/ObjectFactory$ConfigurationError
         at weblogic.Deployer.run(Deployer.java:72)
         at weblogic.Deployer.mainWithExceptions(Deployer.java:62)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.ant.taskdefs.management.WLDeploy.invokeMain(WLDeploy.java:419)
         at weblogic.ant.taskdefs.management.WLDeploy.execute(WLDeploy.java:349)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
         at org.apache.tools.ant.Task.perform(Task.java:348)
         at org.apache.tools.ant.Target.execute(Target.java:357)
         at org.apache.tools.ant.Target.performTasks(Target.java:385)
         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
         at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
         at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
         at org.apache.tools.ant.Main.runBuild(Main.java:758)
         at org.apache.tools.ant.Main.startAnt(Main.java:217)
         at org.apache.tools.ant.Main.start(Main.java:179)
         at org.apache.tools.ant.Main.main(Main.java:268)
    Caused by: weblogic.deploy.api.tools.deployer.DeployerException: Task 58 failed: [Deployer:149026]redeploy application webcenter on WLS_Spaces.
    Target state: redeploy failed on Server WLS_Spaces
    java.lang.NoClassDefFoundError: org/apache/xml/dtm/ObjectFactory$ConfigurationError
         at weblogic.deploy.api.tools.deployer.Jsr88Operation.report(Jsr88Operation.java:542)
         at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:140)
         at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
         at weblogic.utils.compiler.Tool.run(Tool.java:158)
         at weblogic.utils.compiler.Tool.run(Tool.java:115)
         at weblogic.Deployer.run(Deployer.java:70)
         ... 23 more
    Total time: 25 seconds

  • XML Serializer....!

    Hi guys...!
    I'm writting a program in Java that prints out the content of an XML file. I imported different classes, but some of the class that I imported do not work. I don't know why.
    Since some of the classes do not work, I can't compile my java program.
    Here are the classes that give me error....
    import org.apache.xml.serialize; .============> ERROR
    import org.apache.xml.serialize.OutputFormat; ===========> ERROR
    import org.apache.xml.serialize.Serializer; ===============>ERROR
    import org.apache.xml.serialize.DOMSerializer; ===========>ERROR
    import org.apache.xml.serialize.SerializerFactory; =========>ERROR
    import org.apache.xml.serialize.XMLSerializer; ===========>ERROR
    and here are the codes that don't compile within my java program..
    OutputFormat format = new OutputFormat (doc); ==========>ERROR
    StringWriter stringOut = new StringWriter ();
    XMLSerializer serial = new XMLSerializer (stringOut, format); ==>ERROR
    serial.serialize(doc);
    System.out.println(stringOut.toString());
    Can you guys please help me finding out what is going on in my codes????
    Any help will be appreciated...
    Thanks...
    --- Spirit_Away

    While this problem is simple to someone who's battled classpath problems many, many times, it's frustrating as hell to those who haven't.
    You have a run time classpath and a compile time classpath.
    A compile-time classpath is used by javac or your IDE to find the classes that you're referencing when your code is compiled.
    If you compile a simple class from the command-line with javac, you'd use the -classpath option to specify to the Java compiler where it needs to look to find the classes you've referenced in your class.
    If you use an IDE, you need to tell your IDE where to find the classes you're referencing in your class -- each IDE does this slightly differently. In Eclipse, it's referred to as your "build path" and it contains either folders of classes or JAR files. As you add JARs or folders of classes to your build path, you make those classes available at compile time to your classes that you're compiling.
    If you manage to include those properly, you'll end up with YourClass.class -- a compiled version of your class.
    Now, to invoke your class, you need to make sure that the same classes/JARs that you put in your build path are also available to the Java Virtual Machine when you execute your class -- this is done through the CLI with the -classpath option to the java command.
    There are a few ways to get those classes in your runtime classpath.
    You can:
    a) set an environment variable called CLASSPATH which includes the JARs/class folders so that every time the jvm is invoked (e.g. prompt$ java MyClass ) those classes are included in the runtime classpath
    b) throw all of your dependent JARs/classes into $JAVA_HOME/jre/lib/ext so that anytime anyone on that machine executes the JVM, those dependent classes are included in the system-wide classpath
    c) include the JARs/class folders in the classpath argument when invoking the JVM (e.g. prompt$ java -classpath=".:HelperClasses.jar" MyClass )
    Personally, I find a) and b) to be bad ideas. Especially if you build Java apps to distribute. It makes it far too easy to forget to include dependent JARs and classes, because while they work for you on your system, they won't work on another system, unless that system also has the dependent JARs/classes installed properly in the classpath -- either for that system or the executing user.
    Another drawback is that by silently including classes in your runtime classpath, you can unknowingly create class conflicts as you can end up accidentally loading multiple copies of the same class -- sometimes different versions -- and you don't realize that the one you THINK is executing is actually not the one that ACTUALLY is.
    For this reason, I strongly suggest keeping your system class path and CLASSPATH variables empty and using option C -- until you have a strong handle on how classpaths work.
    Some people will throw all of their dependent classes/jar files into $JAVA_HOME/jre/lib/ext to avoid having to add them to their runtime classpath.
    In your case, you'd need to include the JAR files as options to the -classpath argument when you invoke the JVM.

  • XML serializer problem

    I am trying to use an XML serializer to get an XML file place in an exist database and store it to the hard drive as an XML file.
    my code in order to do that is
    XMLResource documentbef = (XMLResource)r;
    doc2=(Document) documentbef.getContentAsDOM();
    doc2.normalize();
    OutputFormat format = new OutputFormat(doc2);
    format.setIndenting(true);
    XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File("C:\\Configuration\\XmlRoomCopy.xml")), format);
    serializer.serialize(doc2); i have included the needed jar files, and did the imports. but i get the following errors
    symbol  : constructor OutputFormat(org.w3c.dom.Document)
    location: class org.apache.xerces.domx.XGrammarWriter.OutputFormatand
    symbol  : method setIndenting(boolean)
    location: class org.apache.xerces.domx.XGrammarWriter.OutputFormat
    format.setIndenting(true);
    symbol  : constructor XMLSerializer(java.io.FileOutputStream,org.apache.xerces.domx.XGrammarWriter.OutputFormat)
    location: class org.apache.xml.serialize.XMLSerializer
    XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File("C:\\Configuration\\XmlRoomCopy.xml")), format);i'm new at this so I could have done the dumbest mistake.
    thank you

    Hi.
    Check this:
    drop type msm force;
    drop type list_msm force;
    create type msm as object(
    nume VARchar2(20)     --VARCHAR2 NOT CHAR
    create type list_msm as table of msm;
    create table produse
    den char(20)
    INSERT INTO produse VALUES('Prod.1');
    INSERT INTO produse VALUES('Prod.2');
    INSERT INTO produse VALUES('Prod.3');
    COMMIT;
    select xmlserialize (document xmlelement("values",
    cast(multiset(
    select trim(p.den) from produse p) as list_msm
    ) as clob indent size=2
    ) as "xml"
    from dual;
    <values>
      <LIST_MSM>
        <MSM>
          <NUME>Prod.1</NUME>
        </MSM>
        <MSM>
          <NUME>Prod.2</NUME>
        </MSM>
        <MSM>
          <NUME>Prod.3</NUME>
        </MSM>
      </LIST_MSM>
    </values>Hope this helps.

  • Getting xml serializer exception

    dont know what this mean, did anybody got this exception before.
    Searched on google but got few results only which were not helpful.
    Frustrated posting this here . if anybody has seen this and resolved this , give me tips on how to get this working or atleast what could be cause of this problem.
    java.lang.NullPointerException
    at org.apache.xml.serialize.OutputFormat.whichMethod(Unknown Source)
    at org.apache.xml.serialize.OutputFormat.<init>(Unknown Source)
    at com.tibco.portalservices.administrator.AbstractDOMDeploymentDescriptorEditor.update(AbstractDOMDeploymentDesc
    riptorEditor.java:125)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.administrator.consoles.deploymentconfiguration.ServiceDetailPane.update(ServiceDetailPane.java:94)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.wfc.AbstractFrame.update(AbstractFrame.java:101)
    at com.tibco.wfc.FramesetComponent.update(FramesetComponent.java:186)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.wfc.AbstractFrame.update(AbstractFrame.java:101)
    at com.tibco.wfc.FrameManager.a(FrameManager.java:235)
    at com.tibco.wfc.FrameManager.service(FrameManager.java:142)
    at com.tibco.administrator.AdministratorServlet.service(AdministratorServlet.java:843)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
    at java.lang.Thread.run(Thread.java:595)

    There is no HashMap in your ArrayList. Take a look at this line:
    selectedDataList.add(searchList);I think a object f type SearchBean is added to the list here. This is no HashMap I presume.
    Please use code tags when posting code. This looks lke this:
    public String getSelectedItems() {
    // Get selected items.
    HashMap map = new HashMap();
    DeleteContentDialog deleteContentDialog = new DeleteContentDialog();
    selectedDataList = new ArrayList();
    for (SearchBean searchList : searchResultdetails) {
    System.out.println("Inside getSelectedItems.........Inside for"+searchList);
    if (searchList.isSelected()) {
    System.out.println("Inside getSelectedItems........searchList."+searchList);
    selectedDataList.add(searchList);
    searchList.setSelected(false); // Reset.
    try {
    for(int i=0;i<selectedDataList.size();i++){
    System.out.println("Inside the delete Method");
    System.out.println("selectedDataList is "+selectedDataList.get(i));
    if (selectedDataList.size() != 0)
    System.out.println("Array List is having = "selectedDataList.size()" records");
    //printValuesTest(medianList);
    System.out.println("**************THESE ARE THE VALUES OF THE HASHMAP AT THE INDEX = "+i);
    map = (HashMap)selectedDataList.get(i);
    if (map.size() != 0)
    Iterator iterator = map.keySet().iterator();
    while (iterator.hasNext())
    String key = (String) iterator.next();
    String value = (String) map.get(key);
    System.out.println("Key = "key " and Value = "+value);
    deleteContentDialog.init(map);
    else
    System.out.println("Hashmap is empty");
    catch(Exception e){
    e.printStackTrace();
    return "deletedFile"; // Navigation case.
    }

  • How to Improve XML Serializer Performance?

    I am writing a test program to generate an large XML data and then seralize this large XML document by SAX.
    The document structure is like this:
    <a>
    <b> 1M data </b>
    <b> 1M data </b>
    <b> 1M data </b>
    </a>
    I tried to use org.apache.xml.serialize.Serializer for the output, (using Seralizer.asContentHandler()) but found that it is very slow (it took several minutes to write out the whole document), mainly because of the characters() method designed in it.
    Any one here has any experience of using other APIs to serializer or write out of XML document? Or other ways to improve its performance?
    Or any one knows how to use xalan's Seralizer.asContentHandler() for document serialization?
    Thanks!

    The only thing I can suggest is that you direct the serializer's output to something that is buffered.

Maybe you are looking for