0

Duplicate URL mapping : Websphere 8.5.5 and ZK 8.6.0

asked 2019-10-03 18:23:54 +0800

vickychan gravatar image vickychan
31

We are trying to upgrade existing webapp from ZK 6.5.4 to ZK 8.6.0 under WebSphere 8.5.5.12. As WebSphere 8.5.5 support servlet 3.0, we upgraded web.xml version and the following ZK servlet config:

<servlet>
    <description>
    The ZK loader for ZUML pages</description>
    <servlet-name>zkLoader</servlet-name>
    <servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
    <init-param>
        <param-name>update-uri</param-name>
        <param-value>/zkau</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet>
    <description>
    The asynchronous update engine for ZK</description>
    <servlet-name>auEngine</servlet-name>
    <servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>zkLoader</servlet-name>
    <url-pattern>*.zul</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>zkLoader</servlet-name>
    <url-pattern>*.zhtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>auEngine</servlet-name>
    <url-pattern>/zkau/*</url-pattern>
</servlet-mapping>

However, Eclipse cannot build the project with the following errors:

  1. Duplicate URL mapping *.zhtml
  2. Duplicate URL mapping *.zul
  3. Duplicate URL mapping /zkau/*

Please advise the settings need to upgrade ZK to support servlet 3.0. Thanks.

delete flag offensive retag edit

2 Replies

Sort by » oldest newest

answered 2019-10-28 11:59:07 +0800

vickychan gravatar image vickychan
31

Thanks for your information. i have set 'metadata-complete="true"' and remvoe the maven dependency and it works now. Thanks.

link publish delete flag offensive edit

answered 2019-10-04 15:25:41 +0800

cor3000 gravatar image cor3000
6280 2 7

Since you didn't post your whole web.xml or the complete maven dependencies you are using, I assume your server finds both configurations the one you provide in your web.xml and the one already included in zk, since 8.6.0 in the zkwebfragment dependency https://mavensync.zkoss.org/maven2/org/zkoss/zk/zkwebfragment/

In order to fix those "duplicate URL mapping ..." errors, you have pick only one configuration method.

Either leave the configuration out of your web.xml:

https://www.zkoss.org/wiki/ZK%20Installation%20Guide/ZK%20Background/Sample%20of%20web.xml%20for%20Servlet%203.0

Or specify metadata-complete="true" to prevent the server from scanning for webfragments.

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1"
         metadata-complete="true"
         >

Or 3rd:

exclude the maven dependency for webfragment (possible since 8.6.0)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2019-10-03 18:23:54 +0800

Seen: 8 times

Last updated: Oct 28 '19

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More