tomcat6

How do you programatically 'relative import' a directory of jar files?

早过忘川 提交于 2019-12-08 06:13:20
问题 I am using Drools Planner which ships with 21 Jar files in a directory binaries . For example the drools-core-5.3.0.Final.jar would provide org.drools.someClasses . The included examples run it in command line by running an all-inclusive command: mainClasspath= for i in binaries/*.jar; do mainClasspath=${mainClasspath}:$i; done mainClass=org.drools.planner.examples.app.DroolsPlannerExamplesApp $JAVA_HOME/bin/java -Xms256m -Xmx512m -server -cp ${mainClasspath} ${mainClass} $* I am developing

Getting Access to Spring with Embedded Tomcat 6

风格不统一 提交于 2019-12-08 05:25:17
问题 I want to test the REST services that I deploy on a tomcat. To do this with JUnit I embedded Tomcat 6 which works quite fine. Now, I need access to the Spring context as I need to access DAO's and other beans. Has anyone a clue how this can be achieved? I tried with the RootContext, but could not find anything. Sincerely, Erik Edit: I know have found a solution, but its a bad hack though: import java.io.IOException; import java.util.Enumeration; import java.util.Map; import java.util

Can I set Tomcat with a welcome-file in a subfolder?

雨燕双飞 提交于 2019-12-08 03:16:51
问题 Someone at the office threw me this weird-yet-interesting question. If I have something like this in a web.xml (either app' file or container's file) <welcome-file-list> <welcome-file>something.html</welcome-file> </welcome-file-list> and the thing has another page in a subfolder that can be used so I change it... <welcome-file-list> <welcome-file>subfolder/something.html</welcome-file> </welcome-file-list> ¿Should the second option work? Thanks! 回答1: Answering to myself just to let it in the

CSRF validation using Tomcat 6 without using external packages

筅森魡賤 提交于 2019-12-08 00:21:43
问题 CSRF protection for a JSF based web app and Tomcat6 backend without using any external packages. Kindly help. 回答1: JSF has already builtin protection against CSRF by the javax.faces.ViewState hidden field which is to be linked with the state of the component tree in the server side. If this hidden field is missing or contains a wrong value, then JSF simply won't process the POST request. On JSF 1.x the key is only a bit too easy to guess, see also JSF impl issue 812 and JSF spec issue 869.

Deployed war to tomcat can't throws java.lang.NoClassDefFoundError: javax/persistence/PersistenceException

为君一笑 提交于 2019-12-07 21:58:11
问题 I'm new to this forum and also new to JPA / EJB. I'm trying to deploy a .war file containing a small application to a tomcat server. The application is using JTA to communicate with the Derby db. When I run and deploy the application from and eclipse top the tomcat server running in eclipse, everything works perfect, but when I export a .war file and try to browse the application it throws an java.lang.ClassNotFoundException: javax.persistence.PersistenceException. My persistence file looks

Tomcat session.ser [closed]

。_饼干妹妹 提交于 2019-12-07 19:39:29
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . im using apache-tomcat6.0.24..and Enterprise Linux Enterprise Linux Server release 5.6 to install my EGRCM application.when im restarting my tomcat it will araise some exceptions..the problem is when redeploy my appplication it could not open..please help me find out the problem. thanks in advance. The problem

Java Tomcat LDAP authentication

╄→尐↘猪︶ㄣ 提交于 2019-12-07 17:10:23
问题 Since I'm running Java with Tomcat6 as servlet container I found it appropriate to use the Tomcat JNDIRealm feature so that LDAP users can log into my site without any additional efforts. The LDAP server I'm using is OpenLDAP on Ubuntu. On top of this I have the login page using form-based authentication over an https connection. I found two very good examples of authentication users via LDAP, here and here, that both achieve what I feel I almost achieved. Why almost achieved? When I attempt

Tomcat not shutting down cleanly due to daemon threads

▼魔方 西西 提交于 2019-12-07 13:04:36
问题 We run our web application wehre we start some Threads for background work and also Quartz. When I try to shutdown tomcat(using shell script on linux), I always get the error saying failed to shutdown tomcat due to daemon threads and Quartz threads. We have tried different ways to shutdown our threads (exit out of run method) but we rely on few static variables of a class to do this which become null by the time my shut down listener gets a callback Is there a standard approach to shut down

Tomcat 6 Eclipse config — Server Locations locked for edit

谁说我不能喝 提交于 2019-12-07 12:30:03
问题 I am trying to change the default location for my Tomcat server running out of Eclipse EE 1.4.1 so that it uses the original Tomcat installation (which works fine when run standalone out of the console) and not the one created by Eclipse in the workspace as per this thread. However, my Server Locations section on the Tomcat server configuration form is all grayed out (see red rectangle): Why is that and how do I change it? 回答1: It says it all on the page you published : Server must be

How to force tomcat to reload recently compiled class/war files

心已入冬 提交于 2019-12-07 05:02:30
问题 We have a set of running servlets on a tomcat engine. When we compile a java file and build the war, tomcat takes an indeterminate amount of time to reload it. Sometimes 3 seconds, sometimes 30, etc. Current workaround is to stop tomcat and restart it using a shell script. We set up the autodeploy and reloadable flag to true but it is not working reliably. Any idea how to make this happen? Pointers appreciated, too. This is about tomcat v6.0.20 on ubuntu. Here is an extract of our conf/server