We help IT Professionals succeed at work.

exception running a webapp from an ant build

dionisio_79
dionisio_79 used Ask the Experts™
on
Hi Experts,
I've got the following error message in my glassfish server running a sample builded with apache ant tool and opened with netbeans ide:

 Error occurred during deployment: Exception while deploying the app [guestbook] : org.xml.sax.SAXParseException: Attribute "xmlns" must be declared for element type "web-app".. Please see server.log for more details.
C:\facebook-java-api-3.0.1\lib\appengine-java-sdk-1.5.2\demos\guestbook\nbproject\build-impl.xml:765:
The module has not been deployed.
      at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:187)
      at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:106)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
      at sun.reflect.GeneratedMethodAccessor159.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:390)
      at org.apache.tools.ant.Target.performTasks(Target.java:411)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
      at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)
      at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
      at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
BUILD FAILED (total time: 34 seconds)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Awarded 2011
Awarded 2011

Commented:


Does  your web.xml file conatins this line:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee">

Author

Commented:
yes, it does:

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

remove version="2.5"
Awarded 2011
Awarded 2011
Commented:

check file templates for web.xml for Servlet 2.3, 2.4, 2.5
http://dominikdorn.com/2010/03/web-xml-web-fragment-xml-2-3-2-4-2-5-3-0/

Author

Commented:
thanks a lot, I used a <web-app> tag without attributes