Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found

843841May 15 2006 — edited May 18 2006
i am running Java Sun System Web Server 6.1 SP5 on Windows Server 2003.

i have deployed a 3rd party web application and it works properly. i have also written and deployed my own servlet/struts web application that works properly. the 3rd party application allows for some customization (i.e., you can add links in that application to point to other locations). i have added a link that points from the 3rd party web application to my own web application.

the problem occurs when i do the following steps (in this exact order):
1. deploy MY war file on the web server.
2. bounce the web server.
3. access the 3rd party application in a web browser.
4. click on a link in the 3rd party application that points to MY application.

at this point i get an error (see the stack trace at the end of this posting). the weird thing is that i DO NOT get this error if i access MY application BEFORE attempting to access the 3rd party application.

the 3rd party application has included the following jars (among others) in /WEB-INF/lib:
xercesImpl.jar, xml-apis.jar, saxon.jar, saxon-jdom.jar

i've looked around the web, and there is mention of incompatible xerces classes. i tried to add the aforementioned jars to MY /WEB-INF/lib directory to see if that would help, but it does not. i am at a loss of how to fix this...HELP!!!

stack trace:
javax.servlet.ServletException: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:387)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:772)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:471)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:382)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:787)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
----- Root Cause -----
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:99)
at org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:194)
at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:287)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:219)
at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1220)
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:802)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:125)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1157)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1115)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1111)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:239)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:227)
at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.loadJSP(JspServlet.java:778)
at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.access$000(JspServlet.java:636)
at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:413)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:772)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:471)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:382)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
at org.apache.struts.action.RequestProcessor.processForwardConfig

Comments

darrylburke
Probably not very efficient, but seems to work ... fairly clean imho :-)
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.SwingUtilities;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.plaf.basic.BasicTextPaneUI;
import javax.swing.text.BadLocationException;

public class LineHighlightTextPane {
   
   public LineHighlightTextPane () {
   }
   
   void makeUI () {
      
      JTextPane textPane = new JTextPane ();
      textPane.setUI (new LineHighlightTextPaneUI (textPane));
      
      JScrollPane scrollPane = new JScrollPane (textPane);
      
      JFrame frame = new JFrame ("Line Highlight Text Pane");
      frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
      frame.setSize (300, 300);
      
      frame.add (scrollPane, BorderLayout.CENTER);
      frame.setVisible (true);
   }
   
   public static void main (String[] args) {
      SwingUtilities.invokeLater (new Runnable () {
         public void run () {
            new LineHighlightTextPane ().makeUI ();
         }
      });
   }
}

class LineHighlightTextPaneUI extends BasicTextPaneUI {
   
   JTextPane tc;
   
   LineHighlightTextPaneUI (JTextPane t) {
      
      tc = t;
      tc.addCaretListener (new CaretListener () {
         public void caretUpdate (CaretEvent e) {
            
            tc.repaint ();
         }
      });
   }
   
   @Override
   public void paintBackground (Graphics g) {
      
      super.paintBackground (g);
      
      try {
         Rectangle rect = modelToView(tc, tc.getCaretPosition ());
         int y = rect.y;
         int h = rect.height;
         g.setColor (Color.YELLOW);
         g.fillRect (0, y, tc.getWidth (), h);
      } catch (BadLocationException ex) {
         ex.printStackTrace();
      }
   }
}
Is that what you wanted or have I misread the requirement?

db
camickr
Or some code that should work on any JTextComponent:

http://www.discoverteenergy.com/files/LinePainter.java
843806
Thanks a lot for the help guys! I was able to do exactly what I needed.
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 15 2006
Added on May 15 2006
4 comments
8,938 views