wood burning stoves*
The moose likes BEA/Weblogic and the fly likes Servlet Deployment Problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Servlet Deployment Problem." Watch "Servlet Deployment Problem." New topic
Author

Servlet Deployment Problem.

R.A.Partha sarathy
Greenhorn

Joined: Sep 30, 2003
Posts: 9
hi all
i have servlet which read a small xml file and prints its values.but while deploying this on weblogic 8.1 it gives me the following exception.pls help me.
Exception:weblogic.management.ApplicationException: Prepare failed. Task Id = 1 Module: sarathy Error: [HTTP:101179][HTTP] Error occurred while parsing descriptor in Web application "C:\Documents and Settings\210455\Desktop\Sarathy\sarathy.war" [Path="C:\Documents and Settings\210455\Desktop\Sarathy", URI="sarathy.war" org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271) at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201) at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:678) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) --------------- nested within: ------------------ Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:683) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271) at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201) at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:678) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) --------------- nested within: ------------------ Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:683) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
[Deployer:149033]preparing application sarathy on myserver
[Deployer:149033]failed application sarathy on myserver
[Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application sarathy on myserver.: Exception:weblogic.management.ApplicationException: Prepare failed. Task Id = 1 Module: sarathy Error: [HTTP:101179][HTTP] Error occurred while parsing descriptor in Web application "C:\Documents and Settings\210455\Desktop\Sarathy\sarathy.war" [Path="C:\Documents and Settings\210455\Desktop\Sarathy", URI="sarathy.war" org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271) at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201) at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:678) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) --------------- nested within: ------------------ Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:683) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271) at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201) at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:678) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) --------------- nested within: ------------------ Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:683) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) .
XML File :
<?xml version="1.0" standalone="yes" ?>
<ADDRESSBOOK>
<PERSON>
<LASTNAME>Idris</LASTNAME>
<FIRSTNAME>Nazmul</FIRSTNAME>
<COMPANY>The BEan Factory, LLC.</COMPANY>
<EMAIL>xml@beanfactory.com</EMAIL>
</PERSON>
<PERSON>
<LASTNAME>Miyamato</LASTNAME>
<FIRSTNAME>Musahi</FIRSTNAME>
<COMPANY>Bushido, Inc.</COMPANY>
<EMAIL>katana@bushido.com</EMAIL>
</PERSON>
</ADDRESSBOOK>
Java Program :
import java.io.*;
import org.w3c.dom.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.xerces.parsers.DOMParser;
public class ParseXMlUsingDom extends HttpServlet
{
public static final String ELEMENT_TAG="PERSON";
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException
{
PrintWriter out = res.getWriter();
res.setContentType("text/html");
try
{
DOMParser ps = new DOMParser();
ps.parse("SAMPLE.XML");
Document doc = ps.getDocument();
NodeList rows =doc.getDocumentElement().
getElementsByTagName (ELEMENT_TAG);
int size=rows.getLength();
for(int i=0;i<size;i++)
{
Element row = (Element)rows.item(i);
out.println(getValue(row,"LASTNAME"));
out.println(getValue(row,"FIRSTNAME"));
out.println(getValue(row,"EMAIL"));
out.println(getValue(row,"COMPANY"));
out.println("\n");
}
}
catch(Exception e)
{
System.out.println("error:"+ e);
}
}
private String getValue(Element e,String tagName)
{
try
{
NodeList elements=e.getElementsByTagName(tagName);
Node node=elements.item(0);
NodeList nodes=node.getChildNodes();
return((Node)nodes.item(0)).getNodeValue();
}
catch(Exception e1)
{
System.out.println(e1);
}
return null;
}
}
Karthi Bala
Ranch Hand

Joined: Jul 27, 2001
Posts: 48
Try to check the validity of the Deployment Descriptor for the web application using weblogic builder before deploying the web application into the weblogic server.


Karthi Bala<br />SCJP 1.2, SCWCD 1.3, SCWCD 1.4, SCDJWS (Awaiting Result)<br /> <br />Where there is a will,there is a WAY.
h Huang
Greenhorn

Joined: Mar 09, 2005
Posts: 2
It seems a bug of weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271)
try this:
import java.io.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Reader reader = new FileReader("SAMPLE.XML");
InputSource source = new InputSource(reader);
Document doc = db.parse(source);

