tomcat7

Tomcat 7 keeps giving me a 404. What am I doing wrong?

陌路散爱 提交于 2019-12-30 10:45:08
问题 this is my first servlet ever. here is it's code. import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class Ch1Servlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { PrintWriter out = response.getWriter(); java.util.Date today = new java.util.Date(); out.println("<html> " +"<body>" +"<h1 align=center>HF\'s Chapter1 Servlet</h1>" +" " + "<br>" + today + "</body>" + "</html>"); } } I compiled it

Tomcat and proxy settings

老子叫甜甜 提交于 2019-12-30 06:17:14
问题 There is a servlet running on tomcat7 and it makes a webservice call to a third party website. The call works fine from the windows machine but when run from tomcat it fails. Wont Tomcat automatically use the Windows' proxy settings? I added set JAVA_OPTS=%JAVA_OPTS% "-Dhttp.proxySet=true" set JAVA_OPTS=%JAVA_OPTS% "-Dhttp.proxyHost=IP" set JAVA_OPTS=%JAVA_OPTS% "-Dhttp.proxyPort=8080" to CATALINA.BAT and http.proxyHost=IP http.proxyPort=8080 to catalina.properties But still there is no

How to Detect cause of 503 Service Temporarily Unavailable error and handle it?

梦想与她 提交于 2019-12-29 18:18:34
问题 i am getting the error 503 Service Temporarily Unavailable many times in my application and i want to detect why this error occurs, how ? if there's a log file or something like that, since i am not familiar with apache. second thing is that, is it possible to handle this error, that when it occurs apache is restarted ? 回答1: There is of course some apache log files. Search in your apache configuration files for 'Log' keyword, you'll certainly find plenty of them. Depending on your OS and

Could not load the Tomcat server configuration

给你一囗甜甜゛ 提交于 2019-12-29 11:46:09
问题 I have installed apache tomcat7 using sudo apt get in ubuntu. I have added apache tomcat 7 to eclipse using Windows > Preferences > Server > Runtime Environment.But when I'm starting the server from server view by right clicking the shown Tomcat v7.0 Server at localhost [Stopped,Republish] It says: Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete. The path to tomcat7 that I've provided is /usr

Using a WebSocket API with Struts 2

心已入冬 提交于 2019-12-29 07:18:08
问题 I have a Struts2 web application running on Tomcat 7.0.43 that uses Rest and Convention plugins to map all requests. Struts tries to map all requests by itself. JSR 356 defines server end points using annotations like @ServerEndpoint(value = "/websocket/chat") Now when the broswer tries to connect to ws:/127.0.0.1:8080/websocket/chat , the request fails because the Struts mapper intercepts the request. Is there anything I can specify in the XML files, such that the request reaches the right

Deploy application on custom host of Tomcat

淺唱寂寞╮ 提交于 2019-12-29 06:49:09
问题 I got some issues to deploy my application. Environment: Ubuntu 10.04, Tomcat 7.02 (Install from archive from tomcat site, not from repositories), server is run and stoped manualy, not using any IDE. For the first I've created host in $CATALINA_HOME/conf/server.xml : <Host name="java.dev" appBase="/home/krasilich/java/" autoDeploy="true" > <Alias>www.java.dev</Alias> </Host> Then create a context in $CATALINA_HOME/conf/Catalina/java.dev/siloc.xml : <Context docBase="siloc/web/" /> And got the

Configure SQL Server connection pool on Tomcat

孤者浪人 提交于 2019-12-29 04:59:15
问题 I've been trying to configure a connection pool for a SQL Server 2012 database. I currently have Informix and Oracle pools configured and working, only SQL Server is giving me a headache. This is how my resource on Context.xml looks so far: <Resource name="jdbc/sqlserv" auth="Container" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver" type="javax.sql.DataSource" maxActive="50" maxIdle="10" maxWait="15000" username=

javax.el.ELException: Failed to parse the expression [{pz:instanceof(object,'com.project.domain.MyClass')}]

廉价感情. 提交于 2019-12-28 16:02:48
问题 Currenty I have a web project with JSF 1.2 and Facelets running in tomcat 6.0.18.0. I decided to upgrade the servlet container, thus i deployed in tomcat 7 and all seemed ok until we hit one view using my custome facelet functions. javax.el.ELException: Failed to parse the expression [{pz:instanceof(object,'com.project.domain.MyClass')}] Caused by: org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1, column 5. Was expecting one of: "}" ... "." ... "[" ... This error occurs

Specify a custom web.xml to an embedded tomcat

做~自己de王妃 提交于 2019-12-28 12:42:48
问题 Is there a way to specify a different web.xml from the standard WEB-INF/web.xml when using an embedded tomcat instance? I would like to put a web.xml in my src/test/resources (or some other area) and refer to that web.xml when starting the embedded tomcat. Here is my existing code to start the tomcat instance tomcat = new Tomcat(); String baseDir = "."; tomcat.setPort(8080); tomcat.setBaseDir(baseDir); tomcat.getHost().setAppBase(baseDir); tomcat.getHost().setAutoDeploy(true); tomcat

What to do with annotations after setting metadata-complete=“true” (which resolved slow Tomcat 7 start-up)?

心不动则不痛 提交于 2019-12-28 07:58:27
问题 Seems like the slow Tomcat 7 startup problem can be resolved with "metadata-complete" set to "true" in the web.xml, like so: <?xml version="1.0" encoding="UTF-8"?> <web-app metadata-complete="true" id="WebApp_ID" version="3.0"... The problem is that Tomcat scans for annotations at startup, and this significantly slows it down. My time is cut down from 25 secs to 5 secs. (More info here: Tomcat and Servlet 3.0 Web Configuration) However, I have some annotations in my code, like: @ManagedBean