Newbie question: Installing Java EE
Hello all, Recently, I downloaded Java EE with the SDK. When I went to install it, it could not find the Java Run-time, the JRE. I have Java SE with the JDK installed and have used Java on my system. When I installed Java SE it included the JRE. Perhaps the problem is that I have Java SE 1.7u51 and the latest version of Java EE is 1.7u45, I believe. So, I guess when installing Java EE, the installer expects you to already have the Java Run time installed? Next question is with regard to the server. Is there any reason one would run both Tomcat and Glass-Fish server? I'm not really sure what the differences between these two are. Also, there is the issue of ports. When I installed Tomcat it runs on port 8080 (and a couple other ports). In a production environment one doesn't typically see the port specified in a link. Do we serve web pages using Tomcat on port 80 in a production environment or how is this handled? You can't have two servers running on the same machine using the same port. Thanks, Bruce Bruce M Whealton Web/ App/Software Developer with skills in Web Design http://futurewavewebdevelopment.com Online resume: http://futurewavewebdevelopment.com/myinfo/bw-cv-resume Call or Text: 919-714-9993 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Websocket stopped working on tomcat 7.0.50
I had recently implemented websocket on tomcat 7.0.50. my tomcat runs behind apache 2.4. I use Strtus 2 and Spring Security. It has stopped working. Problem : Websocket connection is opened successfully. Javascript event handler get fires successfully. Apache logs show that request was accepted as an protocol upgrade request with 101 code Tomcat access logs also show the same code 101 for protocol upgrade However on server side onOpen message is not fired. I tried sending the message as soon as connection is opened in javascript's event handler.. There is no error in javascript but Server side endPoint's onmessage is never called just like onOpen is never called. Here are the changes I made after which it has stopped working: Windows Host file : I use dummy host name through Windows host file: 127.0.0.1phasingapp.com 127.0.0.1pricer.com URL of wesocket : old : ws://localhost:86/websocket/filuploadtrackerendpoint new : ws://phasingapp.com:86/websocket/filuploadtrackerendpoint Added virtual host config for apache : Location /jkweb/websocket/ Require host phasingapp.com granted /Location JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb/ Struts 2 : changed url pattern for Struts 2 filter from .action to /* . Also added exclusion filters to strtus2 for webscoket urls : constant name=struts.action.excludePattern value=.*websocket/.*/ Everything seems to be working fine as i am gettting no error anywhere in apache,tomcat,spring security and Struts2 logs. However on server side no handlers are called? Earlier I had faced similar problem but it was because I had put websocket-api jar in my WEB-INF/lib which was preventing websocket connection from getting opened. No connection is opened but no handler is called after that and after some time connection is closed obviously because of timout I suppose. Here is my ServerEndPoint class : package com.jkweb.websocket; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.websocket.EndpointConfig; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @ServerEndpoint(value=/websocket/fileuploadtracker) public class FileUploadTrackerEndPoint{ private static final Logger logger = LoggerFactory .getLogger(FileUploadTrackerEndPoint.class); private static HashMapString,Session socketConnectionMap = newHashMapString,Session(); @OnOpen public void open(Session session) { MapString,ListString paramMap = session.getRequestParameterMap(); ListString uniqueTockenValues = paramMap.get(uniqueTocken); if(uniqueTockenValues != null uniqueTockenValues.size() 0){ socketConnectionMap.put(uniqueTockenValues.get(0),session); } } @OnMessage public void onMessage(Session session, String msg) { try { session.getBasicRemote().sendText(msg); } catch (IOException e) { logger.error(e.getMessage()); } } public static void sendMessage(String uniqueTocken,String msg){ try { Session wsSession = socketConnectionMap.get(uniqueTocken); wsSession.getBasicRemote().sendText(msg); } catch (IOException e) { logger.error(e.getMessage()); } } } and my javascript code : createFileUploadWebSocket : function(){ var that = this; var uniqueTocken = $(#uniqueTocken).val(), wsurl = ws://phasingapp.com:86/jkweb/websocket/fileuploadtracker?uniqueTocken=+uniqueTocken, ws; ws = new WebSocket(wsurl); ws.onopen = function() { alert(opened..) //I get this aler sothis is called ws.send(test);//however this has not effect ...no error but server end point is not called }; ws.onmessage = function (evt) { message = evt.data; if(message == Done.){ alert(closing..); ws.close(); $('#progressbar').progressbar('option','value',100); } var currentVal =
Re: Websocket stopped working on tomcat 7.0.50
127.0.0.1 - - [01/Mar/2014:14:20:12 +0530] GET /jkweb/js/angle/addAngle.js?_=1393663610411 HTTP/1.1 200 4278 127.0.0.1 - - [01/Mar/2014:14:20:41 +0530] GET /jkweb/angle/validateDuplicateAngleName.action?angleName=angle7 HTTP/1.1 200 - phasingapp.com - - [01/Mar/2014:14:21:15 +0530] GET /jkweb/websocket/fileuploadtracker?uniqueTocken=9c9e740c-7171-4c33-bc92-e0a46cb2d2b5 HTTP/1.1 101 - Above is the relevant log section of apache : could it be the cause that websocket request is coming from phasingapp.com and others from 127.0.01 On Sat, Mar 1, 2014 at 1:53 PM, J Java jforjava1...@gmail.com wrote: I had recently implemented websocket on tomcat 7.0.50. my tomcat runs behind apache 2.4. I use Strtus 2 and Spring Security. It has stopped working. Problem : Websocket connection is opened successfully. Javascript event handler get fires successfully. Apache logs show that request was accepted as an protocol upgrade request with 101 code Tomcat access logs also show the same code 101 for protocol upgrade However on server side onOpen message is not fired. I tried sending the message as soon as connection is opened in javascript's event handler.. There is no error in javascript but Server side endPoint's onmessage is never called just like onOpen is never called. Here are the changes I made after which it has stopped working: Windows Host file : I use dummy host name through Windows host file: 127.0.0.1phasingapp.com 127.0.0.1pricer.com URL of wesocket : old : ws://localhost:86/websocket/filuploadtrackerendpoint new : ws://phasingapp.com:86/websocket/filuploadtrackerendpoint Added virtual host config for apache : Location /jkweb/websocket/ Require host phasingapp.com granted /Location JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb/ Struts 2 : changed url pattern for Struts 2 filter from .action to /* . Also added exclusion filters to strtus2 for webscoket urls : constant name=struts.action.excludePattern value=.*websocket/.*/ Everything seems to be working fine as i am gettting no error anywhere in apache,tomcat,spring security and Struts2 logs. However on server side no handlers are called? Earlier I had faced similar problem but it was because I had put websocket-api jar in my WEB-INF/lib which was preventing websocket connection from getting opened. No connection is opened but no handler is called after that and after some time connection is closed obviously because of timout I suppose. Here is my ServerEndPoint class : package com.jkweb.websocket; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.websocket.EndpointConfig; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @ServerEndpoint(value=/websocket/fileuploadtracker) public class FileUploadTrackerEndPoint{ private static final Logger logger = LoggerFactory .getLogger(FileUploadTrackerEndPoint.class); private static HashMapString,Session socketConnectionMap = new HashMapString,Session(); @OnOpen public void open(Session session) { MapString,ListString paramMap = session.getRequestParameterMap(); ListString uniqueTockenValues = paramMap.get(uniqueTocken); if(uniqueTockenValues != null uniqueTockenValues.size() 0){ socketConnectionMap.put(uniqueTockenValues.get(0),session); } } @OnMessage public void onMessage(Session session, String msg) { try { session.getBasicRemote().sendText(msg); } catch (IOException e) { logger.error(e.getMessage()); } } public static void sendMessage(String uniqueTocken,String msg){ try { Session wsSession = socketConnectionMap.get(uniqueTocken); wsSession.getBasicRemote().sendText(msg); } catch (IOException e) { logger.error(e.getMessage()); } } } and my javascript code : createFileUploadWebSocket : function(){ var that = this; var uniqueTocken = $(#uniqueTocken).val(), wsurl =
Re: Websocket stopped working on tomcat 7.0.50
I tried debuggin tomcat sources. And compared the difference I am getting between normal tomcat websocket examples and my code. Only difference i could found was tomcat example uses Abstract Protocol class to fire the register session event and mine uses AjpProcessor(because I am using tomcat behind apache). but in AJpProcessor class it gets stuck and never calls registersession for Websocket. I know above information might be utterlyt useless but this waht i have understood ..guys I need this to be resolved ASAP. it was working fine when i was using localhost everywhere. since I changed it to dummy host it has stopped working On Sat, Mar 1, 2014 at 2:31 PM, J Java jforjava1...@gmail.com wrote: 127.0.0.1 - - [01/Mar/2014:14:20:12 +0530] GET /jkweb/js/angle/addAngle.js?_=1393663610411 HTTP/1.1 200 4278 127.0.0.1 - - [01/Mar/2014:14:20:41 +0530] GET /jkweb/angle/validateDuplicateAngleName.action?angleName=angle7 HTTP/1.1 200 - phasingapp.com - - [01/Mar/2014:14:21:15 +0530] GET /jkweb/websocket/fileuploadtracker?uniqueTocken=9c9e740c-7171-4c33-bc92-e0a46cb2d2b5 HTTP/1.1 101 - Above is the relevant log section of apache : could it be the cause that websocket request is coming from phasingapp.com and others from 127.0.01 On Sat, Mar 1, 2014 at 1:53 PM, J Java jforjava1...@gmail.com wrote: I had recently implemented websocket on tomcat 7.0.50. my tomcat runs behind apache 2.4. I use Strtus 2 and Spring Security. It has stopped working. Problem : Websocket connection is opened successfully. Javascript event handler get fires successfully. Apache logs show that request was accepted as an protocol upgrade request with 101 code Tomcat access logs also show the same code 101 for protocol upgrade However on server side onOpen message is not fired. I tried sending the message as soon as connection is opened in javascript's event handler.. There is no error in javascript but Server side endPoint's onmessage is never called just like onOpen is never called. Here are the changes I made after which it has stopped working: Windows Host file : I use dummy host name through Windows host file: 127.0.0.1phasingapp.com 127.0.0.1pricer.com URL of wesocket : old : ws://localhost:86/websocket/filuploadtrackerendpoint new : ws://phasingapp.com:86/websocket/filuploadtrackerendpoint Added virtual host config for apache : Location /jkweb/websocket/ Require host phasingapp.com granted /Location JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb/ Struts 2 : changed url pattern for Struts 2 filter from .action to /* . Also added exclusion filters to strtus2 for webscoket urls : constant name=struts.action.excludePattern value=.*websocket/.*/ Everything seems to be working fine as i am gettting no error anywhere in apache,tomcat,spring security and Struts2 logs. However on server side no handlers are called? Earlier I had faced similar problem but it was because I had put websocket-api jar in my WEB-INF/lib which was preventing websocket connection from getting opened. No connection is opened but no handler is called after that and after some time connection is closed obviously because of timout I suppose. Here is my ServerEndPoint class : package com.jkweb.websocket; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.websocket.EndpointConfig; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @ServerEndpoint(value=/websocket/fileuploadtracker) public class FileUploadTrackerEndPoint{ private static final Logger logger = LoggerFactory .getLogger(FileUploadTrackerEndPoint.class); private static HashMapString,Session socketConnectionMap = new HashMapString,Session(); @OnOpen public void open(Session session) { MapString,ListString paramMap = session.getRequestParameterMap(); ListString uniqueTockenValues = paramMap.get(uniqueTocken); if(uniqueTockenValues != null uniqueTockenValues.size() 0){ socketConnectionMap.put(uniqueTockenValues.get(0),session); } } @OnMessage public void onMessage(Session
Re: Websocket stopped working on tomcat 7.0.50
On 1 March 2014 10:02:48 GMT, J Java jforjava1...@gmail.com wrote: I tried debuggin tomcat sources. And compared the difference I am getting between normal tomcat websocket examples and my code. Only difference i could found was tomcat example uses Abstract Protocol class to fire the register session event and mine uses AjpProcessor(because I am using tomcat behind apache). but in AJpProcessor class it gets stuck and never calls registersession for Websocket. I know above information might be utterlyt useless but this waht i have understood ..guys I need this to be resolved ASAP. it was working fine when i was using localhost everywhere. since I changed it to dummy host it has stopped working How is your reverse proxy configured? mod_jk doesn't support HTTP upgrade and the last time I looked mod_proxy support for WebSocket wasn't fit for purpose. Mark On Sat, Mar 1, 2014 at 2:31 PM, J Java jforjava1...@gmail.com wrote: 127.0.0.1 - - [01/Mar/2014:14:20:12 +0530] GET /jkweb/js/angle/addAngle.js?_=1393663610411 HTTP/1.1 200 4278 127.0.0.1 - - [01/Mar/2014:14:20:41 +0530] GET /jkweb/angle/validateDuplicateAngleName.action?angleName=angle7 HTTP/1.1 200 - phasingapp.com - - [01/Mar/2014:14:21:15 +0530] GET /jkweb/websocket/fileuploadtracker?uniqueTocken=9c9e740c-7171-4c33-bc92-e0a46cb2d2b5 HTTP/1.1 101 - Above is the relevant log section of apache : could it be the cause that websocket request is coming from phasingapp.com and others from 127.0.01 On Sat, Mar 1, 2014 at 1:53 PM, J Java jforjava1...@gmail.com wrote: I had recently implemented websocket on tomcat 7.0.50. my tomcat runs behind apache 2.4. I use Strtus 2 and Spring Security. It has stopped working. Problem : Websocket connection is opened successfully. Javascript event handler get fires successfully. Apache logs show that request was accepted as an protocol upgrade request with 101 code Tomcat access logs also show the same code 101 for protocol upgrade However on server side onOpen message is not fired. I tried sending the message as soon as connection is opened in javascript's event handler.. There is no error in javascript but Server side endPoint's onmessage is never called just like onOpen is never called. Here are the changes I made after which it has stopped working: Windows Host file : I use dummy host name through Windows host file: 127.0.0.1phasingapp.com 127.0.0.1pricer.com URL of wesocket : old : ws://localhost:86/websocket/filuploadtrackerendpoint new : ws://phasingapp.com:86/websocket/filuploadtrackerendpoint Added virtual host config for apache : Location /jkweb/websocket/ Require host phasingapp.com granted /Location JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb/ Struts 2 : changed url pattern for Struts 2 filter from .action to /* . Also added exclusion filters to strtus2 for webscoket urls : constant name=struts.action.excludePattern value=.*websocket/.*/ Everything seems to be working fine as i am gettting no error anywhere in apache,tomcat,spring security and Struts2 logs. However on server side no handlers are called? Earlier I had faced similar problem but it was because I had put websocket-api jar in my WEB-INF/lib which was preventing websocket connection from getting opened. No connection is opened but no handler is called after that and after some time connection is closed obviously because of timout I suppose. Here is my ServerEndPoint class : package com.jkweb.websocket; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.websocket.EndpointConfig; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @ServerEndpoint(value=/websocket/fileuploadtracker) public class FileUploadTrackerEndPoint{ private static final Logger logger = LoggerFactory .getLogger(FileUploadTrackerEndPoint.class); private static HashMapString,Session socketConnectionMap = newHashMapString,Session(); @OnOpen public void open(Session session) { MapString,ListString paramMap = session.getRequestParameterMap(); ListString uniqueTockenValues =
Difference between process kill and shutdown
On our linux boxes, we have multiple users who run tomcat. Currently we are using process kill commands to kill the respective user's tomcat , instead of using shutdown.sh Are there any downsides of using this approach ? Thanks, Akash
Re: Websocket stopped working on tomcat 7.0.50
Mark, following is how i have configured reverse proxy : ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb I am using Apache 2.4 which comes with mod_proxy_wstunnel module to support http upgrade to Websocket. Also my code works fine if I configure localhost everywhere, its just when I change it to use dummy host using window's hosts file and virtual host it stops working. And it upgrades to WebSocket but cant send or receive messages after that. Please find in detail configuration and code in my first post. Any pointers how to go about it will really help. Or let me know the right place to open bug for this. Thanks, Shailesh. On Sat, Mar 1, 2014 at 4:10 PM, Mark Thomas ma...@apache.org wrote: On 1 March 2014 10:02:48 GMT, J Java jforjava1...@gmail.com wrote: I tried debuggin tomcat sources. And compared the difference I am getting between normal tomcat websocket examples and my code. Only difference i could found was tomcat example uses Abstract Protocol class to fire the register session event and mine uses AjpProcessor(because I am using tomcat behind apache). but in AJpProcessor class it gets stuck and never calls registersession for Websocket. I know above information might be utterlyt useless but this waht i have understood ..guys I need this to be resolved ASAP. it was working fine when i was using localhost everywhere. since I changed it to dummy host it has stopped working How is your reverse proxy configured? mod_jk doesn't support HTTP upgrade and the last time I looked mod_proxy support for WebSocket wasn't fit for purpose. Mark On Sat, Mar 1, 2014 at 2:31 PM, J Java jforjava1...@gmail.com wrote: 127.0.0.1 - - [01/Mar/2014:14:20:12 +0530] GET /jkweb/js/angle/addAngle.js?_=1393663610411 HTTP/1.1 200 4278 127.0.0.1 - - [01/Mar/2014:14:20:41 +0530] GET /jkweb/angle/validateDuplicateAngleName.action?angleName=angle7 HTTP/1.1 200 - phasingapp.com - - [01/Mar/2014:14:21:15 +0530] GET /jkweb/websocket/fileuploadtracker?uniqueTocken=9c9e740c-7171-4c33-bc92-e0a46cb2d2b5 HTTP/1.1 101 - Above is the relevant log section of apache : could it be the cause that websocket request is coming from phasingapp.com and others from 127.0.01 On Sat, Mar 1, 2014 at 1:53 PM, J Java jforjava1...@gmail.com wrote: I had recently implemented websocket on tomcat 7.0.50. my tomcat runs behind apache 2.4. I use Strtus 2 and Spring Security. It has stopped working. Problem : Websocket connection is opened successfully. Javascript event handler get fires successfully. Apache logs show that request was accepted as an protocol upgrade request with 101 code Tomcat access logs also show the same code 101 for protocol upgrade However on server side onOpen message is not fired. I tried sending the message as soon as connection is opened in javascript's event handler.. There is no error in javascript but Server side endPoint's onmessage is never called just like onOpen is never called. Here are the changes I made after which it has stopped working: Windows Host file : I use dummy host name through Windows host file: 127.0.0.1phasingapp.com 127.0.0.1pricer.com URL of wesocket : old : ws://localhost:86/websocket/filuploadtrackerendpoint new : ws://phasingapp.com:86/websocket/filuploadtrackerendpoint Added virtual host config for apache : Location /jkweb/websocket/ Require host phasingapp.com granted /Location JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb/ Struts 2 : changed url pattern for Struts 2 filter from .action to /* . Also added exclusion filters to strtus2 for webscoket urls : constant name=struts.action.excludePattern value=.*websocket/.*/ Everything seems to be working fine as i am gettting no error anywhere in apache,tomcat,spring security and Struts2 logs. However on server side no handlers are called? Earlier I had faced similar problem but it was because I had put websocket-api jar in my WEB-INF/lib which was preventing websocket connection from getting opened. No connection is opened but no handler is called after that and after some time connection is closed obviously because of
Re: Websocket stopped working on tomcat 7.0.50
JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb Updated configuration..above is the complete configuration for my virtualhost. On Sat, Mar 1, 2014 at 6:14 PM, J Java jforjava1...@gmail.com wrote: Mark, following is how i have configured reverse proxy : ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb I am using Apache 2.4 which comes with mod_proxy_wstunnel module to support http upgrade to Websocket. Also my code works fine if I configure localhost everywhere, its just when I change it to use dummy host using window's hosts file and virtual host it stops working. And it upgrades to WebSocket but cant send or receive messages after that. Please find in detail configuration and code in my first post. Any pointers how to go about it will really help. Or let me know the right place to open bug for this. Thanks, Shailesh. On Sat, Mar 1, 2014 at 4:10 PM, Mark Thomas ma...@apache.org wrote: On 1 March 2014 10:02:48 GMT, J Java jforjava1...@gmail.com wrote: I tried debuggin tomcat sources. And compared the difference I am getting between normal tomcat websocket examples and my code. Only difference i could found was tomcat example uses Abstract Protocol class to fire the register session event and mine uses AjpProcessor(because I am using tomcat behind apache). but in AJpProcessor class it gets stuck and never calls registersession for Websocket. I know above information might be utterlyt useless but this waht i have understood ..guys I need this to be resolved ASAP. it was working fine when i was using localhost everywhere. since I changed it to dummy host it has stopped working How is your reverse proxy configured? mod_jk doesn't support HTTP upgrade and the last time I looked mod_proxy support for WebSocket wasn't fit for purpose. Mark On Sat, Mar 1, 2014 at 2:31 PM, J Java jforjava1...@gmail.com wrote: 127.0.0.1 - - [01/Mar/2014:14:20:12 +0530] GET /jkweb/js/angle/addAngle.js?_=1393663610411 HTTP/1.1 200 4278 127.0.0.1 - - [01/Mar/2014:14:20:41 +0530] GET /jkweb/angle/validateDuplicateAngleName.action?angleName=angle7 HTTP/1.1 200 - phasingapp.com - - [01/Mar/2014:14:21:15 +0530] GET /jkweb/websocket/fileuploadtracker?uniqueTocken=9c9e740c-7171-4c33-bc92-e0a46cb2d2b5 HTTP/1.1 101 - Above is the relevant log section of apache : could it be the cause that websocket request is coming from phasingapp.com and others from 127.0.01 On Sat, Mar 1, 2014 at 1:53 PM, J Java jforjava1...@gmail.com wrote: I had recently implemented websocket on tomcat 7.0.50. my tomcat runs behind apache 2.4. I use Strtus 2 and Spring Security. It has stopped working. Problem : Websocket connection is opened successfully. Javascript event handler get fires successfully. Apache logs show that request was accepted as an protocol upgrade request with 101 code Tomcat access logs also show the same code 101 for protocol upgrade However on server side onOpen message is not fired. I tried sending the message as soon as connection is opened in javascript's event handler.. There is no error in javascript but Server side endPoint's onmessage is never called just like onOpen is never called. Here are the changes I made after which it has stopped working: Windows Host file : I use dummy host name through Windows host file: 127.0.0.1phasingapp.com 127.0.0.1pricer.com URL of wesocket : old : ws://localhost:86/websocket/filuploadtrackerendpoint new : ws://phasingapp.com:86/websocket/filuploadtrackerendpoint Added virtual host config for apache : Location /jkweb/websocket/ Require host phasingapp.com granted /Location JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb/ Struts 2 :
Re: Websocket stopped working on tomcat 7.0.50
When I revert to earlier config with localhost it starts working. On Sat, Mar 1, 2014 at 6:18 PM, J Java jforjava1...@gmail.com wrote: JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb Updated configuration..above is the complete configuration for my virtualhost. On Sat, Mar 1, 2014 at 6:14 PM, J Java jforjava1...@gmail.com wrote: Mark, following is how i have configured reverse proxy : ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb I am using Apache 2.4 which comes with mod_proxy_wstunnel module to support http upgrade to Websocket. Also my code works fine if I configure localhost everywhere, its just when I change it to use dummy host using window's hosts file and virtual host it stops working. And it upgrades to WebSocket but cant send or receive messages after that. Please find in detail configuration and code in my first post. Any pointers how to go about it will really help. Or let me know the right place to open bug for this. Thanks, Shailesh. On Sat, Mar 1, 2014 at 4:10 PM, Mark Thomas ma...@apache.org wrote: On 1 March 2014 10:02:48 GMT, J Java jforjava1...@gmail.com wrote: I tried debuggin tomcat sources. And compared the difference I am getting between normal tomcat websocket examples and my code. Only difference i could found was tomcat example uses Abstract Protocol class to fire the register session event and mine uses AjpProcessor(because I am using tomcat behind apache). but in AJpProcessor class it gets stuck and never calls registersession for Websocket. I know above information might be utterlyt useless but this waht i have understood ..guys I need this to be resolved ASAP. it was working fine when i was using localhost everywhere. since I changed it to dummy host it has stopped working How is your reverse proxy configured? mod_jk doesn't support HTTP upgrade and the last time I looked mod_proxy support for WebSocket wasn't fit for purpose. Mark On Sat, Mar 1, 2014 at 2:31 PM, J Java jforjava1...@gmail.com wrote: 127.0.0.1 - - [01/Mar/2014:14:20:12 +0530] GET /jkweb/js/angle/addAngle.js?_=1393663610411 HTTP/1.1 200 4278 127.0.0.1 - - [01/Mar/2014:14:20:41 +0530] GET /jkweb/angle/validateDuplicateAngleName.action?angleName=angle7 HTTP/1.1 200 - phasingapp.com - - [01/Mar/2014:14:21:15 +0530] GET /jkweb/websocket/fileuploadtracker?uniqueTocken=9c9e740c-7171-4c33-bc92-e0a46cb2d2b5 HTTP/1.1 101 - Above is the relevant log section of apache : could it be the cause that websocket request is coming from phasingapp.com and others from 127.0.01 On Sat, Mar 1, 2014 at 1:53 PM, J Java jforjava1...@gmail.com wrote: I had recently implemented websocket on tomcat 7.0.50. my tomcat runs behind apache 2.4. I use Strtus 2 and Spring Security. It has stopped working. Problem : Websocket connection is opened successfully. Javascript event handler get fires successfully. Apache logs show that request was accepted as an protocol upgrade request with 101 code Tomcat access logs also show the same code 101 for protocol upgrade However on server side onOpen message is not fired. I tried sending the message as soon as connection is opened in javascript's event handler.. There is no error in javascript but Server side endPoint's onmessage is never called just like onOpen is never called. Here are the changes I made after which it has stopped working: Windows Host file : I use dummy host name through Windows host file: 127.0.0.1phasingapp.com 127.0.0.1pricer.com URL of wesocket : old : ws://localhost:86/websocket/filuploadtrackerendpoint new : ws://phasingapp.com:86/websocket/filuploadtrackerendpoint Added virtual host config for apache : Location /jkweb/websocket/ Require host phasingapp.com granted /Location JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse
Re: Websocket stopped working on tomcat 7.0.50
Mark, Here after doing all the tests I found the exact error. It was not what i am thinking all through. Sorry for the confusion I created and I apologize for overenthusiasm in opening the bug. The problem was with order of proxypass directives i was confiuring Here I gice both configurations for anybody who might face similar probs: The one which doesn't work : JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb And Here us the one which works irrespective of which hosts we use : JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb The difference is the place where I place ProxyPass /jkweb ! ProxyPass /jkweb/ ! Directives. Thanks, Shailesh. On Sat, Mar 1, 2014 at 6:33 PM, J Java jforjava1...@gmail.com wrote: When I revert to earlier config with localhost it starts working. On Sat, Mar 1, 2014 at 6:18 PM, J Java jforjava1...@gmail.com wrote: JkMount /jkweb/* localtomcat JkUnMount /jkweb/project/content/* localtomcat JkUnMount /jkweb/angle/content/* localtomcat JkUnMount /jkweb/index.jsp localtomcat JkUnMount /jkweb/ localtomcat ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb Updated configuration..above is the complete configuration for my virtualhost. On Sat, Mar 1, 2014 at 6:14 PM, J Java jforjava1...@gmail.com wrote: Mark, following is how i have configured reverse proxy : ProxyRequests Off ProxyPreserveHost On ProxyPass /jkweb ! ProxyPass /jkweb/ ! ProxyPass /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPassReverse /jkweb/websocket/ ws://localhost:8080/jkweb/websocket/ ProxyPass / http://localhost:8080/jkweb/ ProxyPassReverse / http://localhost:8080/jkweb I am using Apache 2.4 which comes with mod_proxy_wstunnel module to support http upgrade to Websocket. Also my code works fine if I configure localhost everywhere, its just when I change it to use dummy host using window's hosts file and virtual host it stops working. And it upgrades to WebSocket but cant send or receive messages after that. Please find in detail configuration and code in my first post. Any pointers how to go about it will really help. Or let me know the right place to open bug for this. Thanks, Shailesh. On Sat, Mar 1, 2014 at 4:10 PM, Mark Thomas ma...@apache.org wrote: On 1 March 2014 10:02:48 GMT, J Java jforjava1...@gmail.com wrote: I tried debuggin tomcat sources. And compared the difference I am getting between normal tomcat websocket examples and my code. Only difference i could found was tomcat example uses Abstract Protocol class to fire the register session event and mine uses AjpProcessor(because I am using tomcat behind apache). but in AJpProcessor class it gets stuck and never calls registersession for Websocket. I know above information might be utterlyt useless but this waht i have understood ..guys I need this to be resolved ASAP. it was working fine when i was using localhost everywhere. since I changed it to dummy host it has stopped working How is your reverse proxy configured? mod_jk doesn't support HTTP upgrade and the last time I looked mod_proxy support for WebSocket wasn't fit for purpose. Mark On Sat, Mar 1, 2014 at 2:31 PM, J Java jforjava1...@gmail.com wrote: 127.0.0.1 - - [01/Mar/2014:14:20:12 +0530] GET /jkweb/js/angle/addAngle.js?_=1393663610411 HTTP/1.1 200 4278 127.0.0.1 - - [01/Mar/2014:14:20:41 +0530] GET /jkweb/angle/validateDuplicateAngleName.action?angleName=angle7 HTTP/1.1 200 - phasingapp.com - - [01/Mar/2014:14:21:15 +0530] GET /jkweb/websocket/fileuploadtracker?uniqueTocken=9c9e740c-7171-4c33-bc92-e0a46cb2d2b5 HTTP/1.1 101 - Above is the relevant log section of apache : could it be the cause that websocket request is coming from phasingapp.com and others from 127.0.01 On Sat, Mar
RE: Difference between process kill and shutdown
Date: Sat, 1 Mar 2014 04:11:57 -0800 Subject: Difference between process kill and shutdown From: akash.delh...@gmail.com To: users@tomcat.apache.org On our linux boxes, we have multiple users who run tomcat. Currently we are using process kill commands to kill the respective user's tomcat , instead of using shutdown.sh MGBad Practice Are there any downsides of using this approach ? MGThere are horrible downsides MGA Kill will take the running process out of the execution environment..no matter what the side effect is MGHooks to any of the configured Server Listeners CATALINA has started can be ignored and usually are MGThe result of a kill on parent process is MG you will still have one or more Listeners running as child daemons since they were never shutdown properly MGWhoever told you to use the kill command instead of shutdown should be court-martialed! Thanks, Akash
Re: Newbie question: Installing Java EE
On 3/1/2014 3:05 AM, Bruce Whealton wrote: Hello all, Recently, I downloaded Java EE with the SDK. When I went to install it, it could not find the Java Run-time, the JRE. I have Java SE with the JDK installed and have used Java on my system. When I installed Java SE it included the JRE. Perhaps the problem is that I have Java SE 1.7u51 and the latest version of Java EE is 1.7u45, I believe. So, I guess when installing Java EE, the installer expects you to already have the Java Run time installed? Next question is with regard to the server. Is there any reason one would run both Tomcat and Glass-Fish server? I'm not really sure what the differences between these two are. Also, there is the issue of ports. When I installed Tomcat it runs on port 8080 (and a couple other ports). In a production environment one doesn't typically see the port specified in a link. Do we serve web pages using Tomcat on port 80 in a production environment or how is this handled? You can't have two servers running on the same machine using the same port. 8080 is the default, but if you want to change it, it's as easy as changing a setting in server.xml and restarting. Yes, 80 is typically where you'll put it if TC is providing your default http services. If you have another http server (IIS, Apache HTTPD, etc), then you have to deal with the conflicts somehow. TC works fine for serving static web pages, so the others aren't necessary unless you need something from them that you can't get from TC. Sorry, I can't help you with the other questions. Thanks, Bruce Bruce M Whealton Web/ App/Software Developer with skills in Web Design http://futurewavewebdevelopment.com Online resume: http://futurewavewebdevelopment.com/myinfo/bw-cv-resume Call or Text: 919-714-9993 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
OWF webapp log errors
I have installed the OWF webapp in Tomcat and I'm trying to resolve some errors I'm finding in the log files. I have not had much luck getting responses to questions on the OWF mailing list, so I'm hoping someone can help here. Here are the details of my setup: -Windows 7. -Tomcat 7.0.42. -MySQL 5.6. -JDK 7.51-b13. -IE 11 browser. First, the OWF webapp does start (some features are not working). The webapp is not generating a stacktrace or an initialization log file anymore since I resolved earlier errors with help. There are 3 log files remaining that list SEVERE errors. I will start with the 1 error reported in the localhost log. Any idea how to resolve the following error? Mar 01, 2014 12:19:36 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter springSecurityFilterChain org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean Definition(DefaultListableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocal BeanDefinition(AbstractBeanFactory.java:1083) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abst ractBeanFactory.java:274) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:194) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abst ractBeanFactory.java:266) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:194) at org.springframework.context.support.AbstractApplicationContext.getBean(Abstr actApplicationContext.java:1079) at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(Delegating FilterProxy.java:217) at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(Delegati ngFilterProxy.java:145) at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java :179) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilte rConfig.java:281) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilter Config.java:262) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterCon fig.java:107) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:47 75) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java: 5452) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:9 01) 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:976) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)