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

Similar Messages

  • How can I Serialize the Object of org.apache.xalan.transformer.TransformerI

    Teachers:
    How can I Serialize the Object of org.apache.xalan.transformer.TransformerImpl.

    org.apache.xalan.transformer.TransformerImpl doesn't appear to be serializable... what do you try to achieve?

  • Memory leak in org.apache.xalan.trasnformer.TransformerImpl

    I am using Xalan library, I notice there is a memory leak in org.apache.xalan.trasnformer.TransformerImpl class.
    Every time I call transform(), the size of the instances grows and it won't reduce after garbage collection.
    Does anyone experience the same thing? or do I miss anything when I use this class?

    I just found out the transformer objects are supposed to be used for single transformation only.
    If multiple transformations with same stylesheet is needed, we should create a Templates object and then for each transformation, create a transformer object by Templates.newTransformer().

  • TransformerException -- possible bug in weblogic.apache.xalan.transformer.TransformerImpl

    Using WebLogic Server 6.1 SP2. Am using xslt to transform xml into html. After
    repeatedly
    using the same Transformer object to transform different xml documents, the Transformer
    eventually becomes corrupt – sometimes after 20 or so transforms, sometimes only
    after
    thousands.
    Once the Transformer object becomes corrupt, any additional attempt to call the
    transform
    method results in the following exception:
    =============================
    javax.xml.transform.TransformerException: -1
    at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1248)
    at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:483)
    at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1153)
    at … <snip>
    Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at weblogic.apache.xml.utils.NodeVector.popQuick(NodeVector.java:247)
    at weblogic.apache.xpath.XPathContext.popCurrentNode(XPathContext.java:552)
    at weblogic.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2100)
    at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1225)
    at … <snip>
    =============================
    Using cavaj to decompile weblogic.apache.xalan.transformer.TransformerImpl yields:
    Method: applyTemplateToNode:
    try
    pushElemTemplateElement(elemtemplateelement1);
    m_xcontext.pushCurrentNode(node);
         <snip>
    catch(SAXException saxexception)
    throw new TransformerException(saxexception);
    finally
    m_xcontext.popCurrentNode();
         <snip>
    So what appears to be happening is that one of the two push calls at the beginning
    of the try
    block is throwing an Exception, causing the pop method to be called in the finally
    block without
    first having had a successful call to push. The corresponding NodeVector inside
    m_xcontext
    thereupon becomes corrupt, and it is only a matter of time before the above
    ArrayIndexOutOfBoundsException appears.
    Unfortunately, we are unable to consistently reproduce this Transformer corruption
    and
    currently have no idea how it happens in the first place. We figure there’s probably
    some sort
    of error in our xsl stylesheet which is at the root of all this, but have had
    no luck in finding it.
    So, two questions:
    1.) Has anyone encountered this problem of having a bad xsl stylesheet which,
    when applied
    repeatedly on certain xml documents, can cause the Transformer to become corrupt
    as a result
    of calling NodeVector.pop without a corresponding call to NodeVector.push? If
    so, do you have
    a simple example of the type of xsl template and/or xml document which might reproduce
    the
    scenario.
    2.) Would not the above code snippet in TransformerImpl be considered buggy in
    any case,
    since it should not be possible for an invalid xsl stylesheet to permanently corrupt
    the
    Transformer? If there’s agreement that this represents a bug in TransformerImpl,
    has it been
    fixed in 6.1 SP3 or higher, or in subsequent versions of the Weblogic Server?
    Thanks,
    John

    hi,
    I've just recently started getting this error too. It's completely random as
    to when it occurs. My system can process hundreds of translations with no problems
    and then once and awhile I get this exact error.
    I'm using WebLogic v7.0 sp2. I've noticed however that this only happens on my
    Windows system - I've got it running on a solairs box with no problems.
    Has anyone else seen this ?
    Thanks.
    Jerry
    "John Lame" <[email protected]> wrote:
    >
    Using WebLogic Server 6.1 SP2. Am using xslt to transform xml into html.
    After
    repeatedly
    using the same Transformer object to transform different xml documents,
    the Transformer
    eventually becomes corrupt – sometimes after 20 or so transforms, sometimes
    only
    after
    thousands.
    Once the Transformer object becomes corrupt, any additional attempt to
    call the
    transform
    method results in the following exception:
    =============================
    javax.xml.transform.TransformerException: -1
    at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1248)
    at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:483)
    at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1153)
    at … <snip>
    Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at weblogic.apache.xml.utils.NodeVector.popQuick(NodeVector.java:247)
    at weblogic.apache.xpath.XPathContext.popCurrentNode(XPathContext.java:552)
    at weblogic.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2100)
    at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1225)
    at … <snip>
    =============================
    Using cavaj to decompile weblogic.apache.xalan.transformer.TransformerImpl
    yields:
    Method: applyTemplateToNode:
    try
    pushElemTemplateElement(elemtemplateelement1);
    m_xcontext.pushCurrentNode(node);
         <snip>
    catch(SAXException saxexception)
    throw new TransformerException(saxexception);
    finally
    m_xcontext.popCurrentNode();
         <snip>
    So what appears to be happening is that one of the two push calls at
    the beginning
    of the try
    block is throwing an Exception, causing the pop method to be called in
    the finally
    block without
    first having had a successful call to push. The corresponding NodeVector
    inside
    m_xcontext
    thereupon becomes corrupt, and it is only a matter of time before the
    above
    ArrayIndexOutOfBoundsException appears.
    Unfortunately, we are unable to consistently reproduce this Transformer
    corruption
    and
    currently have no idea how it happens in the first place. We figure
    there’s probably
    some sort
    of error in our xsl stylesheet which is at the root of all this, but
    have had
    no luck in finding it.
    So, two questions:
    1.) Has anyone encountered this problem of having a bad xsl stylesheet
    which,
    when applied
    repeatedly on certain xml documents, can cause the Transformer to become
    corrupt
    as a result
    of calling NodeVector.pop without a corresponding call to NodeVector.push?
    If
    so, do you have
    a simple example of the type of xsl template and/or xml document which
    might reproduce
    the
    scenario.
    2.) Would not the above code snippet in TransformerImpl be considered
    buggy in
    any case,
    since it should not be possible for an invalid xsl stylesheet to permanently
    corrupt
    the
    Transformer? If there’s agreement that this represents a bug in TransformerImpl,
    has it been
    fixed in 6.1 SP3 or higher, or in subsequent versions of the Weblogic
    Server?
    Thanks,
    John

  • WL10.3.3 Console Provider org.apache.xalan.processor.TransformerFactoryImp

    Getting the following error:
    An error occurred during activation of changes, please see the log for details.
    [Management:141191]The prepare phase of the configuration update failed with an exception:
    Provider org.apache.xalan.processor.TransformerFactoryImpl not found
    Note: we have the FOP added to the domain as a shared library with the following libraries:
    avalon-framework-cvs-20020806.jar
    batik.jar
    fop.jar
    xalan-2.4.1.jar
    xercesImpl-2.2.1.jar
    xml-apis.jar
    Note: Also, the shared libraries are not displaying referencing applications
    Edited by: SK Jennings on Nov 9, 2010 10:25 AM
    Added more info.

    Hi,
    I'm getting the same ClassCastException when I try to activate the changes of my EJB application. Were you able to resolve the error you were getting? Please let me know.
    Thanks

  • WL 10.3.3 Console org.apache.xalan.processor.TransformerFactoryImpl not fou

    Getting the following error:
    An error occurred during activation of changes, please see the log for details.
    [Management:141191]The prepare phase of the configuration update failed with an exception:
    Provider org.apache.xalan.processor.TransformerFactoryImpl not found
    Note: we have the FOP added to the domain as a shared library with the following libraries:
    avalon-framework-cvs-20020806.jar
    batik.jar
    fop.jar
    xalan-2.4.1.jar
    xercesImpl-2.2.1.jar
    xml-apis.jar
    Note: Also, the shared libraries are not displaying referencing applications

    Getting the following error:
    An error occurred during activation of changes, please see the log for details.
    [Management:141191]The prepare phase of the configuration update failed with an exception:
    Provider org.apache.xalan.processor.TransformerFactoryImpl not found
    Note: we have the FOP added to the domain as a shared library with the following libraries:
    avalon-framework-cvs-20020806.jar
    batik.jar
    fop.jar
    xalan-2.4.1.jar
    xercesImpl-2.2.1.jar
    xml-apis.jar
    Note: Also, the shared libraries are not displaying referencing applications

  • Xalan transformer

    Hello,
    the code below is giving me the exception below.
    I would greatly appreciate if anyone cud tell me the solution.
    fin = new FileInputStream("c:/input.xml");
    fout = new FileOutputStream("c:/html/output.html");
                        try
                        fullTransformer.transform(new StreamSource(fin), new
    StreamResult(fout));
                   catch (Exception ex1)
                        System.out.println("Null Pointer exception thrown in Full");
                        ex1.printStackTrace();
    Null Pointer exception thrown in Full
    javax.xml.transform.TransformerException:
    java.lang.NullPointerException
    at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1212)
    at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)
    at java.lang.Thread.run(Thread.java:479)
    java.lang.NullPointerException
    at org.apache.xpath.objects.XObject.str(XObject.java:250)
    at org.apache.xalan.templates.AVTPartXPath.evaluate(AVTPartXPath.java:161)
    at org.apache.xalan.templates.AVT.evaluate(AVT.java:523)
    at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:722)
    at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2154)

    The first thing to try is add a few lines of code to check that fin and fout are not null. Maybe for some reason the file could not be opened.
    How does your stylesheet look? Is it simple or complicated? Which version of Xalan are you using? Try downloading a new version at http://xml.apache.org. I once had a NullPointerException with Xalan which was caused by a bug in Xalan.
    Jesper

  • Awkward NullPointerException in Xalan transformations

    L.S,
    I'm having a serious problem with XSL transformations using Apache Xalan 2.6.0: a transformation works once, but multiple calls to the method will cause a null-pointer exception to occur within the TrAXFilter object taking care of the transformation.
    The class responsible for transforming any XML messages in our system looks like this (class MessageWriter appearing at line 14 is a JAXB marshalling class we've developed; class FilterManager appearing at line 21 returns an array of 1 hard-coded XMLFilter object):
    public class MessageBuilder {
      private final static SAXParserFactory XML_PARSER = SAXParserFactory.newInstance();
      public static String getXmlMessage(MessageSDO message) {
        String xml = MessageWriter.doMarshal(message);
        try {
          SAXParser parser = XML_PARSER.newSAXParser();
          XMLReader reader = XMLReaderFactory.createXMLReader();
          InputSource srcInput = new InputSource(new StringReader(xml));
          FilterManager ftrManager = (FilterManager) ConfigurationManager.
            getInstance(ConfigurationManager.BOUNDARY).getBean(FilterManager.class);
          XMLFilter[] filters = ftrManager.getOutputFilters(message);
          if (filters.length > 0) {
            for (int i=0;i<filters.length;i++) {
              filters.setParent((i==0)? reader : filters[i-1]);
    Serializer serializer = SerializerFactory.getSerializer(OutputPropertiesFactory.getDefaultMethodProperties("xml"));
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    serializer.setOutputStream(output);
    filters[filters.length-1].setContentHandler(serializer.asContentHandler());
    filters[filters.length-1].parse(srcInput);
    xml = output.toString();
    } catch (Exception e) {
    throw new RuntimeException(e);
    return xml;
    The test I've run (if 2nd block commented out test succeeds, otherwise it fails on that 2nd attempt):
    public void testTransformedOutput() {
      System.out.println("Transformed output test:\n\n");
      MessageSDO msg = MockSDOFactory.getInstance().getMessageSDO();
      String xmlMsg = MessageBuilder.getXmlMessage(msg);
      /*System.out.println("Transformed output test, 2nd pass:\n\n");
        MessageSDO msg2 = MockSDOFactory.getInstance().getMessageSDO();
        String xmlMsg2 = MessageBuilder.getXmlMessage(msg2);*/
    }The exception message:
    java.lang.RuntimeException: java.lang.NullPointerException
    at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:658)
    at org.apache.crimson.parser.Parser2.parse(Parser2.java:334)
    at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
    at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:134)
    at org.boundary.helper.MessageBuilder.getXmlMessage(MessageBuilder.java:36)
    // Line 36 in MessageBuilder is:
    // filters[filters.length-1].parse(srcInput);What I don't yet understand is how TrAXFilter manages to somehow not have a parent in the 2nd pass of the test, while it does in the 1st pass. I've tried a few things already, but so far haven't been able to find a solution.
    Does anyone know of a bug like this? Or is it clear to someone what I'm doing completely wrong here? I'd appreciate any help you can offer.

    I've been able to solve this problem and since others might be interested, I thought I'd post the solution here as well.
    It turns out that XMLFilter objects cannot be reused. This isn't documented very well, and undoubtedly doesn't come as a surprise to the more experienced XML specialists out there, but it's something you need to know. As a result, instead of using XMLFilter objects for repetetive transformations, you need to use an alternative, namely [url http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/Templates.html]Templates objects:
    final SAXTransformerFactory FACTORY = (SAXTransformerFactory) TransformerFactory.newInstance();
    File xslFile = new File("someStylesheet.xsl");
    StreamSource src = new StreamSource(xslFile);
    Templates template = FACTORY.newTemplates(src);
    // Later on, you can repeatedly do this:
    String xml = getSomeXMLDocument();
    InputSource srcInput = new InputSource(new StringReader(xml));
    XMLFilter filter = FACTORY.newXMLFilter(template); // Use cached template instead of parsing XSL file every time...
    XMLReader reader = XMLReaderFactory.createXMLReader();
    filter.setParent(reader);
    Serializer serializer = SerializerFactory.getSerializer(OutputPropertiesFactory.getDefaultMethodProperties("xml"));
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    serializer.setOutputStream(output);
    filter.setContentHandler(serializer.asContentHandler());
    filter.parse(srcInput);
    String xml = output.toString();

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

  • Running sample of Apache/xalan

    Hi,
    I have downloaded xalan-j_2_2 and i try to run the sample demo "SimpleTransform". I run like this:
    java SimpleTransformand i got:
    Exception in thread "main" javax.xml.transform.TFactoryConfigurationError: org.apache.xalan.processor.TransformerFactoryImpl
         at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:134)
         at SimpleTransform.main(SimpleTransform.java:85)
    The files xalan.jar,xml-apis.jar,xerces.jar etc.. are all in my CLASSPATH.
    What's wrong ??
    Thanks for help.

    Hi,
    I ran into the same problem when I tried out examples in the sample folder.
    TransformerConfiguration error is caused usually because you have a version of xalan which is not stable. Make sure you extract the zip file in the same directory. (for e.g c://xalan.zip should be extracted to c:/xalan)
    Set the system classpath to xerces.jar, xalan.jar, xml-apis.jar. If your running samples you'll probably need samples.jar etc as mentioned in the usagepatterns link of the xml.apache.org website.
    Hope this helps.

  • Apache/Xalan

    I need to use the library org.apache.xalan.xpath for programming Xpath and XLS but the compiler dosen�t recognize the files. I have the jar Files but I'm not sure where to put then.

    I'm not quite sure what you mean by "doesn't recognize them", but I'll toss in something that might help.
    I have been working with Apache's Xerces package (XML SAX parsing), and had considerable trouble getting it working initially. I finally solved my problems by adjusting the order of my ClassPath. The problem was that Xerces jar files needed to be seen before the J2EE jar files.
    Try putting the Xalan jar files in the front of your classpath, and see if that helps at all.
    Good luck!

  • Org.apache.xpath.DOM2Helper.getNamespaceOfNode

    Hi, there;
    I am trying to do an example by calling
    transformer.transform(source, result);
    It can be compiled, an exception occured when running:
    java.lang.NoSuchMethodError
         at org.apache.xpath.DOM2Helper.getNamespaceOfNode(DOM2Helper.java:348)
    I am using jaxp.jar, parser.jar, xalan.jar xerces.jar and last 2 jars are from winter release.
    any suggestion?
    Thanks!

    That means that the classes in your classpath when you run that code are not the same as the classes in your classpath when you compiled it.

  • Exception (org.apache.axis2.AxisFault: Server) when accessing Web-Service

    Hi all,
    I have read already some interesting posts on Java implementation for Oracle CoD Web Services.
    Somehow I am stuck and can't find a way out.
    I try to access the LeadQuery command via the following code:
              String sessionCookie = logon(
                        "https://secure-ausomxapa.crmondemand.com/Services/Integration",
                        username, password);
              LeadStub stub;
              try {
                   stub = new LeadStub(
                             "https://secure-ausomxapa.crmondemand.com/Services/Integration;jsessionid="
                                       + sessionCookie);
                   // ServiceClient client = stub._getServiceClient();
                   // client.getOptions().setManageSession(true);
                   // client.getOptions().setProperty("jsessionid", sessionCookie);
                   // client.getOptions().setUserName(username);
                   // client.getOptions().setPassword(password);
                   LeadQueryPage_Input leadQueryPage_Input = new LeadQueryPage_Input();
                   ListOfLeadQuery listOfLeadQuery = new ListOfLeadQuery();
                   QueryType queryType = new QueryType();
                   queryType.setString("LIKE 'A*'");
                   LeadQuery leadQuery = new LeadQuery();
                   leadQuery.setCompany(queryType);
                   listOfLeadQuery.setLead(leadQuery);
                   leadQueryPage_Input.setListOfLead(listOfLeadQuery);
                   LeadQueryPage_Output leadQueryPage_Output = stub
                             .LeadQueryPage(leadQueryPage_Input);
              } catch (AxisFault e) {
                   e.printStackTrace();
              } catch (RemoteException e) {
                   e.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
                   System.err.println("\n\n\n");
              logoff("https://secure-ausomxapa.crmondemand.com/Services/Integration",
                        sessionCookie);
    Logging In and Out is no problem, runs like music. But whenever LeadQueryPage is called, I just receive the following error:
    org.apache.axis2.AxisFault: Server
         at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
         at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
         at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
         at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
         at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
         at crmondemand.LeadStub.LeadQueryPage(LeadStub.java:1026)
         at CODconnection.main(CODconnection.java:58)
    I'm using Eclipse 3.4.2 with AXIS2 1.4, and the Eclipse Plug-In for AXIS 1.3 (with some small patch to get it to work).
    I downloaded the custom WSDL from Oracle CoD (CRM On Demand) Admin page and used the AXIS-Wizard in Eclipse to transform it to Java.
    For that, I already tried the -g option (which is "Create everything - Client and Server" in the wizard).
    Anyone has a clue what the problem might be?
    Btw.: I downloaded also V1.0 WSDL to check if that works. Some problem.
    Found out that just the error reporting sucks and at the end the Server missed the correct Authentification.
    Funnily I just did what I read a couple of time. With this small bit of code it works:
                   ServiceClient client = stub._getServiceClient();
                   client.getOptions().setManageSession(true);
                   client.getOptions().setProperty(HTTPConstants.HEADER_COOKIE, "jsessionid="+sessionCookie);
                   client.getOptions().setUserName(username);
                   client.getOptions().setPassword(password);
    -----

    You are missing the end point location. See the sample client below:
    MyHelloMyHelloSOAP11PortStub stub = new MyHelloMyHelloSOAP11PortStub("http://localhost:8080/axis2/services/MyHello");
                   MyHelloMyHelloSOAP11PortStub.SayHello hello = new MyHelloMyHelloSOAP11PortStub.SayHello();
                   hello.setS("ABCD");
                   MyHelloMyHelloSOAP11PortStub.SayHelloResponse resp=stub.sayHello(hello);
                   System.out.println("Response from Web Service "+resp.get_return());

  • URGENT: JAXP Provider org.apache.crimson.jaxp.SAXParserFactoryImpl not foun

    Hi all
    I am having this strage problem. I am using JAXP Apis to do XSLT transformation and everything works fine.
    But when I try the samething with
    -Djava.security.manager option and
    -Djava.security.policy==$WL_HOME/weblogic.policy option set it doesn't work. Stranger still the error it gives:
    javax.xml.transform.TransformerException: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.crimson.jaxp.SAXParserFactoryImpl not found
    This the command that works:
    $JAVA_HOME/java -classpath $WL_CLASSPATH -Dintegration.config=$WL_HOME/integration.cfg com.swl.integration.translation.SendPRThread 24972 451
    This one does NOT work:
    $JAVA_HOME/java -ms64m -mx64m -verbosegc -classpath $WL_CLASSPATH -Djava.security.manager -Djava.security.policy=$WL_HOME/weblogic.policy -Dintegration.config=$WL_HOME/integration.cfg com.swl.integration.translation.SendPRThread 24972 451
    I know it's something to do with Security manager/policy setting, but can't figure it out.
    Could anyone please help? It is very urgent.
    Thanks a lot
    Mak

    I have your solution... under Weblogic BEA were giving the same error, I resolved it with this code before the instantiation of SAXParserFactory:
    String key = "javax.xml.parsers.SAXParserFactory"
    String value = "org.apache.xerces.jaxp.SAXParserFactoryImpl";
    Properties props = System.getProperties();
         props.put(key, value);
         System.setProperties(props);

  • NullPointerException at org.apache.crimson.parser.Parser2.parseInternal

    I've tried to use JavaTM API for XML Processing (JAXP), particulary default SAX parser,
    which is embeded into JAXP.
    I downloaded jaxp-1_1.zip file from http://java.sun.com/xml/download.html, extacted it
    and included crimson.jar, jaxp.jar and xalan.jar to java CLASSPATH.
    After that I'd tried to parse XML document
    with following code
         // prepare SAX parser
    SAXParserFactory factory = SAXParserFactory.newInstance();
    DefaultHandler handler = new XMLHandler();
    try {
    // Create a JAXP SAXParser
    SAXParser saxParser = factory.newSAXParser();
    // url
    File file = new File( fileName );
    String url = file.toURL().toString();
    System.out.println( "URL: " + url );
    // parse
    saxParser.parse( url, handler );
    } catch (Exception ex) {
    ex.printStackTrace();
    throw ex;
    and obtained the message below
    java.lang.NullPointerException
         at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:523)
         at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
         at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:346)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:232)
         at com.darout.bot.parser.PObjectsBuilder.parse(PObjectsBuilder.java:54)
         at TestSAXParser.main(TestSAXParser.java:22)
    Could you help me?

    I've found an error. It was in my handler implementation.
    But is it possible to trace a handler exception correctly?

Maybe you are looking for

  • How can I use the open in " My application" option to open image attachments.?

    How can I use the open in " My application" option to open image attachments.? I am trying to use the uti's given in the apple docs but just unable to do it however its working perfect for pdf and rtf files. please help needed urgent.   

  • How do I save a pdf as an html file without losing formatting?

    How do I save a pdf as an html file without losing formatting?  My coworker is able to do this on her Adobe 9 by saving to html css 4.0 - I have Adobe 11 and have not been able to save as an html at all without loosing formatting.

  • Creative Cloud Manager CC 2014 Reverts All Apps Back to Trial

    I am a current Adobe CC subscriber, but today all of my Adobe Apps show as "Start Trial" in Creative Cloud Manager CC 2014. I click "start trial" on the app and it says I have 30 days remaining. How do I fix this? Thank you.

  • How to add a time stamp to an array

     Currently the VI that I have attached has the capacity to log data from the set of 14 arrays. I currently have a tick counter hooked up. However, I would like to add a time stamp that will display the elapsed time in seconds from the begining of the

  • Interactive report using ALV's

    Hi Gurus,      Here i have sales header details and item details, what exactly i am looking is i displayed sales document details using RESUE_ALV_GRID_DISPLAY..and when i click on Particular VBELN i want to display in the next liss as item details fo