Hello everyone,
I am having problem with loader constraint violation. I am using jboss-5.0.1.GA with JDK 1.6. The server starts normally with welcome page of my application but when I start to login through that page, there occurs problem which is given below:
exception javax.servlet.ServletException: Servlet.init() for servlet controller threw exception org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) root cause java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.parsers.DocumentBuilder.parse(Lorg/xml/sax/InputSource;)Lorg/w3c/dom/Document;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, np/com/remitron/admin/utility/Config, and the class loader (instance of <bootloader>) for resolved class, javax/xml/parsers/DocumentBuilder, have different Class objects for the type org/xml/sax/InputSource used in the signature np.com.remitron.admin.utility.Config.init(Config.java:33)
protected void init(ServletContext sctx,String xmlFile) throws Exception { InputStream is=null; try { is=sctx.getResourceAsStream(xmlFile); DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance(); DocumentBuilder builder=factory.newDocumentBuilder(); Document doc=builder.parse(new InputSource(is)); root=doc.getDocumentElement(); } finally{ if(is!=null) { is.close(); } } }