tomcat7

BufferedReader ready method

时光怂恿深爱的人放手 提交于 2020-01-15 01:04:38
问题 I am observing a strange behaviour with the java.io.BufferedReader's ready method which returns false inside Tomcat while it returns true when the same servlet is run within Jetty. BufferedReader bufferedReader = httpRequest.getReader(); System.out.println(bufferedReader.ready()); /** Perform some read operation */ Output: true //Jetty false //Tomcat I understand that the BufferedReader#ready method only indicates if the next read is not going to blocked for the input(true) or not(false), but

Tomcat7 shows number of inactive users in tomcat manager

匆匆过客 提交于 2020-01-14 10:33:26
问题 Hi I have an amazon ec2 server and I'm using this server for my Java applications but from last couple of days I'm facing one very unusual issue and I'm worried that some one might playing with my server. When I logged into my tomcat manager using ipaddress:8080/manager . It asked me to enter username and password which I have in tomcat-user.xml file. When I logged in to the system it shows only one active instance after few Minutes it shows me that there are more than one user using tomcat

Grails 2.1.0 app tomcat 7.0.22 Session empty after redirect

馋奶兔 提交于 2020-01-13 16:25:27
问题 I am just learning grails and have a problem with an app that works fine when I run it in Netbeans but shows strange behavior when deployed to Tomcat 7.0.22 on a Centos 5.4 server. I am using the proxy_ajp to make the app available with apache. The problem seems to be with the session not being maintained after a redirect so that I lose the login information causing the app to try to login again. My proxy_ajp settings are <Location /PreyerBooks > ProxyPass ajp://localhost:8011/PreyerBooks

Redirecting http://www.example.com to http://example.com

荒凉一梦 提交于 2020-01-13 02:28:35
问题 How do I redirect http://www.example.com to http://example.com in Tomcat? All the documentation focuses on Apache, but I'm hosting a Java app. 回答1: Apache This should be something in the lines of # .htaccess file contents # Apache has the same docroot as the Java web app. # Java webapp is running on port 8084 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # For sites running on a port other than 80 RewriteCond %{HTTP_HOST} !^domain\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteCond %

SecurityContext doesn't work with @RolesAllowed

匆匆过客 提交于 2020-01-12 19:13:09
问题 I'm currently creating a backend server using Jersey 2.5.1 in a Tomcat 7. For the security I'm using the @RolesAllowed , @PermitAll etc. annotations, and I have created my custom ContainerRequestFilter and SecurityContext . My problem is that when my @RolesAllowed annotated resource is requested it always denies permission, even if I force my isUserInRole(role) method to return true . However, my filter method gets called. Do you have any suggestions? I'll paste some relevant code below. My

SolrNet: SolrConnectionException (400) bad request when attempting to Add and Commit

我们两清 提交于 2020-01-12 09:45:06
问题 I have gotten to the point where SolrNet executes the "Add" method but when I try to "Commit" is when I receive the error. The following is my schema.xml, model, code calling it, and the error I get. Even stranger is that despite the error, the model is added to my Solr index AFTER I restart Tomcat (so it still adds my model despite the error but not immediately): schema.xml (fields and fieldtypes): <!-- Fields --> <field name="part_numbers" type="my_string_exact" indexed="true" stored="true"

How to handle escape characters (pipe |) in URL (Spring, REST, CXF)?

跟風遠走 提交于 2020-01-11 06:24:44
问题 I am using Spring, CXF, Tomcat for developing web services. I have a problem sending characters such as pipes(|) in the URL? For example: http://localhost:9080/address/v1/countries/\ | throws a 500 error, is there a way to handle it and throw custom error code like 404 or even 400? I tried setting the URIEncoding="UTF-8" on the connector object in server.xml in tomcat. But it did not fix it. I also tried adding filter-mapping in the web.xml in my application like this:- <filter> <filter-name

Why does Datasources close on Tomcat 7 undeploy with Spring Boot

▼魔方 西西 提交于 2020-01-10 01:35:28
问题 I have an application that has a datasource. Everytime I undeploy the application from the manager GUI the datasources are being closed. When I try to redeploy, the datasource stays closed and throws the following exception: { "status" : "DOWN", "error" : "org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Data source is closed" } Caused by: java.sql.SQLException: Data source is closed at org.apache.tomcat.dbcp

CSRFGuard - request token does not match page token & How can generate token per session

情到浓时终转凉″ 提交于 2020-01-07 06:48:20
问题 I am trying to incorporate the CSRFGuard library(< org.owasp csrfguard 3.1.0 >) in order to rectify some CSRF vulnerabilities in an application. However after configuring as specified here I am now getting the below message: Here I would like to explain scenario when I am getting this message - For suppose my application landing page like this And code snippet for this page(HelloWorld.jsp) is <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@

Spring Boot App deployed in Tomcat : Quartz Scheduler bean is not visible from @Service

落爺英雄遲暮 提交于 2020-01-07 03:08:14
问题 Using Spring Java Config, the scheduler bean is not visible when loading my war packaged app into a tomcat 7. This configuration was working in another test app... How can I point whats wrong ? Catalina output : Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.quartz.Scheduler fr.myapp.schdtool.service.SchedulerService.scheduler; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of