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?

Similar Messages

  • Java.lang.ClassCastException: org.apache.crimson.tree.XmlDocument

    Hi all,
    i am new to java. I am trying to parse an xml document. the code is as follows:-
    Document document = null;
    DocumentBuilderFactory factory = ocumentBuilderFactory.newInstance();
    try {
         DocumentBuilder builder = factory.newDocumentBuilder();
         document = builder.parse( new File(xmlFile) );
    after this i am trying to traverse using treewalker :-
    Element docElem = document.getDocumentElement();
                   DocumentTraversal docTrav = (DocumentTraversal) document;
                   TreeWalker treeWalk = docTrav.createTreeWalker(docElem, NodeFilter.SHOW_ELEMENT, new ConfigNodeFilter(), false);
              Node node = treeWalk.nextNode();
    when i compile all is fine but while runnig it. i get the following error:-
    java.lang.ClassCastException: org.apache.crimson.tree.XmlDocument
    at - DocumentTraversal docTrav = (DocumentTraversal) document;.
    my import statements are as follows:-
    import java.io.File;
    import java.io.IOException;
    import java.net.InetAddress;
    import java.net.UnknownHostException;
    import java.util.Vector;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.traversal.DocumentTraversal;
    import org.w3c.dom.traversal.NodeFilter;
    import org.w3c.dom.traversal.TreeWalker;
    import org.xml.sax.SAXException;
    i am not able to understand why the error is coming.
    any help will be appreciated.

    "In DOMs which support the Traversal feature, DocumentTraversal will be implemented by the same objects that implement the Document interface. "
    My guess is that the DOM parser you are using doesn't support the DocumentTraversal interface which is why you can not cast to that class.

  • Namespaces / apache.crimson.parser / BASDA XML / HELP!!

    This is probably an easy question but I can't find anyone to help me.
    I am using the apache.crimson.parser to parse and validate an Xml doc against the BASDA eBIS-XML purchase order schema but i can't get the Namespaces right.
    I have this at present for the Xml doc;
    <Order xmlns ="urn:schemas-microsoft-com:xml-data"
    xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:schemas-microsoft-com:xml-data
    http://www.cs.aston.ac.uk/hillsm/project/eBIS-XML_Order_v3.01.xml">
    ....and this for the schema;
    <Schema name="eBIS-XML_Order_v3.01.xml"
    xmlns="urn:schemas-microsoft-com:xml-data"
    xmlns:dt="urn:schemas-microsoft-com:datatypes">
    Does anyone have any ideas??

    Steven,
    let me first note that I'm not familiar with the specific Schema you mention here (apparently from M$), and it would have been helpful to see at least part of it in your posting, because it seems abnormal that Microslob uses the conventional xsd namespace for schema declarations (although it wouldn't surprise me).
    Anyways, let's do a first version without the xsd name space.
    The declarations in your xml file are correct.
    In the schema file, the first error is, that schema is misspelled as Schema. Secondly, schema does not allow a name attribute (get rid of it). There is also no reference to the namespace "http://www.w3.org/2001/SMLSchema". So, the default namespace has to be changed to that. The targetNamespace attribute specifies that this schema applies to the specified name space. Putting it all together:
    <?xml version="1.0"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
                 targetNamespace="urn:schemas-microsoft-com:xml-data"
                 xmlns:dt="urn:schemas-microsoft-com:datatypes">
           <!-- let's have fun and declare an Order element that would work with just one
                  order element defined in the xml file. -->
           <element name="Order" type="string"/>
    </schema>So this would validate OK with this xml file (provided that ..../eBIS-XML_Order_v3.01.xml is the above schema file):
    <?xml version="1.0"?>
    <Order xmlns ="urn:schemas-microsoft-com:xml-data"
              xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="urn:schemas-microsoft-com:xml-data
              http://www.cs.aston.ac.uk/hillsm/project/eBIS-XML_Order_v3.01.xml">
    </Order>                     So, in this example, the default namespace in the schema is set to "http://www.w3.org/2001/XMLSchema" and the targetNamespace attribute points to the xml file's default name space.
    However, the standard way of doing things differs. You certainly should not (mis-)set the schema's default name space to "http://www.w3.org/2001/XMLSchema".
    I do not know in what way Microsoft limits you, but I strongly recommend something along these lines in order to not have regrets, headache and coffein and nicotine addiction lateron:
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns="urn:schemas-microsoft-com:xml-data"
                xmlns:dt="urn:schemas-microsoft-com:datatypes"
                targetNamespace="urn:schemas-microsoft-com:xml-data">
       <xsd:element name="Order" type="xsd:string"/>
    </xsd:schema>Also, in order to avoid confusion, Schema files should have the extension xsd - a minor sidepoint.
    Hope that helps,
    Leo.

  • 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);

  • Java.lang.NullPointerException at org.apache.struts.taglib.tiles.InsertTag

    I am using tiles with JSF.
    my starting page is template.jsp which is like this..
    <f:view>
    <f:subview id="header">
    <tiles:insert attribute="header" flush="false"/>
    </f:subview>
    <f:subview id="menu">
    <tiles:insert attribute="menu" flush="false"/>
    </f:subview>
    </f:view>
    when ever the page is rendered, im not getting the value for attribute header or content. its throwing java.lang.NullPointerException at org.apache.struts.taglib.tiles.InsertTag.processAttribute(InsertTag.java:689)
    Below is my faces-config.xml
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
    <application>
    <view-handler>org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl</view-handler>
    </application>
    </faces-config>
    Below is my web.xml
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <init-param>
    <param-name>javax.faces.application.CONFIG_FILES</param-name>
    <param-value>/ApplianceMgr/conf/faces-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>Tiles Servlet</servlet-name>
    <servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class>
    <init-param>
    <param-name>tiles-definitions</param-name>
    <param-value>/ApplianceMgr/conf/tiles.xml</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    Below is my tiles.xml
    <tiles-definitions>
    <definition name="main.template" path="/template/template.jsp" >
    <put name="header" value="test from template" />
    <put name="menu" value="test from template" />
    </definition>

    Please post the tiles-config.xml, layout and tiles.
    Please refer
    http://www.oracle.com/technology/pub/articles/vohra_tiles.html

  • Org.apache.crimson and 1.5

    I am trying to test an application in 1.5 and am getting compile errors for crimson references in classes someone else wrote.
    Looking at the JDK src, it looks like the apache packages are not bundeled in to the 1.5 beta.
    Wth the preface that I am mostly a Swing developer my questions are...
    I know it has to do with XML, but what specific functionality did crimson bring to the tale?
    Why did Sun remove the apache libs from the distribution?
    Is there anything in 1.5 to take crimsons place.
    Thanks for your time if you answer,
    Todd

    Looking at the JDK src, it looks like the apache
    packages are not bundeled in to the 1.5 beta.That's correct. The only contract is to supply an XML processor, not a specific one. Crimson is just one; Xerces is the most popular one out there. Looks like 1.5 includes a subset of Xerces (with a different package - com.sun.org.apache.xerces.internal).
    I know it has to do with XML, but what specific
    functionality did crimson bring to the tale?Nothing special. It was just a lightweight XML implementation.
    Why did Sun remove the apache libs from the distribution?
    Is there anything in 1.5 to take crimsons place.It's just replaced them with something they felt they could maintain better.
    You should not ever be referring to Crimson classes directly. You should ONLY use org.w3c.dom or org.w3c.sax classes directly, and use the advertised Factory APIs to create or manipulate Documents, Elements, etc.
    Your best bet is to rip out all references to org.apache.crimson, and use an elementary XML textbook to replace them with references to standard org.w3c.* classes.

  • Org.apache.crimson.tree.DomEx: INVALID_CHARACTER_ERR:

    I am using XML to create an element.
    It fails when I try to create with numbers.
    node = doc.createElement("111");
    why is that?

    So, you think it would be valid to have the following:
    <document>
      <1 1 1>some text</1 1 1>
    </document>That is what you are asking for. The String you specify in the createElement is the tagname. Tagnames cannot have spaces in them. I don't have a reference with me, but I don't think they can start with a numeric.
    How is "node" defined? Did you mean node = doc.createTextNode("1 1 1");
    That should work.
    Dave Patterson

  • Plz help me from the error - "org.apache.jasper.jasperException"

    I am getting error with this code ,plz help me out ,i wanna correct this urgently
    I've set the Environment variables JAVA_HOME and
    CATALINA_HOME and here is my coding and error report
                   hello.html
    <head><title>Database</title></head>
    <body>
    <form method="get" action="add.jsp">
    <pre>
    <center>Enter ur Name :<input type="text" name="nam" >
    <br><input type="submit" value=" Add ">
    </center></pre>
    </form>
    </body>
    </html>
                   add.jsp
    <%@ page language="java" %>
    <%@ page import="java.sql.*" %>
    <html>
    <head><title>JSP</title></head>
    <%! String name;
    Connection con=null;
    Statement st=null;
    %>
    <body>
    <% name=request.getParameter("nam");
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //I have created a User DSN sjp
    con = DriverManager.getConnection("jdbc:odbc:sjp");
    st = con.createStatement();
    st.executeUpdate("insert into detail values('"+name+"')");
    catch(Exception e)
    con.close();
    st.close();
    %>
    <h1> Name Added</h1>
    </body>
    </html>
                   Error
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:207)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:534)
    root cause
    java.lang.NullPointerException     at org.apache.jsp.add_jsp._jspService(add_jsp.java:66)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:534)
    Apache Tomcat/4.1.31

    hi,
    when i use the code
    if(st != null)st.close();
    if(con != null ) con.close();
    that works good ,the old error has been corrected.
    but it's now throwing an SQLException[b] "datasource name not found and default driver not specified" why this occurs and also can u give me the explanation for the old error????
    I am sure that i have created an user DSN, i am 100% sure about it .even though there is an error.
    Deepak.
    Deepak.C

  • Error NPE at org.apache.catalina.loader.StandardClassLoader.java

    On staring Tomcat Cluster - i get this error:
    org.apache.catalina.cluster.tcp.SimpleTcpCluster start
    SEVERE: Unable to start cluster.
    java.lang.NullPointerException
    at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:804)
    at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:756)
    Any help in pointing out what could be wrong would be greatly appreciated.
    ======
    My Tomcat server.xml - cluster part looks like:
    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
    expireSessionsOnShutdown="false"
    useDirtyFlag="true">
    <Membership
    className="org.apache.catalina.cluster.mcast.McastService"
    mcastAddr="228.0.0.4"
    mcastPort="45564"
    mcastFrequency="500"
    mcastDropTime="3000"/>
    <!�auto below has been replaced with 127.0.0.1 it still does not help �
    <Receiver className="org.apache.catalina.cluster.tcp.ReplicationListener"
    tcpListenAddress="auto"
    tcpListenPort="4001"
    tcpSelectorTimeout="100"
    tcpThreadCount="6"/>
    <Sender
    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
    replicationMode="pooled"/>
    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
    filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
    </Cluster>

    You're right, you posted a new thread, but . . .
    This whole forum is dedicated to Messaging Server
    You might want to find the correct forum to post your question . . . . . . . . . .

  • Java.lang.NullPointerException at org.collaxa.thirdparty.apache.wsif.base.

    Hi,
    I am trying to invoke a Websservice, which has JCA bindings, using the WSIF framework. Getting a null pointer exception:
    Have posted the code and error below.
    CODE SNIPPET:
    ====================================================================
    try{
    /* if (Thread.currentThread().getContextClassLoader() == null) {
    ClassLoader cl = getClass().getClassLoader();
    Thread.currentThread().setContextClassLoader(cl);
    oracle.tip.adapter.fw.wsif.jca.WSIFDynamicProvider_JCA provider = new oracle.tip.adapter.fw.wsif.jca.WSIFDynamicProvider_JCA();
    org.collaxa.thirdparty.apache.wsif.util.WSIFPluggableProviders.overrideDefaultProvider("http://xmlns.oracle.com/pcbpel/wsdl/jca/", provider);
    Definition wsdlDefinition = WSIFUtils.readWSDL(null, "C:\\SOAPJCA\\BRMCustServices.wsdl");
    Service wsdlService = wsdlDefinition.getService(new QName("http://xmlns.oracle.com/BRM/schemas/BusinessOpcodes") );
    org.collaxa.thirdparty.apache.wsif.WSIFServiceFactory wsifFactory = org.collaxa.thirdparty.apache.wsif.WSIFServiceFactory.newInstance();
    WSIFService wsifService = wsifFactory.getService(wsdlDefinition, wsdlService);
    String portChosen = null;
    Iterator it = wsifService.getAvailablePortNames();
    while (it.hasNext()) {
    String nextPort = (String) it.next();
    if (portChosen == null)
    portChosen = nextPort;
    System.out.println(" - " + nextPort);
    WSIFPort port_wsif = wsifService.getPort();
    System.out.println("After that !!");
    //WSIFPort javaPort = wsifService.getPort("");
    }catch(WSIFException wsifEx){
    System.out.println("Within WSIF exceptions");
    wsifEx.printStackTrace();
    ====================================================================
    ERROR:
    ====================================================================
    - WSIF0007I: Using WSIFProvider 'oracle.tip.adapter.fw.wsif.jca.WSIFDynamicProvider_JCA' for namespaceURI 'http://xmlns.oracle.com/pcbpel/wsdl/jca/'
    - BRMCUSTService_pt
    After preferred portoracle.j2ee.ws.wsdl.DefinitionImpl@1d86fd3
    After preferred portclass org.collaxa.thirdparty.apache.wsif.base.WSIFServiceImpl
    Within exceptions
    java.lang.NullPointerException
         at org.collaxa.thirdparty.apache.wsif.base.WSIFServiceImpl.createDynamicWSIFPort(WSIFServiceImpl.java:417)
         at org.collaxa.thirdparty.apache.wsif.base.WSIFServiceImpl.getPort(WSIFServiceImpl.java:467)
         at org.collaxa.thirdparty.apache.wsif.base.WSIFServiceImpl.getPort(WSIFServiceImpl.java:429)
         at WSIFSample4.main(WSIFSample4.java:62)
    =====================================================================
    The jars used here are orabpel related jars, which has its own JCA provider and implementation classes. There are similar errors reported in Axis WSIF forums for:
    Null pointer Exception at apache.wsif.base.WSIFServiceImpl.createDynamicWSIFPort
    But no concrete answers to it.
    Has anyone tried using WSIF in Oc4j,
    Any help is appreciated.
    Thanks,

    It says "*unique* constraint (XXEA_GLOBAL.XXEA_GL_JOURNAL_IN_STG_U1) violated". Pls check if your data (for insertion) is violating this constraint.

  • Excel Parsing -org.apache.poi.hssf.record.RecordFormatException

    Hi ,
    I am running into org.apache.poi.hssf.record.RecordFormatException,
    while creating excel work book.
    Few of the worksheets in the workbook are password protected.
    If i remove the password proted worksheets then i am able to load the
    workbook and can parse it.
    I am using apache poi 2.5.1.
    Is it possible to load workbook having few password proted sheets using apache POI?
    I appreaciate any help in this.
    Thanks in advance
    Mark
    code.
    POIFSFileSystem fs =new POIFSFileSystem(input);
    HSSFWorkbook wb = new HSSFWorkbook(fs);
    Exception log:
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled Code))
    at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled Code))
    at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java(Compiled Code))
    at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java(Compiled Code))
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)
    at com.cargill.aim.examples.ExcelParseTest.main(ExcelParseTest.java:43)
    Caused by: java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Native Method)
    at org.apache.poi.hssf.record.UnknownRecord.<init>(UnknownRecord.java:62)
    at org.apache.poi.hssf.record.SubRecord.createSubRecord(SubRecord.java:57)
    at org.apache.poi.hssf.record.ObjRecord.fillFields(ObjRecord.java:99)
    at org.apache.poi.hssf.record.Record.fillFields(Record.java(Compiled Code))
    at org.apache.poi.hssf.record.Record.<init>(Record.java(Compiled Code))
    at org.apache.poi.hssf.record.ObjRecord.<init>(ObjRecord.java:61)
    ... 9 more
    Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance, the following exception occured: null
    at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java(Compiled Code))
    at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java(Compiled Code))
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)
    at com.cargill.aim.examples.ExcelParseTest.main(ExcelParseTest.java:43)

    Hi,
    I am dealing with the similer problem but the same error. I am using the latest version of POI 3.0.1 and trying to read the cells which have auto formating enabled for date. I am getting the same error. Please let me know if you come across any solution to read the formatted cells using POI.
    Thanks in advance!
    - Alok

  • Java.lang.NullPointerException javax.xml.parsers.DocumentBuilder.parse

    Hi all,
    i have a problem by solving an error in my code. The Code is mainly from Ian Darwin.
    The code i am running works with j2sdk1.4.2_04. But now i have to bring it to work with jdk1.6.0_13.
    The code parses xml documents. With small xml documents the code works. With large xml documents i get the following error while running the produced class file.
    Exception in thread "main" java.lang.NullPointerException
    at com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl.setChunkIndex(DeferredDocumentImpl.java:1944)
    at com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl.appendChild(DeferredDocumentImpl.java:644)
    at com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser.characters(AbstractDOMParser.java:1191)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.characters(XMLDTDValidator.java:862)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:463)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
    at XParse.parse(XParse.java:38)
    at XParse$JFileChooserrv.<init>(XParse.java:119)
    at XParse.main(XParse.java:213)
    I know what a java.lang.NullPointerException mens. But i don't know where i have to look for. Specially i don't know what or where "com.sun.org.apache...." is.
    Is there a package that a have to add to the environment? Can some one tell my where i can find this package?
    I wrote the code for some years ago, 2006 or so. With the knew jdk1.6.0_13 some thinks chance in the environment. Couldn't find what exactly.
    The code has only 215 lines, but some how i can't add it to this Message, because Maximum allowed is only 7500.
    Is there an other Forum, which may is better for my question?

    Here is the code:
    import java.io.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.Container;
    import javax.swing.JTextArea;
    * This code is mainly from @author Ian Darwin, [email protected]
    public class XParse {
         /** Convert the file */
         public static void parse(File file, boolean validate) {
              try {
                   System.err.println("");
                   String fileName = file.getAbsolutePath();
                   System.err.println("Parsing " + fileName + "...");
                   // Make the document a URL so relative DTD works.
                   //String uri = new File(fileName).getAbsolutePath();
                   //System.err.println(uri);
                   DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
                   if (validate)
                   f.setValidating(true);
                   DocumentBuilder p = f.newDocumentBuilder();
                   p.setErrorHandler(new MyErrorHandler(System.err));
                   //XmlDocument doc = XmlDocument.createXMLDocument(file);
                   boolean vaild =  p.isValidating();
                   if (vaild) {
                        System.out.println("yes parsing");
                        Document doc = p.parse(file); // <<<< ERROR
                   System.out.println("Parsed OK");
              } catch (SAXParseException ex) {
                   System.err.println("+================================+");
                   System.err.println("|       *SAX Parse Error*        |");
                   System.err.println("+================================+");
                   System.err.println(ex.toString());
                   System.err.println("At line " + ex.getLineNumber());
                   System.err.println("+================================+");
              } /**catch (RuntimeException ex) {
                   System.err.println("+================================+");
                   System.err.println("|       *SAX Parse Error*        |");
                   System.err.println("+================================+");
                   System.err.println(ex.toString());
                   //System.err.println("At line " + ex.getLineNumber());
                   //System.err.println("At line " + ex.getMessage());
                   System.err.println("+================================+");
              }**/ catch (SAXException ex) {
                   System.err.println("+================================+");
                   System.err.println("|          *SAX Error*           |");
                   System.err.println("+================================+");
                   System.err.println(ex.toString());
                   System.err.println("+================================+");
              /*}} catch (SAXNotRecognizedException  ex) {
                   System.err.println(" no SAX");*/
              } catch (ParserConfigurationException ex) {
                   System.err.println(" ???");
               } catch (IOException ex) {
                   System.err.println("+================================+");
                   System.err.println("|           *XML Error*          |");
                   System.err.println("+================================+");
                   System.err.println(ex.toString());
    private static class JFileChooserrv {
         JFileChooserrv(JFrame f, boolean vverabreiten) {
              String openfile;
              String verror;
              boolean validate = true;
              final JFrame frame = f;
              String vFilename = "Z:\\Boorberg\\parsen_vista\\daten";
              //String vFilename = "C:\\";
              File vFile = new File(vFilename);
              final JFileChooser chooser = new JFileChooser(vFile);
              JFileFilter filter = new JFileFilter();
              filter.addType("xml");
              filter.addType("sgml");
              filter.addType("html");
              filter.addType("java");
              filter.setDescription("strukturfiles");
              chooser.addChoosableFileFilter(filter);
              boolean vjeas = true;
              chooser.setMultiSelectionEnabled(vjeas);
              int returnVal = chooser.showOpenDialog(frame);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
                   //Array  filearry[] = chooser.getSelectedFiles();
                   //if (vFile = chooser.getSelectedFiles()) {
                   //File  file[] = chooser.getSelectedFiles();
                   File  vfile[] = chooser.getSelectedFiles();
                   //String openfile = new String();
                   int vlenght = vfile.length;
                   if (vlenght>1) {
                        int x=0;
                        while (x< vlenght) {
                                  parse(vfile[x], validate);
                                  x = x +1;
                   if (vlenght<=1) {
                        File v2file = chooser.getSelectedFile();
                             parse(v2file, validate);
              } else {
                   System.out.println("You did not choose a filesystem           object.");
         System.exit(0);
    private static class JFileFilter extends javax.swing.filechooser.FileFilter {
         protected String description, vnew;
         protected ArrayList<String> exts = new ArrayList<String>();
         protected boolean vtrue;
         public void addType(String s) {
              exts.add(s);
         /** Return true if the given file is accepted by this filter. */
         public boolean accept(File f) {
              // Little trick: if you don't do this, only directory names
              // ending in one of the extentions appear in the window.
              if (f.isDirectory()) {
                   return true;
              } else if (f.isFile()) {
                   Iterator it = exts.iterator();
                   while (it.hasNext()) {
                        if (f.getName().endsWith((String)it.next()))
                             return true;
              // A file that didn't match, or a weirdo (e.g. UNIX device file?).
              return false;
         /** Set the printable description of this filter. */
         public void setDescription(String s) {
              description = s;
         /** Return the printable description of this filter. */
         public String getDescription() {
              return description;
    private static class MyErrorHandler implements ErrorHandler {
            // Error handler output goes here
            private PrintStream out;
            MyErrorHandler(PrintStream out) {
                this.out = out;
             * Returns a string describing parse exception details
            private String getParseExceptionInfo(SAXParseException spe) {
                String systemId = spe.getSystemId();
                if (systemId == null) {
                    systemId = "null";
                String info = "URI=" + systemId +
                    " Line=" + spe.getLineNumber() +
                    ": " + spe.getMessage();
                return info;
            // The following methods are standard SAX ErrorHandler methods.
            // See SAX documentation for more info.
            public void warning(SAXParseException spe) throws SAXException {
                   //System.exit(0);
                //out.println("Warning: " + getParseExceptionInfo(spe));
            public void error(SAXParseException spe) throws SAXException {
                   //System.exit(0);
                String message = "Error: " + getParseExceptionInfo(spe);
                throw new SAXException(message);
            public void fatalError(SAXParseException spe) throws SAXException {
                   //System.exit(0);
                String message = "Fatal Error: " + getParseExceptionInfo(spe);
                throw new SAXException(message);
         public static void main(String[] av) {
              JFrame vframe = new JFrame("chose files to pars");
              boolean vverabreiten = true;
              boolean validate = true;
              JFileChooserrv vdateienwaehlen = new JFileChooserrv(vframe, vverabreiten);
    }The Stack Trace i posted in the last Message. But i couldn't read it, i am not a programmer.

  • JSTL & Apache Crimson

    Hi, I have been experiencing problems whilst attempting to use the JSTL Standard Tag Library with the Apache Crimson XML Parser in the classpath. I have tried running the JSTL JSP page without Crimson in the classpath and it works fine. However when included in the classpath and I attempt to view the page I get the error below. According to this page:
    http://jakarta.apache.org/taglibs/doc/standard-1.0-doc/GettingStarted.html
    the "Standard Taglib requires a JAXP 1.1 or 1.2 compliant parser". It goes on to list Crimson as an example of this. However the Crimson pages states that it supports "JAXP 1.1 minus the javax.xml.transform package."
    I would simply use another XML parser, except that I am using the Google API Jar which uses Crimson, thus I cannot remove it from the classpath if I wish to continue using the Google API.
    If anyone has any idea how I might solve this problem I'd be keen to hear them,
    Thanks very much,
    Ross Butler
    org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c</h3>
    null: java.lang.IllegalStateException: can't declare any more prefixes in this context
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:72)
    org.apache.jasper.compiler.Validator.validateXmlView(Validator.java:1549)
    org.apache.jasper.compiler.Validator.validate(Validator.java:1495)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:157)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

    the "Standard Taglib requires a JAXP 1.1 or 1.2
    compliant parser". It goes on to list Crimson as an
    example of this. However the Crimson pages states
    that it supports "JAXP 1.1 minus the
    javax.xml.transform package." So what? An XML parser just parses an XML document into some internal representation of the XML. It doesn't do transformations. So what you say there doesn't appear to be relevant to me. It is an example of that.
    I would simply use another XML parser, except that I
    am using the Google API Jar which uses Crimson, thus
    I cannot remove it from the classpath if I wish to
    continue using the Google API.Why not? Does the Google API (I'm not familiar with it) say it MUST use Crimson? I think it's likely that it's distributed with Crimson for the convenience of users who don't have any XML parser (Java 1.3 and earlier users). So if it comes with a separate crimson.jar (or whatever) then just toss that out and see what happens. I didn't notice that being one of the tests you did.
    And if you find that Google API doesn't work with the built-in parser in your JRE, it's possible to specify the parser your environment should use by setting the system property javax.xml.parsers.SAXParserFactory to the full name of Crimson's SAX parser factory and likewise the system property javax.xml.parsers.DocumentBuilderFactory. (You can't do this just for your web application, though, you want your entire web application server to use the same parser or strange things may happen. Like the strange things you are seeing.)

  • Apache Crimson not compatible with JSTL?

    Hi, I have been experiencing problems whilst attempting to use the JSTL Standard Tag Library with the Apache Crimson XML Parser in the classpath. I have tried running the JSTL JSP page without Crimson in the classpath and it works fine. However when included in the classpath and I attempt to view the page I get the error below. According to this page:
    http://jakarta.apache.org/taglibs/doc/standard-1.0-doc/GettingStarted.html
    the "Standard Taglib requires a JAXP 1.1 or 1.2 compliant parser". It goes on to list Crimson as an example of this. However the Crimson pages states that it supports "JAXP 1.1 minus the javax.xml.transform package."
    I would simply use another XML parser, except that I am using the Google API Jar which uses Crimson, thus I cannot remove it from the classpath if I wish to continue using the Google API.
    If anyone has any idea how I might solve this problem I'd be keen to hear them,
    Thanks very much,
    Ross Butler
    org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c</h3>
    null: java.lang.IllegalStateException: can't declare any more prefixes in this context
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:72)
    org.apache.jasper.compiler.Validator.validateXmlView(Validator.java:1549)
    org.apache.jasper.compiler.Validator.validate(Validator.java:1495)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:157)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

    You should not add j2ee.jar to the WEB-INF folder. I think you should move it to "C:\Program Files\Apache Group\Tomcat 4.1\lib\j2ee.jar".
    Also, it might help to read section 9.7.2 in the servlet 2.3 specification (as stated in the error). You can download the spec here: http://www.jcp.org/aboutJava/communityprocess/final/jsr053/

  • Java.lang.NoClassDefFoundError: org/apache/xerces/parsers/SAXParser

    We are trying to evaluate Weblogic 6.1 Beta version.
    We have tried a setup that is working in WebLogic 6.0 sp1 version,
    but the same setup fails in the Beta version.
    We get ...
    java.lang.NoClassDefFoundError:
    org/apache/xerces/parsers/SAXParser
    We had not specified any addl. jars in the classpath
    in 6.0 sp1 version. But this fails in the Beta version.
    Could someone tell if this is a known bug in the Beta release and
    suggest a solution or tell if this will be fixed in the actual version
    when it is
    released in July?
    Thanks.
    -Arvind

    "Jeeva" <[email protected]> wrote in message
    news:3b40ecb5$[email protected]..
    >
    Alternatively u can set the parameters to look at the right parser when uneed
    it. This can be done by:
    System.setProperty("javax.xml.parsers.SAXParserFactory","org.apache.xerces.jaxp.SAXParserFactoryImpl");
    System.setProperty("javax.xml.parsers.DocumentBuilderFactory","org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
    System.setProperty("javax.xml.parsers.SAXParser","org.apache.xerces.jaxp.SAXParserImpl");
    This is far from being recommended for the following reason:
    The JAXP factories cache the classes used to instantiate the factories,
    therefore you cannot changed dynamically these properties at runtime, you
    will have absolutely NO guarantee that this will work. If a factory is
    instantiated before yours, it will use this one. Additionaly, Weblogic
    already defines these properties at startup so that they refer to their own
    factories that can look into the XML registry.
    Consider these properties as being read-only. Chance are that you will mess
    up everything if you modify them.
    If you need to define a specific parser (such as crimson), then put crimson
    in your system classpath and set the XML registry appropriately.
    If you want to take a look at jaxp strategy. Use the JVM
    property -Djaxp.debug=true.
    As well use -Dweblogic.xml.debug=true for Weblogic XML related info.
    Stéphane Bailliez
    Software Engineer, Paris - France
    iMediation - http://www.imediation.com
    Disclaimer: All the opinions expressed above are mine and not those from my
    company.

Maybe you are looking for

  • Where can I find the no-no list?

    As I am learning more and more about app development, it seems a lot of time can be wasted if you don't follow the rules Apple has set forth. I find post here and there about what not to do, such as using private API's, and tried searching in the Dev

  • Variables or parameters in Sender JDBC Adapter.

    Hi, I have the following question: Is there any way to use variables or parameters when specifying the WHERE clause of a SQL SELECT statement or when using a Store Procedure in a Sender JDBC Adapter? If so, can anyone give an example. Thanks in advan

  • Diferent Date Formats

    Hi, I am facing a problem with the date format in the dashboard prompt. The same link shows different date format (dd/mm/yyyy or mm/dd/yyyy) in different systems. is there any way i can have a single format (mm/dd/yyyy) in every system? Thanks in Adv

  • SMS_NOTIFICATION_SERVER process Active Transaction preventing SQL log file backup

    Hello, I have been working on adding a few thousand machines into our SCCM 2012 R2 environment.  Recently after attaching several of these systems there was a spike in activity in the transaction log due to the communication and inventory of these ne

  • Windows 7 computer giving 0x8004fe21 error on a genuine computer

    Hello, i'm posting this for my mother as she as not so tech savvy, the computer has been having this problem for months and it gives no option to activate, we can try to active it through going into the system but each time we do it says "The page fa