This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem installing WAR file into WAS5.0

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Was wondering if anyone could hekp here. I have created a WAR file for a project using Netbeans 5.0 (beta). The WAR file seems fine but whe i try to install it into Websphere I get a nasty looking error:

...Document root element "web-app", must match DOCTYPE root "null"...

Could anyone help please.

Web.xml:
--------
<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"<br /> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br /> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee"<br /> version="2.4">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
<welcome-file>
index.html
</welcome-file>
<welcome-file>
index.htm
</welcome-file>
</welcome-file-list>
</web-app>


Full error message:
-------------------
com.ibm.etools.archive.exception.DeploymentDescriptorLoadException: WEB-INF/web.xml
Stack trace of nested exception:
com.ibm.etools.archive.exception.ResourceLoadException: IWAE0007E Could not load resource "WEB-INF/web.xml" in archive "C:\Program Files\WebSphere\AppServer\wstemp\kadmin\upload\DAM.war"
Stack trace of nested exception:
com.ibm.etools.j2ee.exception.WrappedRuntimeException: IWAE0099E An Exception occurred while parsing xml: Line #: 6 :Column #: 17
Stack trace of nested exception:
org.xml.sax.SAXParseException: Document root element "web-app", must match DOCTYPE root "null".
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:235)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:209)
at com.ibm.etools.j2ee.xml.bridge.GeneralXmlDocumentReader.parse(GeneralXmlDocumentReader.java:198)
at com.ibm.etools.j2ee.xml.bridge.GeneralXmlDocumentReader.parseDocument(GeneralXmlDocumentReader.java:221)
at com.ibm.etools.j2ee.xml.DeploymentDescriptorImportExport.primImportFrom(DeploymentDescriptorImportExport.java:250)
at com.ibm.etools.j2ee.xml.DeploymentDescriptorImportExport.primImportFrom(DeploymentDescriptorImportExport.java:239)
at com.ibm.etools.j2ee.xml.WarDeploymentDescriptorImportExport.importFrom(WarDeploymentDescriptorImportExport.java:56)
at com.ibm.etools.webapplication.impl.WebAppResourceFactory.importXML(WebAppResourceFactory.java:30)
at com.ibm.etools.j2ee.common.impl.XMLResourceFactory.load(XMLResourceFactory.java:68)
at com.ibm.etools.j2ee.common.impl.XMLResourceFactory.load(XMLResourceFactory.java:84)
at com.ibm.etools.emf.resource.impl.ResourceFactoryImpl.load(ResourceFactoryImpl.java:77)
at com.ibm.etools.emf.resource.impl.ResourceSetImpl.load(ResourceSetImpl.java:289)
at com.ibm.etools.archive.impl.LoadStrategyImpl.getMofResource(LoadStrategyImpl.java:222)
at com.ibm.etools.commonarchive.impl.ArchiveImpl.getMofResource(ArchiveImpl.java:528)
at com.ibm.etools.commonarchive.impl.ModuleFileImpl.getDeploymentDescriptorResource(ModuleFileImpl.java:65)
at com.ibm.etools.archive.impl.XmlBasedImportStrategyImpl.primLoadDeploymentDescriptor(XmlBasedImportStrategyImpl.java:35)
at com.ibm.etools.archive.impl.War22ImportStrategyImpl.loadDeploymentDescriptor(War22ImportStrategyImpl.java:72)
at com.ibm.etools.archive.impl.War22ImportStrategyImpl.importMetaData(War22ImportStrategyImpl.java:67)
at com.ibm.etools.commonarchive.impl.WARFileImpl.getDeploymentDescriptor(WARFileImpl.java:201)
at com.ibm.etools.commonarchive.impl.WARFileImpl.getStandardDeploymentDescriptor(WARFileImpl.java:450)
at com.ibm.etools.commonarchive.impl.ArchiveCopyUtility.copy(ArchiveCopyUtility.java:89)
at com.ibm.etools.commonarchive.impl.CommonarchiveFactoryImpl.copy(CommonarchiveFactoryImpl.java:126)
at com.ibm.etools.commonarchive.impl.EARFileImpl.primAddCopyRef(EARFileImpl.java:169)
at com.ibm.etools.commonarchive.impl.EARFileImpl.addCopyRef(EARFileImpl.java:186)
at com.ibm.ws.management.application.client.AppInstallHelper.createEarWrapper(AppInstallHelper.java:466)
at com.ibm.ws.console.appmanagement.action.UploadAction.formUpload(UploadAction.java:181)
at com.ibm.ws.console.appmanagement.action.UploadAction.perform(UploadAction.java:99)
at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1791)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java(Compiled Code))
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi K,

Looks like the start of your web.xml file is a big screwy.
Here's an example that WSAD created itself (so is happy with):
<?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">;
<web-app id="MyWebApp">........

Sorry if its just that my example is using dtds & yours is using schemas - I don't know much about them.

Also, if yours is a schema version of mine, it doesn't look properly formed:


<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee";
version="2.4">


The closing tag I've bold-ified doesn't seem to have an opening tag to match. Maybe this was just a cut & paste mistake?
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic