Re: Application configuration
Andrea Aime wrote: Hi, I have a set of property files that allow me to configure my application. They contain things like file system locations, database access parameters and so on. Now, I would like to put them outside the war file in order to make installation easier for people not used to web app deployements, but at the same time I would like to make those files visible only to my app (for example, I'd like to change the log levels in log4j without unpacking the war). So, it seems that using shared/classes is not a great solution... What do you suggest? Is there a clean and easy solution? Best regards Andrea Aime - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Why not use Java Preferences. -- Regards Dave Butler butlerdi-at-manxsoft-dot-net Also on Skype as butlerdi Get Skype here http://www.skype.com/download.html ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** begin:vcard fn:Dave Butler n:Butler;Dave email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard smime.p7s Description: S/MIME Cryptographic Signature
Re: Application configuration
From: Dave Butler [EMAIL PROTECTED] Sent: Friday, April 29, 2005 8:39 AM Andrea Aime wrote: I have a set of property files that allow me to configure my application. They contain things like file system locations, database access parameters and so on. Now, I would like to put them outside the war file in order to make installation easier for people not used to web app deployements, but at the same time I would like to make those files visible only to my app (for example, I'd like to change the log levels in log4j without unpacking the war). Why not use Java Preferences. Java Preferences is the way to go, but you need to provide a mechanism to manipulate them (whereas with property files you can simply use an editor). Ideally this mechanism is within your webapp, but you need to ensure that it can work with potentially Really Bad values in the preferences (i.e. if your property editor part breaks with bad properties, it's kind of hard to fix them, eh?). A notable scenario being I forgot my admin password or something else. One thing you can do is to put a reset directory in the top level of your WAR, then put a ResetProperties class within there (in the reset package, of course). Then, in your webapp protect the reset url with an invalid role. Finally, when the user needs to reset their preferences, they can simply do: java -jar WebApp.war reset.ResetProperties and it will set the preferences to reasonable defaults. A WAR file is simply a JAR file, so this should work just fine (I haven't tested it). You protect the reset path so that it can't be downloaded over the web. The reason you jump through these hoops is because the Java Preferences stores its values differently on different systems. Notably it uses the Registry on Windows, and a file on Unix (in the users home directory). But, rather then fighting that, you can provide something that will work consistenly across platforms by leveraging the API and Java. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Application Configuration
Do you really need to have webapps/examples/myApp/* ? Otherwise, just have webapps/myApp/* and create a context for myApp... -Rishi. On Thu, 18 Sep 2003 20:18:28 -0400, Renda, Michael [EMAIL PROTECTED] said: Hi, I'm having a simple application configuration problem. 1. Tomcat 4.1.27 2. I can run all of the applications in the examples directory. 3. I've created a new directory structure called myApp. Within it is WEB-INF and within that is classes. Within myApp/WEB-INF/classes is a servlet called TestingServlet. 4. I put a simple .jsp page in the /myApp directory and Tomcat serves it up just fine. 5. I cannot access the TestingServlet page, however. Tomcat reports a 404 - requested resource is not available. 6. If I move the servlet to the examples/WEB-INF/classes directory, Tomcat serves it up. 7. The myApp/WEB-INF directory has a web.xml file as follows: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameMy Java Applications/display-name description Example servlets and JSP pages. /description servlet servlet-nameTesting/servlet-name servlet-classTestingServlet/servlet-class /servlet /web-app 8. The log files show that the myApp application is being deployed at Tomcat startup with no errors. Any suggestions would be appreciated. Mike Renda - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rishikesh Tembe [EMAIL PROTECTED] -- http://www.fastmail.fm - And now for something completely differentÂ… - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Application Configuration
I don't have a webapps/examples/myApp/* What I have is: mydomain/examples/* and mydomain/myApp/*. There is a context created for each. In mydomain/examples I can access a resource at the following url: mydomain/examples/servlet/TestingServlet. In mydomain/myApp, when I try to access a resource at mydomain/myApp/servlet/TestingServlet, I get a 404. I can, however, access a resource at mydomain/myApp/SimplePage.jsp. -Original Message- From: Rishikesh Tembe [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 2:36 AM To: Tomcat Users List Subject: Re: Application Configuration Do you really need to have webapps/examples/myApp/* ? Otherwise, just have webapps/myApp/* and create a context for myApp... -Rishi. On Thu, 18 Sep 2003 20:18:28 -0400, Renda, Michael [EMAIL PROTECTED] said: Hi, I'm having a simple application configuration problem. 1. Tomcat 4.1.27 2. I can run all of the applications in the examples directory. 3. I've created a new directory structure called myApp. Within it is WEB-INF and within that is classes. Within myApp/WEB-INF/classes is a servlet called TestingServlet. 4. I put a simple .jsp page in the /myApp directory and Tomcat serves it up just fine. 5. I cannot access the TestingServlet page, however. Tomcat reports a 404 - requested resource is not available. 6. If I move the servlet to the examples/WEB-INF/classes directory, Tomcat serves it up. 7. The myApp/WEB-INF directory has a web.xml file as follows: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameMy Java Applications/display-name description Example servlets and JSP pages. /description servlet servlet-nameTesting/servlet-name servlet-classTestingServlet/servlet-class /servlet /web-app 8. The log files show that the myApp application is being deployed at Tomcat startup with no errors. Any suggestions would be appreciated. Mike Renda - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rishikesh Tembe [EMAIL PROTECTED] -- http://www.fastmail.fm - And now for something completely different... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Application Configuration
Michael, the servlet-mapping is missung in your web-xml: add the following: servlet-mapping servlet-name your servlet /servlet-name url-pattern the URL through which it should be accessible /url-pattern /servlet-mapping Hope this helps Dirk - Original Message - From: Renda, Michael [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, September 19, 2003 2:18 AM Subject: Application Configuration Hi, I'm having a simple application configuration problem. 1. Tomcat 4.1.27 2. I can run all of the applications in the examples directory. 3. I've created a new directory structure called myApp. Within it is WEB-INF and within that is classes. Within myApp/WEB-INF/classes is a servlet called TestingServlet. 4. I put a simple .jsp page in the /myApp directory and Tomcat serves it up just fine. 5. I cannot access the TestingServlet page, however. Tomcat reports a 404 - requested resource is not available. 6. If I move the servlet to the examples/WEB-INF/classes directory, Tomcat serves it up. 7. The myApp/WEB-INF directory has a web.xml file as follows: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameMy Java Applications/display-name description Example servlets and JSP pages. /description servlet servlet-nameTesting/servlet-name servlet-classTestingServlet/servlet-class /servlet /web-app 8. The log files show that the myApp application is being deployed at Tomcat startup with no errors. Any suggestions would be appreciated. Mike Renda - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Application configuration
Larry, I forgot to include Tomcat version number which is 3.2.2 Even when I created the directory, I guess I need to indicate tomcat how to resolve the classes needed. Here is the scenario: 1) Directory where all the classes are located is {server}imr/servlets 2) From here I can see the list of servlets 3) If I click on one or two of them I receive a download file screen with options to open or save the class. 4) If I select to open the file from it's current location, I receive a message saying Could not find the main class. Program will exit! About log files mmm, I just have jasper.log and servlet.log files under logs directory. Any of them indicates anything related to the problem. Cheers, Jose L. Camara Informatica Headquarters 3350 West Bayshore Road Palo Alto, CA, 94303 Technical Support http://www.informatica.com http://www.informatica.com Email [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Tel. 650-687-6200 Direct. 650-687-4722 Fax. 650-687-0040 Toll Free: 800-653-3871 -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 10:10 AM To: 'Tomcat Users List' Subject: RE: Application configuration You still haven't indicated which version of Tomcat, so it is hard to make specific recommendations. For all 3.x and 4.x Tomcats, creating a subdirectory under the webapps directory is the simplest way to bring a new web application online. Tomcat will automatically serve these subdirectories without requiring config file changes. You seem to have done this. However, I can't tell much from I don't even reach the point where Tomcat itself is running my application. What error is reported when you try to run a servlet? What do you see in the log files? Cheers, Larry P.S. If you are not familar with the Servlet specs, you can download it from here: http://java.sun.com/products/servlet/download.html Tomcat 3.x implements Servlet 2.2, Tomcat 4.x implements Servlet 2.3. -Original Message- From: Camara, Jose [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 12:27 PM To: 'Tomcat Users List' Subject: RE: Application configuration Thanks Larry, I don't even reach the point where Tomcat itself is running my application. I guess I need to indicate Tomcat where and how to recognize the classes for my application. Setting up my application in tomcat is the problem. Regards, Jose L. Camara -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 4:58 AM To: 'Tomcat Users List' Subject: RE: Application configuration The configuration you show only lets Tomcat execute servlets. All other content, Apache will try to serve directly. Is this your intent? It would also help to know which version of Tomcat 3.x you are using. (Note that Tomcat 3.3 does the best job of automating the connection to Apache.) In general, I would also recommend testing your web application first by accessing Tomcat directly. If everything works okay, then try accessing through Apache. A web.xml isn't required as long as you are happy with what Tomcat provides by default. Cheers, Larry -Original Message- From: Camara, Jose [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 12, 2001 10:01 PM To: '[EMAIL PROTECTED]' Subject: Application configuration I think I reach that point where I need some help ... could you subscribe me and help me with the following issue. Totally new in configuring applications to be deployed on tomcat: 1) Apache and tomcat are running perfectly 2) I created a directory to install my application (webapps/imr) 3) Under that, I created META-INF, WEB-INF and servlets directories. 4) I also modified tomcat-apache.conf as follows Alias /imr /home/jcamara/tomcat/webapps/imr Directory /home/jcamara/tomcat/webapps/imr Options Indexes FollowSymLinks /Directory ApJServMount /imr/servlet /imr Location /imr/WEB-INF/ AllowOverride None deny from all /Location Location /imr/META-INF/ AllowOverride None deny from all /Location 5) I'm starting to believe that I need to create a web.xml file and I'm not sure how, probably I'll follow one of the examples. 6) I can see the list of classes for my application under that directory. 7) Every time I'm trying to run the application it asked me for download the application on IE and finally come with an error saying Could not find the main class. Program will exit! on a Java Virtual Machine pop up screen. I'm 100% sure that I'm missing something, so here are my questions: Q1: Do I need to create a web.xml file? Q2: Where should I put the jar files that my application need? Q3: How should I configure Tomcat in under to display correctly my application? Regards, Jose L. Camara -- To unsubscribe: mailto:[EMAIL PROTECTED
RE: Application configuration
The configuration you show only lets Tomcat execute servlets. All other content, Apache will try to serve directly. Is this your intent? It would also help to know which version of Tomcat 3.x you are using. (Note that Tomcat 3.3 does the best job of automating the connection to Apache.) In general, I would also recommend testing your web application first by accessing Tomcat directly. If everything works okay, then try accessing through Apache. A web.xml isn't required as long as you are happy with what Tomcat provides by default. Cheers, Larry -Original Message- From: Camara, Jose [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 12, 2001 10:01 PM To: '[EMAIL PROTECTED]' Subject: Application configuration I think I reach that point where I need some help ... could you subscribe me and help me with the following issue. Totally new in configuring applications to be deployed on tomcat: 1) Apache and tomcat are running perfectly 2) I created a directory to install my application (webapps/imr) 3) Under that, I created META-INF, WEB-INF and servlets directories. 4) I also modified tomcat-apache.conf as follows Alias /imr /home/jcamara/tomcat/webapps/imr Directory /home/jcamara/tomcat/webapps/imr Options Indexes FollowSymLinks /Directory ApJServMount /imr/servlet /imr Location /imr/WEB-INF/ AllowOverride None deny from all /Location Location /imr/META-INF/ AllowOverride None deny from all /Location 5) I'm starting to believe that I need to create a web.xml file and I'm not sure how, probably I'll follow one of the examples. 6) I can see the list of classes for my application under that directory. 7) Every time I'm trying to run the application it asked me for download the application on IE and finally come with an error saying Could not find the main class. Program will exit! on a Java Virtual Machine pop up screen. I'm 100% sure that I'm missing something, so here are my questions: Q1: Do I need to create a web.xml file? Q2: Where should I put the jar files that my application need? Q3: How should I configure Tomcat in under to display correctly my application? Regards, Jose L. Camara -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Application configuration
Thanks Larry, I don't even reach the point where Tomcat itself is running my application. I guess I need to indicate Tomcat where and how to recognize the classes for my application. Setting up my application in tomcat is the problem. Regards, Jose L. Camara -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 4:58 AM To: 'Tomcat Users List' Subject: RE: Application configuration The configuration you show only lets Tomcat execute servlets. All other content, Apache will try to serve directly. Is this your intent? It would also help to know which version of Tomcat 3.x you are using. (Note that Tomcat 3.3 does the best job of automating the connection to Apache.) In general, I would also recommend testing your web application first by accessing Tomcat directly. If everything works okay, then try accessing through Apache. A web.xml isn't required as long as you are happy with what Tomcat provides by default. Cheers, Larry -Original Message- From: Camara, Jose [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 12, 2001 10:01 PM To: '[EMAIL PROTECTED]' Subject: Application configuration I think I reach that point where I need some help ... could you subscribe me and help me with the following issue. Totally new in configuring applications to be deployed on tomcat: 1) Apache and tomcat are running perfectly 2) I created a directory to install my application (webapps/imr) 3) Under that, I created META-INF, WEB-INF and servlets directories. 4) I also modified tomcat-apache.conf as follows Alias /imr /home/jcamara/tomcat/webapps/imr Directory /home/jcamara/tomcat/webapps/imr Options Indexes FollowSymLinks /Directory ApJServMount /imr/servlet /imr Location /imr/WEB-INF/ AllowOverride None deny from all /Location Location /imr/META-INF/ AllowOverride None deny from all /Location 5) I'm starting to believe that I need to create a web.xml file and I'm not sure how, probably I'll follow one of the examples. 6) I can see the list of classes for my application under that directory. 7) Every time I'm trying to run the application it asked me for download the application on IE and finally come with an error saying Could not find the main class. Program will exit! on a Java Virtual Machine pop up screen. I'm 100% sure that I'm missing something, so here are my questions: Q1: Do I need to create a web.xml file? Q2: Where should I put the jar files that my application need? Q3: How should I configure Tomcat in under to display correctly my application? Regards, Jose L. Camara -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Application configuration
You still haven't indicated which version of Tomcat, so it is hard to make specific recommendations. For all 3.x and 4.x Tomcats, creating a subdirectory under the webapps directory is the simplest way to bring a new web application online. Tomcat will automatically serve these subdirectories without requiring config file changes. You seem to have done this. However, I can't tell much from I don't even reach the point where Tomcat itself is running my application. What error is reported when you try to run a servlet? What do you see in the log files? Cheers, Larry P.S. If you are not familar with the Servlet specs, you can download it from here: http://java.sun.com/products/servlet/download.html Tomcat 3.x implements Servlet 2.2, Tomcat 4.x implements Servlet 2.3. -Original Message- From: Camara, Jose [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 12:27 PM To: 'Tomcat Users List' Subject: RE: Application configuration Thanks Larry, I don't even reach the point where Tomcat itself is running my application. I guess I need to indicate Tomcat where and how to recognize the classes for my application. Setting up my application in tomcat is the problem. Regards, Jose L. Camara -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 4:58 AM To: 'Tomcat Users List' Subject: RE: Application configuration The configuration you show only lets Tomcat execute servlets. All other content, Apache will try to serve directly. Is this your intent? It would also help to know which version of Tomcat 3.x you are using. (Note that Tomcat 3.3 does the best job of automating the connection to Apache.) In general, I would also recommend testing your web application first by accessing Tomcat directly. If everything works okay, then try accessing through Apache. A web.xml isn't required as long as you are happy with what Tomcat provides by default. Cheers, Larry -Original Message- From: Camara, Jose [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 12, 2001 10:01 PM To: '[EMAIL PROTECTED]' Subject: Application configuration I think I reach that point where I need some help ... could you subscribe me and help me with the following issue. Totally new in configuring applications to be deployed on tomcat: 1) Apache and tomcat are running perfectly 2) I created a directory to install my application (webapps/imr) 3) Under that, I created META-INF, WEB-INF and servlets directories. 4) I also modified tomcat-apache.conf as follows Alias /imr /home/jcamara/tomcat/webapps/imr Directory /home/jcamara/tomcat/webapps/imr Options Indexes FollowSymLinks /Directory ApJServMount /imr/servlet /imr Location /imr/WEB-INF/ AllowOverride None deny from all /Location Location /imr/META-INF/ AllowOverride None deny from all /Location 5) I'm starting to believe that I need to create a web.xml file and I'm not sure how, probably I'll follow one of the examples. 6) I can see the list of classes for my application under that directory. 7) Every time I'm trying to run the application it asked me for download the application on IE and finally come with an error saying Could not find the main class. Program will exit! on a Java Virtual Machine pop up screen. I'm 100% sure that I'm missing something, so here are my questions: Q1: Do I need to create a web.xml file? Q2: Where should I put the jar files that my application need? Q3: How should I configure Tomcat in under to display correctly my application? Regards, Jose L. Camara -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]