Skip to Content.
Sympa Menu

mace-opensaml-users - Re: javax.xml.parsers.FactoryConfigurationError

Subject: OpenSAML user discussion

List archive

Re: javax.xml.parsers.FactoryConfigurationError


Chronological Thread 
  • From: Chad La Joie <>
  • To:
  • Subject: Re: javax.xml.parsers.FactoryConfigurationError
  • Date: Sat, 13 Jan 2007 08:03:50 -0500
  • Organization: OIS - Middleware

The error tells you what the problem is, and the install docs tell you how to fix it.

Also, you're not using JAXP in your code but Sun's internal implementation of the JAXP interfaces.


wrote:
Hi,
I have same problems with my code. I expose below my problems:

From a servlet i get two strings "nomeutente" AND "password".

The string "nomeutente" is the argument of the Method
"setNameIdentifier.setName(nomeutente)" of SAMLSubject.

The string "password" is converted in a XML element and this new elemet is the argument
of the Method "setConfirmationData" of the SAMLSubject.

When i run my code in Tomcat i have this error:

"javax.xml.parsers.FactoryConfigurationError: OpenSAML requires an xml parser
that supports DOM3 calls. Sun JAXP 1.3 has been included with this release and is
strongly recommended. If you are using Java 1.4, make sure that you have enabled
the Endorsed Standards Override Mechanism for this parser (see
http://java.sun.com/j2se/1.4.2/docs/guide/standards/ for details)."

I have changed the "JDK 1.4.2" and i have installed the "JDK 1.5" that support "xerces"
with "JAXP 1.3", but i have tha same error.

I hope that you can halp me, because i don't understand where is the problem.

Thank you for your attention.

Best Reagards
Silena Leone

Hereinafter there is my code:

package client;

import client.AutenticazioneServiceLocator;
import com.sun.org.apache.bcel.internal.generic.DUP;
import com.sun.org.apache.xerces.internal.dom.DocumentImpl;
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.net.*;
import org.apache.axis.*;
import org.opensaml.*;
import org.opensaml.*;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import com.sun.org.apache.xerces.internal.jaxp.validation.*;
import com.sun.org.apache.xerces.internal.jaxp.validation.xs.*;
import com.sun.org.apache.xerces.internal.xinclude.*;
import com.sun.org.apache.xerces.internal.dom.*;
import javax.xml.validation.Schema;

import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.*;

import javax.xml.rpc.ServiceException;
import org.w3c.dom.Element;


/**
*
* @author Silena
* @version
*/
public class miaServlet extends HttpServlet {
/** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>MiaServlet</title>");
out.println("<head>");
out.println("<body>");
out.println("</th>");
out.println("<b>Inserisci nomeutente e password per
autenticarti.</b><br><br>");
out.println("<form method=\"post\"
action=\"http://localhost:8080/miaServlet\";>");
out.println("<table border=\"0\">");
out.println("<tr><td>NomeUtente: </td><td>");
out.println("<input type=\"text\" name=\"nomeutente\">");
out.println("</td></tr>");
out.println("<tr><td>Password: </td><td>");
out.println("<input type=\"password\" name=\"password\">");
out.println("</td></tr> ");
out.println("<tr><td colspan=\"2\" align=\"center\">");
out.println("<input type=\"SUBMIT\" value=\"Invia\"></td></tr> ");
out.println("</table></form>");
out.println("</body> ");
out.println("<html>");
/* TODO output your page here
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet miaServlet</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet miaServlet at " + request.getContextPath () +
"</h1>");
out.println("</body>");
out.println("</html>");
*/
out.close();
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/** Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
this.doPost(request,response);
}
/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
String nomeutente;
String password;
PrintWriter out = response.getWriter();
String soggetto = null,risp = null,risultato = null;
if(request.getParameter("nomeutente")==null)
{
this.processRequest(response); } else
{ nomeutente = (String)request.getParameter("nomeutente");
password = (String)request.getParameter("password");
out.println("<center>Argomenti Passati :"+nomeutente+" : "+password+"</center>");
//creo un elemento XML a partire da una stringa//
DocumentBuilderFactory factory = DocumentBuilderFactoryImpl.newInstance();
DocumentBuilder builder;
org.w3c.dom.Document document;
Element confirmationdata;
try { builder = factory.newDocumentBuilder(); document = builder.newDocument();
Element root = (Element) document.createElement("rootElement");
document.appendChild(root); confirmationdata = document.createElement("password");
root.appendChild(confirmationdata);
confirmationdata.setNodeValue(password);
SAMLNameIdentifier nameidentifier = new SAMLNameIdentifier();
SAMLSubject subject = new SAMLSubject(nameidentifier,null,null,null);
nameidentifier.setName("nomeutente");
try {
subject.setNameIdentifier(nameidentifier);
} catch (SAMLException ex) {
ex.printStackTrace();
}
subject.setConfirmationData(confirmationdata);
soggetto = subject.toString();
.
.
.
.


--
Chad La Joie 2052-C Harris Bldg
OIS-Middleware 202.687.0124



Archive powered by MHonArc 2.6.16.

Top of Page