Search code examples
jspejb

How do I bind and ejb in Tomcat 9?


I have a fairly old WAR/EAR file that I have been told to migrate from a legacy server onto a new Solaris-based Tomcat 9 install.

I am getting an error in catalina.out :

Exception:An exception has been raised in UserManagerBD constructor:Name [ejb/UserManagerEJB] is not bound in this Context. Unable to find [ejb].

Any ideas how to fix this? I don't have all of the source code available, so re-compiling isn't an option.


Solution

  • Tomcat doesn't provide EJB support:

    Tomcat only provides the Servlet container and a few other APIs, such as JDBC Connection pools (Datasources). It does not provide a transaction manager, EJB container, and other APIS and components from a complete, certified Java EE or Jakarta EE application server.

    Use instead WildFly or TomEE

    The OpenSource project for JBoss EAP is WildFly

    The Apache Foundation also provides TomEE, which is Tomcat + the remaining Java EE APIs and services

    Another option is Installing TomEE using war

    TomEE can be setup by deploying a .war file into an existing Tomcat installation, as opposed to using the all-in-one bundle