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\l ib\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(Servlet ContextEve nt sce)
{
ServletContext sc = sce.getServletContext();
ServletRegistration.Dynami c dynamic = sc.addServlet("bwRobotRequ estHandler ", RobotRequestHandler.class) ;
dynamic.addMapping("/Robot RequestHan dler");
dynamic.setLoadOnStartup(1 );
}
public void contextDestroyed(ServletCo ntextEvent sce) { }
}
web.xml
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
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(Servlet
{
ServletContext sc = sce.getServletContext();
ServletRegistration.Dynami
dynamic.addMapping("/Robot
dynamic.setLoadOnStartup(1
}
public void contextDestroyed(ServletCo
}
web.xml
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It turned out to be so simple!
ASKER