You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-user@portals.apache.org by Glen Mazza <gl...@gmail.com> on 2009/06/30 16:55:24 UTC

"Web application descriptor must be a valid web.xml" build error

Hello, I'm repeatedly getting a "Web application descriptor must be a valid
web.xml" error while trying to build a sample HelloWorldPortlet following
the online docs here[1], using the pom.xml supplied and following the folder
structure on that page (i.e. having the web.xml in
"HelloWorldPortlet\src\main\java\webapp\WEB-INF" directory.)  Partial
stacktrace is below.

Eclipse is showing that the web.xml is at least well-formed:

<?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="HelloWorldID">

   <display-name>HelloWorldPortlet</display-name>

   <welcome-file-list>
      <welcome-file>index.html</welcome-file>
   </welcome-file-list>

    <servlet>
        <servlet-name>HelloWorldPortlet</servlet-name>
       
<servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
        <init-param>
            <param-name>portlet-name</param-name>
            <param-value>HelloWorldPortlet</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>HelloWorldPortlet</servlet-name>
        <url-pattern>/PlutoInvoker/HelloWorldPortlet</url-pattern>
    </servlet-mapping>
</web-app>

But even if I delete this web.xml or use another web.xml that I know works
(one from Pluto's portal or testsuite WAR file) I still get this same
error--so I can't tell if there's a problem with the web.xml or simply that
it can't find the web.xml.  Any hints?  Also, is this a Maven war plugin or
Pluto plugin issue--if the latter, I'll enter a JIRA for the error message
to distinguish between "bad web.xml" and "can't find the web.xml" so users
with the latter problem don't need to spend time trying to fix their web.xml
when that's not the problem.

Thanks,
Glen

[1] http://portals.apache.org/pluto/v20/deploying.html

C:\eclipse\workspace\HelloWorldPortlet>mvn clean install -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building HelloWorldPortlet
[INFO]    task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] [pluto2:assemble {execution: default}]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Web application descriptor must be a valid web.xml
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Web application
descript
or must be a valid web.xml
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:703)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:540)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:519)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
-- 
View this message in context: http://www.nabble.com/%22Web-application-descriptor-must-be-a-valid-web.xml%22-build-error-tp24273382p24273382.html
Sent from the Pluto - User mailing list archive at Nabble.com.


Re: "Web application descriptor must be a valid web.xml" build error

Posted by Glen Mazza <gl...@gmail.com>.
No--same error even if I do that, even if I delete the file.  Maybe it's
requiring a 2.4 web.xml (I'm relying on a tutorial sample--I can upgrade
it.)  I'll look into entering a (Maven, apparently) JIRA for a better error
message--I need to know whether it can't find the web.xml, or it can but
there's something wrong with the file.  The troubleshooting you do in each
case is very different.

Thanks,
Glen


Woonsan Ko wrote:
> 
> 
> Hi Glen,
> 
> I see the element definition in the dtd specified in your web.xml as
> follows:
> 
> <!ELEMENT web-app (icon?, display-name?, description?, distributable?,
> context-param*, filter*, filter-mapping*, listener*, servlet*,
> servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
> error-page*, taglib*, resource-env-ref*, resource-ref*,
> security-constraint*,
> login-config?, security-role*, env-entry*, ejb-ref*,  ejb-local-ref*)>
> 
> So, I think you should move down welcome-file-list after servlet-mapping.
> 
> Regards,
> 
> Woonsan
> 
> 
> --- On Tue, 6/30/09, Glen Mazza <gl...@gmail.com> wrote:
> 
>> From: Glen Mazza <gl...@gmail.com>
>> Subject: "Web application descriptor must be a valid web.xml" build error
>> To: pluto-user@portals.apache.org
>> Date: Tuesday, June 30, 2009, 4:55 PM
>> 
>> Hello, I'm repeatedly getting a "Web application descriptor
>> must be a valid
>> web.xml" error while trying to build a sample
>> HelloWorldPortlet following
>> the online docs here[1], using the pom.xml supplied and
>> following the folder
>> structure on that page (i.e. having the web.xml in
>> "HelloWorldPortlet\src\main\java\webapp\WEB-INF"
>> directory.)  Partial
>> stacktrace is below.
>> 
>> Eclipse is showing that the web.xml is at least
>> well-formed:
>> 
>> <?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="HelloWorldID">
>> 
>>    <display-name>HelloWorldPortlet</display-name>
>> 
>>    <welcome-file-list>
>>      
>> <welcome-file>index.html</welcome-file>
>>    </welcome-file-list>
>> 
>>     <servlet>
>>        
>> <servlet-name>HelloWorldPortlet</servlet-name>
>>        
>> <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
>>         <init-param>
>>            
>> <param-name>portlet-name</param-name>
>>            
>> <param-value>HelloWorldPortlet</param-value>
>>         </init-param>
>>        
>> <load-on-startup>1</load-on-startup>
>>     </servlet>
>> 
>>     <servlet-mapping>
>>        
>> <servlet-name>HelloWorldPortlet</servlet-name>
>>        
>> <url-pattern>/PlutoInvoker/HelloWorldPortlet</url-pattern>
>>     </servlet-mapping>
>> </web-app>
>> 
>> But even if I delete this web.xml or use another web.xml
>> that I know works
>> (one from Pluto's portal or testsuite WAR file) I still get
>> this same
>> error--so I can't tell if there's a problem with the
>> web.xml or simply that
>> it can't find the web.xml.  Any hints?  Also, is
>> this a Maven war plugin or
>> Pluto plugin issue--if the latter, I'll enter a JIRA for
>> the error message
>> to distinguish between "bad web.xml" and "can't find the
>> web.xml" so users
>> with the latter problem don't need to spend time trying to
>> fix their web.xml
>> when that's not the problem.
>> 
>> Thanks,
>> Glen
>> 
>> [1] http://portals.apache.org/pluto/v20/deploying.html
>> 
>> C:\eclipse\workspace\HelloWorldPortlet>mvn clean install
>> -e
>> + Error stacktraces are turned on.
>> [INFO] Scanning for projects...
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building HelloWorldPortlet
>> [INFO]    task-segment: [clean, install]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [clean:clean]
>> [INFO] [pluto2:assemble {execution: default}]
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Web application descriptor must be a valid web.xml
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: Web
>> application
>> descript
>> or must be a valid web.xml
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> ultLifecycleExecutor.java:703)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
>> fecycle(DefaultLifecycleExecutor.java:540)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
>> ltLifecycleExecutor.java:519)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
>> dleFailures(DefaultLifecycleExecutor.java:371)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
>> ts(DefaultLifecycleExecutor.java:332)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
>> fecycleExecutor.java:181)
>>         at
>> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>> -- 
>> View this message in context:
>> http://www.nabble.com/%22Web-application-descriptor-must-be-a-valid-web.xml%22-build-error-tp24273382p24273382.html
>> Sent from the Pluto - User mailing list archive at
>> Nabble.com.
>> 
>> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%22Web-application-descriptor-must-be-a-valid-web.xml%22-build-error-tp24273382p24291755.html
Sent from the Pluto - User mailing list archive at Nabble.com.