Error deploying webapp created in Netbeans

Hi,

I've created a fairly simple webapp in Netbeans which I have successfully deployed to Tomcat and the Sun Java Application Server.

However when I tried to deploy it to Sun Java System Web Server, I'm getting an error. The error log shows the following:

[15/Jun/2007:16:35:21] warning ( 5936): WEB9200: sun-web.xml DTD Version withpublic ID = [-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN] and system ID = [http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd] not found in the local respository. Using DTD version with system ID = [http://www.sun.com/software/dtd/appserver/sun-web-app_2_4-1.dtd] instead.

[15/Jun/2007:16:35:21] failure ( 5936): PWC3014: Parse error in application web.xml

org.xml.sax.SAXException: Unable to find local schemafor web-app_2_5.xsd

at org.apache.catalina.util.SchemaResolver.resolveEntity(SchemaResolver.java:159)

at com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:148)

at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:701)

at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(XMLSchemaLoader.java:599)

at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2454)

at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1807)

at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)

...

The start of my web.xml looks like this:

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

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

I'm not really sure what's going on - any suggestions?

Many thanks,

Andrew.

[2305 byte] By [am2605a] at [2007-11-27 7:47:06]
# 1

To answer my own question - probably helps when you read the sticky thread first - http://forum.java.sun.com/ann.jspa?annID=11

It looks like my problem was caused by two issues.

Firstly I had initially created the Netbeans project to use Sun Java System Application Server, which meant that the sun-web.xml file had this doctype which was not recognised by SJSWS:

<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems,

Inc.//DTD Application Server 9.0 Servlet

2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-

app_2_5-0.dtd">

Correspondingly the web.xml also had an invalid reference to version 2.5:

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

Creating a new project from scratch fixed the problems.

Regards,

Andrew.

am2605a at 2007-7-12 19:28:09 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

Sun Web Server 7.0 supports Server 2.4. Your web.xml is based on Servlet 2.5 hence the error. Try building J2EE1.4 compliant application in NetBeans, it will work on Web Server 7.0.

Alternatively, download the latest and greatest Sun Java System Web Server 7.0 Update 1 from http://www.sun.com/download/products.xml?id=467713d6

This supports Servlet 2.5, JSP2.1, JSTL 1.2 and more.

You don't need to make any change to your application.

kmeduria at 2007-7-12 19:28:09 > top of Java-index,Web & Directory Servers,Web Servers...