tomcat5.5

how to set a class as daemon with tomcat?

人盡茶涼 提交于 2019-12-11 11:50:06
问题 I'm new on the java universe, also new in the tomcat world. So, the issue is: I need to run a java class as a daemon. This class should be able to comunicate with the tomcat requests. In the past: when I did this in C, I executed the binary file as a background process. Could you give me some suggestions how to proceed? thanks ind advance!. 回答1: So it sounds like there are two parts to the answer. The first one is to make sure that your daemon gets started up with the tomcat container, and

Tomcat creates 0 byte files

喜你入骨 提交于 2019-12-11 05:16:36
问题 I have a very simple file upload mechanism in java. I just take the file and save it on the server. I'm testing this simple code with selenium and when a timeout occurs in the selenium test tomcat creates 0 byte files under tomcat_home/work/Catalina/localhost/uploadServlet/ directory as MultiPart* files. It creates thousands of files, until there is no disk space left on device. What may cause this problem? How can I solve this? Is there anyone has an idea about this? My environment is:

How to use a save file dialog from a servlet?

时间秒杀一切 提交于 2019-12-11 03:44:49
问题 I am trying to let the user save data from my servlet as a CSV file. Originally I was just locating their desktop to drop the file, but permission would be denied with this route so I want to ask the user where they want to save it. From what I am seeing, I cannot use the Swing API in a servlet because Tomcat does not know how to draw the GUI. I tried this code: String fileName = "ClassMonitor" + formatter.format(currentDate) + ".csv"; File csvFile = new File(fileName); //Attempt to write as

Tomcat Java Compiler difference

末鹿安然 提交于 2019-12-11 00:13:44
问题 I have two tomcat 5.5 servers. One is for development and one is Production. Both runs on Java 1.6. But recently I had a problem where generics are unable to run on the Production environment but runs smoothly on development. The difference between these two system are in tomcat 5.5/common/lib/ . My development envr contains ecj-3.7.2.jar but the production doesn't have this file instead it contains jasper-compiler-jdt.jar . When I replace jasper-compiler-jdt.jar with ecj-3.7.2.jar , the

Advantages of using tomcat manager app over copy-to-webapp directory

六眼飞鱼酱① 提交于 2019-12-10 22:54:05
问题 I have been pondering a lot lately over, why should one use tomcat manager to deploy/undeploy wars to your server? What are the advantages/disadvantages of the same over simply copy-it-to-webapps-folder approach, and delete-it-from-webpass-folder approach?? Also, are there any other advantages regarding cleanup process by tomcat , when a war is deleted? i.e is the process of cleanup different, when a dev deletes a .war , and when he undeploys a webapp using the manager?? Also, would the

Cause of 'tmpFile.renameTo(classFile) failed' during JSP compilation

て烟熏妆下的殇ゞ 提交于 2019-12-10 03:02:13
问题 Recently, I started to experience strange behaviour in JBOss 4.0.5 JSP application. The JSP compilation fails on first (second, third,..) attempt with exception: 17:24:29,909 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception java.io.IOException: tmpFile.renameTo(classFile) failed at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:245) at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:164) at org.apache.jasper.compiler.JDTCompiler

Read HTTPServletRequest's POST body AND then call getParameter in Tomcat

夙愿已清 提交于 2019-12-09 09:32:19
问题 I am in the situation where my application needs to inspect the content/data/body/payload of a POST request without changing the results of subsequent getParameter calls. Reading the body from the inputStream: The body can be read using the InputStream from request.getInputStream or BufferedReader from request.getReader . Reading POST parameters: POST requests typically include request parameters in the body of the request. These can be retrieved using getParameter . The Problem: the first

Configure Tomcat to send web pages compatible to IE 7 or 6

↘锁芯ラ 提交于 2019-12-08 03:45:04
问题 I have got an application that is not compatible to work using IE8 browser. I am looking for a way to to configure Tomcat on which this application run, so the pages could be read by IE8 and treated as if they are IE7 or IE6 By googling so far I found a possible suggestion which say to add to the http response the header: X-UA-Compatible: IE=EmulateIE7 here that tell IE8 to be like IE7. The problem is that this way requires adding a filter that should be added on application level. I'd like

Why is a Tomcat webapp failing when an almost identical app starts within the same Tomcat instance?

 ̄綄美尐妖づ 提交于 2019-12-08 01:41:06
问题 We're experiencing slightly strange webapp deployment behaviour under Tomcat 5.5.27 on Linux (both on CentOS in production and Ubuntu 10.04 for development). App A and app B are almost identical (exactly the same libraries, a copied Maven project), App B differs only in that its JPA entities are annotated to access a different table within the same schema (the JNDI database references are identical). When the apps are deployed into either environment, app B will not start. However: Manually

Using bonecp as Tomcat 5.5 datasource

与世无争的帅哥 提交于 2019-12-07 09:09:00
问题 I try to get Tomcat to use BoneCP as a connection pool because DBCP doesn't work correctly here. I tried to add it to the context.xml that defines my webapp like this: <Context path="/reports" privileged="true" crossContext="true"> <Resource name="jdbc/IKOffice" type="com.jolbox.bonecp.BoneCPDataSource" auth="Container" username="ik" password="******" jdbcUrl="jdbc:postgresql://localhost:5434/IKOffice_Core" lazyInit="true" partitionCount="1" ... more properties ... logStatementsEnabled="false