Hi doing your shade you need to exclude META-INF/web-fragment.xml
tomcat is provided with one and this creates by side effect 2 we fragments for the shaded jar. the jasper one (the provided one) is "empty" and just there for scanning so exclusion is fine without any other work. Romain Manni-Bucau @rmannibucau | Blog | Github | LinkedIn | Tomitriber 2016-03-16 1:32 GMT+01:00 ravi <[email protected]>: > Hi, > > I am using tomee embedded-7.0.0-M3 and maven shade to package the > application as executable jar. > > Source available at https://github.com/Ravisankar-Challa/tomee_embedded.git > To create fat jar run the following command > mvn -f tomee-embedded-shade.xml clean package -Dmaven.test.skip > Then run > java -jar target/tomeedemo.jar --as-war > > My application has a simple hello world servlet > > @WebServlet("/helloworld") > public class HelloWorldServlet extends HttpServlet { > @Override > protected void doGet(HttpServletRequest req, HttpServletResponse resp) > throws ServletException, IOException { > resp.getWriter().print("Hello World !!!"); > } > } > > deployment fails with the following error > Caused by: java.lang.IllegalArgumentException: The servlets named > [com.example.servlet.HelloWorldServlet] and > [com.example.servlet.HelloWorldServlet] are both mapped to > the url-pattern [/helloworld] which is not permitted > at > org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:308) > at > org.apache.tomcat.util.descriptor.web.WebXml.merge(WebXml.java:1614) > at > org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1170) > at > org.apache.tomee.catalina.OpenEJBContextConfig.webConfig(OpenEJBContextConfig.java:398) > at > org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:780) > at > org.apache.tomee.catalina.OpenEJBContextConfig.configureStart(OpenEJBContextConfig.java:119) > at > org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305) > at > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95) > at > org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) > at > org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154) > at > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) > > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/WebServlet-Tomee-Embedded-Shade-Deployment-fails-tp4677909.html > Sent from the TomEE Users mailing list archive at Nabble.com.