I encounter this problem:
org.xml.sax.SAXParseException: Invalid encoding name "GBK"
and the above solves the problem.
Naveena Kotte
Greenhorn

Joined: Jan 23, 2006
Posts: 2
Originally posted by R.A.Partha sarathy:
hi all

i have servlet which read a small xml file and prints its values.but while deploying this on weblogic 8.1 it gives me the following exception.pls help me.

Exception:weblogic.management.ApplicationException: Prepare failed. Task Id = 1 Module: sarathy Error: [HTTP:101179][HTTP] Error occurred while parsing descriptor in Web application "C:\Documents and Settings\210455\Desktop\Sarathy\sarathy.war" [Path="C:\Documents and Settings\210455\Desktop\Sarathy", URI="sarathy.war" org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271) at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201) at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:678) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) --------------- nested within: ------------------ Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:683) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271) at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201) at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:678) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) --------------- nested within: ------------------ Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:683) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

[Deployer:149033]preparing application sarathy on myserver
[Deployer:149033]failed application sarathy on myserver
[Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application sarathy on myserver.: Exception:weblogic.management.ApplicationException: Prepare failed. Task Id = 1 Module: sarathy Error: [HTTP:101179][HTTP] Error occurred while parsing descriptor in Web application "C:\Documents and Settings\210455\Desktop\Sarathy\sarathy.war" [Path="C:\Documents and Settings\210455\Desktop\Sarathy", URI="sarathy.war" org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271) at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201) at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:678) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) --------------- nested within: ------------------ Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:683) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271) at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201) at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:678) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) --------------- nested within: ------------------ Received SAXParseException from Sun Parser at line 1, column 1: org.xml.sax.SAXParseException: Content is not allowed in prolog. at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:683) at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:694) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:269) at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:220) at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:524) at weblogic.j2ee.J2EEApplicationContainer.loadDescriptors(J2EEApplicationContainer.java:1359) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1184) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) .

XML File :
<?xml version="1.0" standalone="yes" ?>
<ADDRESSBOOK>
<PERSON>
<LASTNAME>Idris</LASTNAME>
<FIRSTNAME>Nazmul</FIRSTNAME>
<COMPANY>The BEan Factory, LLC.</COMPANY>
<EMAIL>xml@beanfactory.com</EMAIL>
</PERSON>
<PERSON>
<LASTNAME>Miyamato</LASTNAME>
<FIRSTNAME>Musahi</FIRSTNAME>
<COMPANY>Bushido, Inc.</COMPANY>
<EMAIL>katana@bushido.com</EMAIL>
</PERSON>
</ADDRESSBOOK>

Java Program :
import java.io.*;
import org.w3c.dom.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.xerces.parsers.DOMParser;

public class ParseXMlUsingDom extends HttpServlet
{
public static final String ELEMENT_TAG="PERSON";

public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException
{
PrintWriter out = res.getWriter();
res.setContentType("text/html");

try
{
DOMParser ps = new DOMParser();
ps.parse("SAMPLE.XML");
Document doc = ps.getDocument();
NodeList rows =doc.getDocumentElement().
getElementsByTagName (ELEMENT_TAG);
int size=rows.getLength();
for(int i=0;i<size;i++)
{
Element row = (Element)rows.item(i);
out.println(getValue(row,"LASTNAME"));
out.println(getValue(row,"FIRSTNAME"));
out.println(getValue(row,"EMAIL"));
out.println(getValue(row,"COMPANY"));
out.println("\n");
}
}
catch(Exception e)
{
System.out.println("error:"+ e);
}
}
private String getValue(Element e,String tagName)
{
try
{
NodeList elements=e.getElementsByTagName(tagName);
Node node=elements.item(0);
NodeList nodes=node.getChildNodes();
return((Node)nodes.item(0)).getNodeValue();
}
catch(Exception e1)
{
System.out.println(e1);
}
return null;
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Deployment Problem.
 
Similar Threads
Exception while deploying in Weblogic 8.1
Servlet Deployment Problem
problem in deploying
Please help: weblogic. xml .dom .ChildCountException
ChildCountException