Link to home
Start Free TrialLog in
Avatar of johnjbarryjr
johnjbarryjr

asked on

Java application windows not visible under Tomcat7

For years we have been using the (now deprecated) invoker servet in Tomcat 6 to launch our Java application.  When RobotRequestHandler.init(...) is called in our Java application, it instantiates our main class which displays the windows we use to monitor incoming requests.  I attached our web.xml file for reference.

We are dealing with the elimination of the invoker servet in Tomcat 7.

For Tomcat 7, we added the annotated web listener shown below, which is being called when starting Tomcat 7. We know our application is running by observing logging from its main event loop.

The problem is that none of our AdPerks.jar windows are visible under Tomcat 7!

Our application is C:\Tomcat7\webapps\adperks\WEB-INF\lib\AdPerks.jar and works fine when it is launched outside of Tomcat 7 (by simply double-clicking AdPerks.jar).

We also verified that the same AdPerks.jar running under Tomcat 6 still displays our windows.

What is causing our (JFrame) windows to not be visible when running under Tomcat 7?

@WebListener
public class InvokerListener implements ServletContextListener
{
      public void contextInitialized(ServletContextEvent sce)
      {
            ServletContext sc = sce.getServletContext();

            ServletRegistration.Dynamic dynamic = sc.addServlet("bwRobotRequestHandler", RobotRequestHandler.class);

            dynamic.addMapping("/RobotRequestHandler");
            dynamic.setLoadOnStartup(1);
      }

      public void contextDestroyed(ServletContextEvent sce) { }
}
web.xml
Avatar of johnjbarryjr
johnjbarryjr

ASKER

If someone would be kind enough to post a comment about why this question has been avoided for over a week, perhaps that alone would give us some ideas.
ASKER CERTIFIED SOLUTION
Avatar of johnjbarryjr
johnjbarryjr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It turned out to be so simple!