Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-2067

Wrong URL when hot-deploying @WebService to TomEE+ 1.6.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.6.0
    • 4.7.0
    • deployment
    • None
    • Windows, Linux

    Description

      When deploying a war-file with webservice denoted only
      with @Stateless @WebService annotation (no arguments, and empty web.xml config), there is a problem with hot-deploy in TomEE.

      How to reproduce the error:

      0. Build the simple source-code example below with: mvn install

      1. Start TomEE, and then hot-deploy the war-file. It gets deployed to URL like this
      http://localhost:8080/ws/webservices/App
      which is OK.

      2. Do hot-UNdeploy. Also OK.

      3. Next, hot-deploy the war-file a second time.
      Apparently, it is trying to deploy to a weird URL:
      http://App:80
      which fails of course. I get the Exception below.
      All subsequent hot-deploy attempts will raise the same Exception.

      If you leave the war-file in webapps, and shutdown + restart TomEE, it gets correctly deployed again.

      SEVERE: Error deploying JAX-WS Web Service for EJB App
      java.lang.RuntimeException: Already a destination on http://App:80
      at org.apache.cxf.transport.http.DestinationRegistryImpl.addDestination(DestinationRegistryImpl.java:49)
      at org.apache.cxf.transport.http.AbstractHTTPDestination.activate(AbstractHTTPDestination.java:853)
      at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:49)
      at org.apache.cxf.binding.AbstractBaseBindingFactory.addListener(AbstractBaseBindingFactory.java:97)
      at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:837)
      at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:131)
      at org.apache.openejb.server.cxf.CxfEndpoint.doPublish(CxfEndpoint.java:222)
      at org.apache.openejb.server.cxf.CxfEndpoint.publish(CxfEndpoint.java:161)
      at org.apache.openejb.server.cxf.CxfWsContainer.start(CxfWsContainer.java:51)
      at org.apache.openejb.server.cxf.CxfService.createEjbWsContainer(CxfService.java:83)
      at org.apache.openejb.server.webservices.WsService.deployApp(WsService.java:278)
      at org.apache.openejb.server.webservices.WsService.afterApplicationCreated(WsService.java:224)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.openejb.observer.ObserverManager$Observer.invoke(ObserverManager.java:149)
      at org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:69)
      at org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:108)
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:882)
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
      at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1205)
      at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1051)
      at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:127)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)

      Simple source-code example:

      -------------------------------------
      src/main/java/ws/App.java:
      -------------------------------------
      package ws;
      import javax.ejb.Stateless;
      import javax.jws.WebService;

      @Stateless
      @WebService
      public class App
      {
      public String hello(String name)

      { return "Hello, "+name+"!"; }

      }

      -------------------------------------
      src/main/webapp/WEB-INF/web.xml:
      -------------------------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app 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"
      metadata-complete="false"
      version="2.5">
      </web-app>

      -------------------------------------
      pom.xml:
      -------------------------------------
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>

      <groupId>ws</groupId>
      <artifactId>ws</artifactId>
      <version>1.0-SNAPSHOT</version>
      <packaging>war</packaging>

      <name>ws</name>
      <url>http://maven.apache.org</url>

      <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>

      <build>
      <finalName>ws</finalName>
      </build>

      <dependencies>
      <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>javaee-api</artifactId>
      <version>6.0-5</version>
      </dependency>
      </dependencies>
      </project>

      Attachments

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            rop rop
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: