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.

Similar Messages

  • 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"

  • 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.

  • 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

  • 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

  • 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

  • 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!

  • 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

  • Org.apache.xalan.transformer.TransformerImpl

    I have an ecr.index servlet which is run on Tomcat, here is the part of it's code:
               javax.xml.transform.sax.SAXTransformerFactory factory = ( javax.xml.transform.sax.SAXTransformerFactory ) javax.xml.transform.TransformerFactory.newInstance();
               Source ss = new StreamSource( new FileInputStream( context.getRealPath( xsl_file ) ) );
               ss.setSystemId( context.getRealPath( xsl_file ) );
               javax.xml.transform.sax.TransformerHandler handler = factory.newTransformerHandler( ss );
           131:handler.setResult( new StreamResult( response.getOutputStream() ) );When I access the page the exception is thrown:
    org.apache.xml.utils.WrappedRuntimeException: The output format must have a '{http://xml.apache.org/xalan}content-handler' property!
         at org.apache.xalan.serialize.SerializerFactory.getSerializer(SerializerFactory.java:142)
         at org.apache.xalan.transformer.TransformerImpl.createResultContentHandler(TransformerImpl.java:1048)
         at org.apache.xalan.transformer.TransformerImpl.createResultContentHandler(TransformerImpl.java:975)
         at org.apache.xalan.transformer.TransformerHandlerImpl.setResult(TransformerHandlerImpl.java:209)
         at ecr.index.service(index.java:131)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
         at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:339)
         at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:415)
         at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:716)
         at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:650)
         at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:829)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
         at java.lang.Thread.run(Thread.java:534)But I don't use org.apache.xalan.transformer.TransformerImpl, even the package org.apache.xalan.transformer isn't imported, but this package is present in classpath, where is the error?

    Here is the reason for this problem....
    JDK 1.4 comes with a version of Xalan...
    Somewhere around 1.4.2_03 the Xalan version that shipped with the JDK was upgraded because the XSLT spec was completed/revised or something like that.. When this happend the namespace identifier for xalan custom 'tags' changed. The content-handler tag used to be in the xslt name space.. now it is in the xalan namespace.
    Problem is many stylesheets don't specifically set the output format so the defaults are used and the values are initialized from a properties file. However.... and this is where the problems comes in...
    The Namespaces are used as prefixes to the keys in the file... AND... Tomcat''s WebappClassLoader is not safe about ensuring that a resource is loaded from the same Jar file as the classes that use it....
    So what is happening is... the Xalan from your JVM is being used... but it is loading the formatting properties from a Xalan that is included in your Webapp.... which of course don't match....
    All you need to do is remove the xalanXXX.jar from WEB-INF/lib and this problem will go away...
    Matt Brozowski
    The OpenNMS Group, Inc...

  • Use XML Digital Signature(Apache XML security) with Applet

    I have problem when I use xml-security-1_2_1 library from Apache with applet and access denied errors occur.
    6 May 2005 10:06:45 org.apache.xml.security.Init init
    SEVERE: Bad:
    java.security.AccessControlException: access denied (java.util.PropertyPermission org.apache.xml.security.resource.config read)
    bla bla....
    How should I do ? Please! T_T and thank you ..

    An applet cannot read the local file system, connect to any other computer than the one
    it came from or read properties it's not supposed to read. And I think it cannot write to any
    property.
    If you sign the applet or set up a policy for it the applet can do the same as an application
    allthough the jre will still check the stack trace if the entire stack has the same privileges
    as you signed applet.
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and last post for the java class file

  • Extracting elements from an xml string - org.apache.xerces.dom.DeferredText

    Hello all,
    I am new to xml, and I thought I had a handle on things until I got this problem...I am getting an xml string from the body of an e-mail message, and then I am trying to extract elements out of it. Here is an example xml string:
    <?xml version="1.0" encoding="UTF-8"?>
    <filterRoot>
       <filter action="MOVE" bool="AND" name="My Saved Filter" target="Deleted Items">
          <condition attribute="TO" bool="AND" contains="CONTAINS">
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
          </condition>
       </filter>
    </filterRoot>I am trying to extract the <filter> element out and store it into a Vector of Elements (called, not surprisingly, filters). However, I am getting a class cast exception:
    java.lang.ClassCastException: org.apache.xerces.dom.DeferredTextImplIt is being called from where I trying to extract the <filter> in this way:
            filterRoot = doc.getDocumentElement(); // get topmost element
            NodeList list = filterRoot.getChildNodes();
            Vector newFilters = new Vector();
            debug("There are "+list.getLength()+" filters in document");
            for(int i=0; i<list.getLength(); i++) {
                Node n = list.item(i);
                debug("Node "+i+" getNodeValue() is "+n.getNodeValue());
                Element temp = (Element)n;
                newFilters.add(temp);
            }Perhaps my question is, how do I correctly get hold of the <filter> node so that I may cast it as an Element?
    thanks,
    Riz

    Yes, I already knew that it is not a bug.
    But, I got next step problem.
    I put "false" to "include-ignorable-whitespace" feature in xerces parser.
    But, I still found unnecessary TextNodes in my parser object.
    Feature link : http://xerces.apache.org/xerces-j/features.html.
    I use xerces-2_8_0.
    DOMParser parser = new DOMParser();
    parser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whitespace", false);
    parser.parse(inputSource);
    document = ps.getDocument();
    System.out.println(document.getDocumentElement().getChildNodes().length()); // still wrong lengthIs tehre any example of usage this feature?
    What is default defination of white-space "\n "(enter with one space) or " "(juz white space) or something else?
    Thanks,

  • Error msg "package org.apache.xmlrpc does not exist ... "

    Hi everybody,
    I am new to java. While creating build through cruise control Error Msg comes
    BUILD FAILED
    Ant Error Message:      C:\Program Files\CruiseControl\projects\Myproject\build.xml:47: Compile failed; see the compiler error output for details.
    C:\Program Files\CruiseControl\projects\Myproject\src\org\xtpl\admin\common\CallBack.java:9: package org.apache.xmlrpc does not exist
    import org.apache.xmlrpc.*;
    C:\Program Files\CruiseControl\projects\Myproject\src\org\xtpl\admin\common\CallBack.java:18: cannot find symbol
    symbol : class XmlRpcClient
    location: class org.xtpl.admin.common.CallBack
    XmlRpcClient rpcClient = new XmlRpcClient();
    Can anyone help me out!
    Thanks,
    Sunil Braroo

    check your classpath.

  • Org/apache/log4j/Category on OAS 10.1.3 and Jdev 10.1.3.5

    Hi,
    I am new to ADF and my company is also new to ADF. We are doing how it coudl help us in acclerating the development of custom screens on top of OTM 5.5
    I am using OAS 10.1.3. I am getting org/apache/log4j/Category error at the time of deployment causing road block. Plz help...
    Below are the steps I followed
    1. Stopped OAS
    2. Install ADF Installer 10.1.3.5 by extracting files, changing adfinstaller.properties, and running java -jar runinstaller.jar adfinstaller.properties
    3. Started OAS
    4. OAS never started up as server.xml had an new entry
         <application name="datatags" path="../../../BC4J/redist/datatags.ear" start="true" />
         <import-shared-library name="oracle.ws.jaxrpc"/>
    5. datatags directory was malformed in the sense META-INF/application.xml and other .xml file was not created at all.
    6. Since ADF requires only libraries to be available, I removed this 2 enteries and started up the OAS.
    7. Started the OAS
    8. Copied files from
    [$Jdeveloper Home]\jakarta-taglibs
    to
    [$OC4J Home]\BC4J\lib
    the files are:
    commons-digester.jar
    commons-logging.jar
    commons-collections.jar
    9. Download and copy apache-log4j-1.2.15 (log4j-1.2.15.jar) to [$OC4J Home]\BC4J\lib
    10. I created a simpel ADF Helloworld page.
    11.Created a deployment discriptor orion-application and added the following enteries
    <imported-shared-libraries>
    <remove-inherited name="apache.commons.logging"></remove-inherited>
    </imported-shared-libraries>
    12. I right clicked on my UserInterface ->New-> Deployment profile -> Created a WAR file
    13. Right click the WAR file and deployed to the OAS
    14. I got the following deployment error
    Wrote EAR file to C:\shobz\SOFTWARES\otm_jdev_10G\jdev\mywork\TestADF\UserInterface\deploy\webapp1.ear
    Uploading file webapp1.ear ...
    Uploading file webapp1.ear ...
    Uploading file webapp1.ear ...
    Uploading file webapp1.ear ...
    Uploading file webapp1.ear ...
    Uploading file webapp1.ear ...
    Uploading file webapp1.ear ...
    Uploading file webapp1.ear ...
    Application Deployer for webapp1 STARTS.
    Copy the archive to /u01/app/otm/otmapp/oas/j2ee/home/applications/webapp1.ear
    Initialize /u01/app/otm/otmapp/oas/j2ee/home/applications/webapp1.ear begins...
    Unpacking webapp1.ear
    Done unpacking webapp1.ear
    Unpacking webapp1.war
    Done unpacking webapp1.war
    Initialize /u01/app/otm/otmapp/oas/j2ee/home/applications/webapp1.ear ends...
    Starting application : webapp1
    Initializing ClassLoader(s)
    Initializing EJB container
    Loading connector(s)
    Starting up resource adapters
    Initializing EJB sessions
    Committing ClassLoader(s)
    Initialize webapp1 begins...
    Initialize webapp1 ends...
    Started application : webapp1
    Binding web application(s) to site default-web-site begins...
    Binding webapp1 web-module for application webapp1 to site default-web-site under context root TestADF-UserInterface-context-root
    Operation failed with error:
    org/apache/log4j/Category
    Deployment failed
    I tried step 9 and 11 in order to get rid of this log4j error.
    Your help is highly appreciated.
    Shobz
    Edited by: user13114596 on Jan 6, 2011 8:40 PM

    ADF 11g requires JEE 5.0 server.
    Oracle Application Server 10.1.3 supports J2EE 1.4.
    JDeveloper 11g application won't run on OAS 10.1.3.

  • Failed to load servlet Class: org.apache.jasper.servlet.JspServlet

    I am evaluating Weblogic 12c and is stuck in deployment of an application.
    My application is locally developed and is working fine in Oracle Glassfish. I have install glassfish and deploy application multiple time.
    In weblogic I can deploy the application successfully and the state= Prepared while Health=OK.
    When I access applicaiton from web browser, it says:
    Error 503--Service Unavailable
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.5.4 503 Service Unavailable
    The server.log is having messages similar to following:
    When processing WebService module 'SHMA'. Failed to load servlet Class: org.apache.jasper.servlet.JspServlet
    Ignoring: unable to load class:java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet at: weblogic.xml.schema.binding.util.ClassUtil.loadClass(ClassUtil.java:76)
    Jun 4, 2013 5:59:36 PM com.sun.xml.ws.model.JavaMethodImpl freeze
    WARNING: Input Action on WSDL operation RegisterOperation and @Action on its associated Web Method registerOperation did not match and will cause problems in dispatching the requests
    Any idea about how to fix this??
    Application is working fine in Glassfish 3.2
    I am having RHEL6-3 x86 with JDK 1.6u45 for Bea Weblogic 12c.
    Thanks

    Probably not the right forum. But you have the honour of being the first person to ask a specific WebLogic Server question here.
    The BEA dev-2-dev site still seems to be active. Try here hunting for a category here: http://forums.bea.com/index.jspa
    -steve-

Maybe you are looking for