2

I am trying to set up TomEE (7.0.2) with multiple virtual hosts for development and testing environments, the same applications will usually be deployed to all hosts. I discovered from this post how to avoid the JNDI naming conflicts, which largely solved the problem of failed deployments, but I have several other issues now.

The first problem is that I still get the following severe errors in the log, although they don't seem to affect the running apps, I'm not sure how to get rid of them:

SCHWERWIEGEND - Jndi(name=global/webspi/DefaultStoredProcedureResolver) cannot be bound to Ejb(deployment-id=1774342742/ger400-q/2-webspi/webspi/DefaultDatasourceConnectorService).  Name already taken by Ejb(deployment-id=-1143530541/ger400-t/1-webspi/webspi/DefaultStoredProcedureResolver

The second problem is that one WAR file will not deploy to one of the hosts (ger400-d below) unless it is renamed first. It will deploy to all the others with no problem. The log message generated is this:

SCHWERWIEGEND - Error merging Java EE JNDI entries in to war /webspi: Exception: null java.lang.NullPointerException

Appending an "x" or whatever to the WAR file name makes it deploy correctly, albeit to the wrong path name.

The final issue is that stopping or undeploying one instance of the app, breaks all the other running instances, it seems that the Jax RS filters are being disturbed somehow:

    javax.servlet.ServletException: Error processing webservice request
        org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:98)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
        org.webspi.CORSFilter.doFilter(CORSFilter.java:61)
root cause
java.lang.NullPointerException
        org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:252)
        org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:251)
        org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
        org.webspi.CORSFilter.doFilter(CORSFilter.java:61)

The relevant part of server.xml is

  <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
  </Host>
  <Host name="ger400-d"  appBase="/usr/tomee-webapps/d" unpackWARs="true" autoDeploy="true">
    <Alias>ger400-d.ourcompany.com</Alias>
  </Host>
  <Host name="ger400-t"  appBase="/usr/tomee-webapps/t" unpackWARs="true" autoDeploy="true">
    <Alias>ger400-t.ourcompany.com</Alias>
  </Host>
  <Host name="ger400-q"  appBase="/usr/tomee-webapps/q" unpackWARs="true" autoDeploy="true">
    <Alias>ger400-q.ourcompany.com</Alias>
  </Host>
  <Host name="ger400-r"  appBase="/usr/tomee-webapps/r" unpackWARs="true" autoDeploy="true">
    <Alias>ger400-r.ourcompany.com</Alias>
  </Host>

Any ideas what could be wrong?

Community
  • 1
  • 1
Tim
  • 125
  • 1
  • 8

1 Answers1

0

I also had this problem, but being new to Tomee, I didn't know that there is a simple solution. When I deployed my web app to the webapps folder, the app worked fine, but when I deployed it to a service folder, I got the same abort. The problem was that the folder name did not match the war name (minus the .war). Once I fixed that, the app worked fine. Make sure the war name, folder name and service name are identical.

Jim Reitz
  • 41
  • 3
  • Thanks for the reply. I gave up on the idea in the end as I also got other problems where the multiple apps would interfere so I decided to run three independent instances of TomEE and reverse proxy to the right one. – Tim Dec 14 '17 at 20:24