Re: EXECUTE an external .exe-file (+Parameters) that creates data-filesI want to use later in my servlet
I think you'll need the full (absolute) path to the exe. There is a call in the servlet api to translate a relative path to an absolute path in the server's file system but I can't remember what it is. Otherwise, put data.exe somewhere on the system path and drop the relative directory part. - Original Message - From: Patrick Kosiol [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, January 21, 2003 11:35 AM Subject: EXECUTE an external .exe-file (+Parameters) that creates data-filesI want to use later in my servlet Hi, I'm runnung TomCat 4.0.4 and I want to start an external .exe-File. My Code: String[] runString = {relativeDataPath + data.exe, parameter0, parameter1, parameter2, parameter3}; Process p = Runtime.getRuntime().exec(runString); System.out.println(runString); if(p.waitFor() == 0){ The 'data.exe'-File is placed in $CATALINA_HOME/webapps/ROOT/relativeDataPath so it should be no problem to access this File. The Number of Parameters etc. is OK. But I get the following Error-Message: java.io.IOException: CreateProcess: 'relativeDataPath'/bfpldata.exe parameter0 parameter1 parameter2 parameter3 error=2 error=2 means imho that the File is not found. How can I execute my file to do that, what I want. Is it possible that the process can create files in the Tomcat folders? Thx Patrick -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL
Just set up tomcat to serve ssl on port 443 (the default for https as 80 is http) and you won't need to specify the port. - Original Message - From: Ravindra K. Bhat [EMAIL PROTECTED] To: Ravindra K. Bhat [EMAIL PROTECTED] Cc: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, January 23, 2003 9:11 PM Subject: URL Hi: I wanted the users to not see the port when they browse..ie instead of the url being https://www.mydom.com:8443/**.* i would rather have them see https://www.mydom.com/**.* Also .. I have connected Apache 2.1 with TCAT 2.0.6 w/ ssl using mod_jk..but my pages loaded slowly (mostly servlets - I have no static pages except login).. so now I have ssl directly with Tomcat 2.0.6 the speed has increased dramatically...is there any downside to running Tcat without Apache? Ravi -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: compiling files in the classes directory
Sorry, you'll have to compile yourself Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Richard Chamberlain [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 11:27 PM To: Tomcat List Subject: compiling files in the classes directory Hello, Sorry if this is a really dumb question. Do java files in WEB-INF/classes automatically get compiled? I just presumed they would because that's the default behavior of resin, however I've created a java file and it doesn't appear to be doing so. If it doesn't is there anyway of getting Tomcat to do that? - or do I have to stop being lazy and compile myself? Thanks in advance, Richard -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.384 / Virus Database: 216 - Release Date: 21/08/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.384 / Virus Database: 216 - Release Date: 21/08/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Getting mod_webapp - should I give up?
As far as I can see, mod_webapp was designed to be an easier to setup way of integrating apache and tomcat and it succeeds in this on windows for apache 1.3 and tomcat 4.0x. However, it will serve all content from a directory you configure it for from tomcat whereas mod_jk* will leave html, jpg, gif etc to Apache. The way round this is to have your pics and static pages in a different location that is served by Apache alone and referenced as /static/xxx or similar but this then loses the convenience of a single war file containing everything needed for the application (it can even include a mod_jk conf file which can help with mapping servlets without the need for the ugly /servlet/servlet_name of the auto-created jk conf filers of tomcat 3) Worse than the above, I have found that large requests or frequent requests or just at random cause tomcat to give an error about the client terminating or some such and hang. With mod_jk this doesn't happen (or with tomcat standalone). Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Murray Cumming [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 10:04 AM To: Murray Cumming Cc: Tomcat-User Subject: Getting mod_webapp - should I give up? So, nobody can help me to build mod_webapp, and there is no rpm of it to download. Does this just mean that it can't be built? I don't remember where I read that mod_webapp was the correct way to integrate Apache2 and Tomcat4. The documentation is a bit fragmented. Is mod_jk* the true way to do this? If so, could someone give me a URL to a definitive page that says this and how to get/build it? I just want to integrate Apache2 and tomcat4, not do anything special. About a year ago I did successfully integrate Apache1 and tomcat, but I haven't worked with tomcat since then. On Tue, 2002-08-13 at 17:20, Murray Cumming wrote: OK, so if I had read README.txt properly then I would know that I need to do a cvs checkout of apr into the webapp directory. It tells me to copy and modify a build.properties.sample file, but there is no such file there, so I ignored that. As instructed, I then ran support/buildConf.sh This creates a configure script, which I am tempted to run, but the next step tells me to run ant. I did that, and I still this error: BUILD FAILED file:/home/murrayc/jakarta-tomcat-connectors-4.0.4-src/webapp/build.xml:105: Cannot find Tomcat 4.0 classes So, how do I tell it where to find these tomcat classes? I have already installed jakarta-tomcat-4 from here: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.4/rpms/ -- Murray Cumming [EMAIL PROTECTED] www.murrayc.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.380 / Virus Database: 213 - Release Date: 24/07/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.380 / Virus Database: 213 - Release Date: 24/07/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: What version of Java is necessary to run Tomcat
Tomcat 4 requires 1.3.1 or later, I believe. Also for JSP pages you will need the sdk not just the rte since it needs tools.jar for the javac compiler to compile the servlets generated by jasper. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Bruce Bailey [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 18, 2002 3:54 PM To: Tomcat Users Subject: What version of Java is necessary to run Tomcat Hi I have installed the Tomcat server on my TRU64 system. Every time I try to start the server, it aborts, leaving 'Unable to initialize threads: cannot find class java/lang/Thread' in the catalina.out log file. I am beginning to suspect that I have either an incomplete/incorrect installation of Java or that the version that I have is too old. I am running version 1.1.7B-2 of Java (RTE only). One thing that looks odd to me is that the java and javac executables reside in /etc/bin rather than dedicated directory with jar files etc. This same installation package of Tomcat works just fine on my Linux box, running version 1.3.1 of Java. I am using version 4.0.4 of Tomcat. Thanks in advance, Bruce Bruce Bailey 2525 SW First Avenue Portland, OR 97201 (503) 294-4206 [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.375 / Virus Database: 210 - Release Date: 10/07/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.375 / Virus Database: 210 - Release Date: 10/07/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: sevlets and applets
showDocument will simply show the content at the URL you pass to it and doesn't care whether it is a static html file, dynamic content from a jsp or servlet or even some other mime type such as a pdf file. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Serdar BOZDAG [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 17, 2002 7:38 AM To: tomcatGroup Subject: sevlets and applets hi, i have a question about servlets. in my applet I use showdocument method to open a servlet in a new browser window. this servlet reads the contents of a file that user choose. this servlet needs the send the content of the file to the applet but since showdocument is used out.println() command in the servlet shows the content in the browser window. I may use urlconnection.connect() in applet to call the servlet but this time the wizard for file choosing will not be displayed. (servlet displays a form in doGet method and get the contents of the form in doPost method and at the end of the doPost method result must be given to the applet.) my question is with showdocument method of applet can i get the result of a servlet. (i know quite an awkward question but i was not able to write more simpler) thanks in advance, serdar --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.375 / Virus Database: 210 - Release Date: 10/07/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.375 / Virus Database: 210 - Release Date: 10/07/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: how can a client upload file via an applet
The problem with using an applet is that usually it wouldn't have access to files on the client machine. The alternative is to use straight html with a FORM with an input type=file in it which will produce a proper file selector dialog on the client and then send the file data up to the server. JavaPro January 2002 has a good article on how to do this, which we have successfully cannibalised for sending mpx files to our application. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Serdar BOZDAG [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 16, 2002 8:38 AM To: tomcatGroup Subject: how can a client upload file via an applet hello, i am trying to write an applet that has an file upload service. Users will able to give the full path of their files to the applet (c:\files\file1.txt for instance) as input and applet will going to get the contents of this file and write the content to the database which is in the server. how can i accomplish this task? thanks in advance, serdar --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.375 / Virus Database: 210 - Release Date: 10/07/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.375 / Virus Database: 210 - Release Date: 10/07/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat w/ Apache Configuration Issues == Please Help
I've just read through your httpd.conf file and as far as I can see you haven't integrated tomcat and apache at all. You will need to load either mod_webapp or mod_jk to connect them together. These will associate tomcat with one or more virtual directories in just the way you want. You can then disable the tomcat stand-alone connector so it can't be accessed on 8080. You should have a look at previous threads here on mod_webapp, mod_jk and mod_jk2. Our own application currently runs on apache 1.3 and tomcat 3.2.3 using mod_jk and that works very well. Only servlet and .jsp requests get forwarded to tomcat, the rest are handled directly by apache. I'm currently experimenting with tomcat 4.03 but the integration with apache 1.3 is trickier. I've found mod_webapp easy to set up but flaky, while mod_jk is tricky to get going. However, the tomcat handling of static pages is faster so we might just drop Apache. Hope this helps Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 14, 2002 2:50 PM To: [EMAIL PROTECTED] Subject: Tomcat w/ Apache Configuration Issues == Please Help Hi All, I'm relatively new to Tomcat and I'm having a couple of vexing Tomcat w/ Apache configuration issues. Any help in solving these problems would be greatly appreciated. First, the particulars: Tomcat 4.0 is running with Apache 1.3 on a RedHat Linux (7.3) Intel machine (P4; 1.5 GB). Tomcat was installed via RPMs to /var/tomcat4. The JSPs that we want to serve with Tomcat are located in /bioinformatics/webapps/bioinformatics;currently,thereareno subdirectories off of this directory. Apache is configured with a main server (DocumentRoot /home/www/biigweb; ServerName biigserver.ist.unomaha.edu) and a VirtualHost which points to the directory that contains our JSPs and has the ServerName bioinformatics.ist.unomaha.edu. I am having two major problems: 1) Although our JSPs run correctly, neither the list nor the manager contexts do. 2) Tomcat is apparently intercepting ALL httpd requests. For example, the address http://biigserver.ist.unomaha.edu/ tries to access the same directory that Tomcat is tied to. Besides, these problems, I have two other general questions. First, is it possible to configure Tomcat so that the port number does not have to be specified in the URL?Specifically, we would like to use http://bioinformatics.ist.unomaha.edu/bioinformatics to access our JSPs. Second, in server.xml, do I need to change localhost to the DNS name of the machine? Relevant portions of error.log (Apache), httpd.conf (Apache) and server.xml (Tomcat) are below. httpd.conf and server.xml are attached in their entirety. Relevant portion of error.log: Tue Jul 9 12:53:49 2002] [error] [client 137.48.131.225] File does not exist: /bioinformatics/webapps/index.html [Tue Jul 9 12:53:50 2002] [error] [client 137.48.131.225] File does not exist: /bioinformatics/webapps/index.html [Tue Jul 9 12:54:00 2002] [error] [client 137.48.131.225] Directory index forbi dden by rule: /bioinformatics/webapps/ [Tue Jul 9 12:55:26 2002] [error] [client 137.48.131.225] Directory index forbi dden by rule: /bioinformatics/webapps/ [Tue Jul 9 13:03:46 2002] [error] [client 137.48.131.225] Directory index forbi dden by rule: /bioinformatics/webapps/ [Tue Jul 9 13:03:48 2002] [error] [client 137.48.131.225] Directory index forbi dden by rule: /bioinformatics/webapps/ Relevant portion of httpd.conf: ### Section 2: 'Main' server configuration ... ServerName biigserver.ist.unomaha.edu DocumentRoot /home/www/biigweb Directory / Options FollowSymLinks AllowOverride None /Directory Directory /home/www/biigweb Options Indexes Includes FollowSymLinks Options ExecCGI AllowOverride AuthConfig Order allow,deny Allow from all /Directory Relevant portion of server.xml: Host name=localhost debug=0 appBase=webapps unpackWARs=true Valve className=org.apache.catalina.valves.AccessLogValve directory =logs prefix=localhost_access_log. suffix =.txt pattern=common/ Logger className=org.apache.catalina.logger.FileLogger directory =logs prefix=localhost_log. suffix=.txt timestamp=true/ Contextpath=/var/tomcat4 docBase=/bioinformatics/webapps debug=0/ !-- Tomcat Manager Context -- Context path=/manager docBase=manager debug=0 privileged =true/ !-- Tomcat Examples Context -- Context path=/examples docBase=examples debug=0 reloadable =true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_examples_log. suffix=.txt timestamp=true/ Ejb name=ejb/EmplRecord type=Entity home =com.wombat.empl.EmployeeRecordHome remote
RE: JDBC Error
Just a guess, but could your database connection be timing out under linux? Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Roger Maltby [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 8:18 PM To: Tomcat User (E-mail) Subject: JDBC Error I have an application which is running fine on WinNT but on Linux it fails under the following condition: - the first time into the application - no problem - I close the web browser - it is left for about 15 to 20 minutes - I try to start the application again I get the error I have debug set in Apache and Tomcat but they do not give me any clues. Below I have my configuration and the top portion of the error log file. I would appreciate any guidance/suggestions which would help me track this down. Thanks Roger Configuration: == Apache: 1.3.23 Jakarta-Tomcat: 4.0.3 Java: jdk-1.3.1_03 RedHat: 7.3 Progress: 9.1d hs_err_pid1323.log file: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x819e1a5 Function name=(N/A) Library=(N/A) NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at com.progress.sql.jdbc.JdbcProgress.allocStmt(Native Method) at com.progress.sql.jdbc.JdbcProgress.SQLAllocStmt(JdbcProgress.java:244) at com.progress.sql.jdbc.JdbcProgressConnection.prepareStatement(JdbcProgressCo nnection.java:488) at com.progress.sql.jdbc.JdbcProgressConnection.prepareStatement(JdbcProgressCo nnection.java:466) at com.bitmechanic.sql.PooledConnection.prepareStatement(PooledConnection.java: 352) at Authenticate.query(Authenticate.java:79) at Authenticate.init(Authenticate.java:34) at SiteServ.tryLogin(SiteServ.java:1444) at SiteServ.handleRequest(SiteServ.java:72) at org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3 31) at org.apache.velocity.servlet.VelocityServlet.doPost(VelocityServlet.java:301) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.370 / Virus Database: 205 - Release Date: 05/06/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.370 / Virus Database: 205 - Release Date: 05/06/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: LDAP Authentication with Tomcat 4.1.3
Is having two OU entries OK? Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Josh Fenlason [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:12 PM To: Tomcat Subject: LDAP Authentication with Tomcat 4.1.3 I'm trying to do LDAP Authentication in Tomcat 4.1.3. I found some a couple of links that said to use LDAPRealm in Tomcat's server.xml, but I still haven't had any luck. Has anyone else been able to get this to work? Here are the two Realm elements that I've tried in server.xml. Any help would be greatly appreciated. Thanks. , Josh. Realm className=com.peacetech.webtools.tomcat.LdapRealmCatalina debug=1 directoryUrl = ldap://corvette.mn.ptc.com:389; searchBindDN = ou-jfenlason_r62DC,ou=jfenlason,l=Arden Hills,o=Bethel searchBindCredentials = mypassword searchBaseContext = o=PTC searchFilter = cn={0} searchScopeAsString = sub securityAttributes = securityEquals attributesReadByOwner = true connectionMaxPoolSize = 10 ldapVersion = 3 / Realm className=org.apache.catalina.realm.LDAPRealm ldapContextFactory=com.sun.jndi.ldap.LdapCtxFactory ldapServer=ldap.corvette.mn.com ldapPort=389 ldapDN=cn=%u,ou=jfenlason_r62DC,ou=jfenlason,l=Arden Hills,o=Bethel ldapGroupContext=ou=jfenlason_r62DC,ou=jfenlason,l=Arden Hills,o=Bethel ldapGroupFilter=(amp;(uniquemember=%dn)(objectclass=groupOfUniqueNames)) ldapRoleAttribute=cn debug=99 / -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Is it available Tomcat 2?
I think you've been fed some April fool stories, Luca Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Luca Ventura [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 10:37 AM To: tomcat-user Subject: Is it available Tomcat 2? Hello everybody! I would like to know if it is true that the next version of Tomcat (called Apache 2) supports ASP pages. Is it Apache 2 available for download (final version)? Thanks a lot in advance! Luca -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: mod_jk2
I believe its mod_jk for Apache 2 Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Josh Fenlason [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 2:35 PM To: Tomcat Subject: mod_jk2 Does anyone know anything about mod_jk2? Is it a new and improved mod_jk? What changes were made? I've looked around quite a bit and all I've been able to find is the binaries. If anyone knows where I could find some more detailed documentation, source code or would be able to give me some more info, I would greatly appreciate it. Thanks. , Josh. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to write files when web-app is a WAR?
If the war file is unpacked (which tomcat will do automatically at startup unless you specify somewhere in server.xml not to) then it is just as if you had deployed to the webapp\your_app directory yourself. I believe that leaving war's unpacked results in slightly worse performance and isn't recommended for a deployment server anyway. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Chris Bailey [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 8:02 PM To: Tomcat Mailing List Subject: How to write files when web-app is a WAR? From what I've read, it seems that if you package your web application in a WAR file, you have no way of attaining a path on the server's file system that you can use to write files. Reference: http://mikal.org/interests/java/tomcat/archive/view?mesg=15006. I have a web app that we'd like to package as a WAR. But, we need to be able to write various data files out to the server's file system. What solution(s) are people using for this? Writing the files to a database is not acceptable for us (I'm not a DBMS expert, but have been told that BLOB performance is not great, and that using a DB as a file system replacement is not good, etc.). I was thinking we'd have to do a bit of a hack... Basically, at the time we install our application, the user will pick the real path on their disk where the data files are stored. We then store this in a property in web.xml, and retrieve that in the app for using as the path. For links/hrefs on a web page, we'd just use something like /data_files, but then set up a path-mapping that had /data_files mapped to say /home/appname/data_files or whatever. I also am assuming I will need to ensure that this real path lies outside of the WAR expanded directory because someday Tomcat (and maybe others already?) will not expand the WAR file. Anyway, what have folks come up with? While we use Tomcat for all our development work, we'll likely have to support a variety of Servlet containers (I think we can require at least Servlet 2.2, hopefully 2.3). Chris Bailey mailto:[EMAIL PROTECTED] Code Intensity http://www.codeintensity.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Restricting Access to Web Resources
I believe the URL you want is /* i.e. the /MyApp is assumed since you are defining the constraint in the MyApp context Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Urtzi Larrazabal [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 10:01 AM To: 'Tomcat Users List' Subject: Restricting Access to Web Resources Hi friends, I am trying to protect my application with an authentification but I don't know why my security constraint is ignored. When I access to the application I'm not prompted for a user and a password. Does anyone know what am I doing wrong? #cd webapps/Myaplicaion/WEB-INF #more web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app security-constraint web-resource-collection web-resource-name Restricted Area /web-resource-name url-pattern/Myaplication/*/url-pattern /web-resource-collection auth-constraint role-nametomcat/role-name /auth-constraint /security-constraint login-config auth-methodBASIC/auth-method realm-nameMy Secure Test Area/realm-name /login-config /web-app regards, Urtzi Larrazabal -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: new tomcat user: migrating app from resin
It would seem as if you don't have a web-app /web-app wrapping all the entries in you web.xml. If so it should be trivial to put it in Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Scott Dudley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 5:00 PM To: Tomcat Users List Subject: Re: new tomcat user: migrating app from resin Shapira, Yoav wrote: Howdy, Some more information would be nice ;) 1) Did you verify that tomcat installed correctly, e.g. by running the examples? yes. 2) Are there any errors in the tomcat logs relevant to parsing / deploying / starting your web-app? yes. 2002-06-04 16:20:52 ContextConfig[/accountaccess-4-3] Parse error in application web.xml org.xml.sax.SAXParseException: Element type web-app must be declared. at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java) at org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError(X MLValidator.java) at org.apache.xerces.validators.common.XMLValidator.validateElementAndAttribute s(XMLValidator.java) at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidat or.java) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM LDocumentScanner.java) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner. java) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java) at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java) at javax.xml.parsers.SAXParser.parse(SAXParser.java) at javax.xml.parsers.SAXParser.parse(SAXParser.java) at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275) at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.ja va:256) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:824) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java: 224) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:155) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3345) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454) at org.apache.catalina.core.StandardHost.install(StandardHost.java:714) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:155) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131) at org.apache.catalina.core.StandardHost.start(StandardHost.java:614) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:506) at org.apache.catalina.startup.Catalina.start(Catalina.java:781) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) 2002-06-04 16:20:52 ContextConfig[/accountaccess-4-3]: Occurred at line 7 column 10 2002-06-04 16:20:52 ContextConfig[/accountaccess-4-3]: Marking this application unavailable due to previous error(s) 2002-06-04 16:20:52 StandardContext[/accountaccess-4-3]: Error initializing naming context for context /accountaccess-4-3 2002-06-04 16:20:52 StandardContext[/accountaccess-4-3]: Context startup failed due to previous errors 3) What do you mean when you say you couldn't create a context in server.xml? not that i couldn't create a context but that it had no affect. ignorant as i am :-) , i think the parse error above indicates the problem and that it will not be trivial to get out app running under tomcat which is unfortunate. i really wanted to test tomcat and to compare performance of the two servers. Yoav Shapira Millennium ChemInformatics -Original Message- From: Scott Dudley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 11:23 AM To: [EMAIL PROTECTED] Subject: new tomcat user: migrating app from resin i've installed tomcat 4.0.3-1 from rpm and am attempting to migrate an app that's currently running under resin. i copied the app tree to $CATALINA_HOME/webapps and restarted tomcat but when i attempt to access the app, i get a 404. i also tried to create a context in $CATALINA_HOME/conf/server.xml
RE: Restricting Access to Web Resources
In the default tomcat setup (I'm assuming you're using 4.0.3) the memory realm is declared in server.xml. This reads users, passwords and roles from tomcat-users.xml also in the conf directory. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Urtzi Larrazabal [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 2:12 PM To: 'Tomcat Users List' Subject: RE: Restricting Access to Web Resources ohh!! you are right ! But now, when I try to access to my aplication I am prompted for a user and a password,and if I introduce tomcat user and tomcat password I can't access. Where must be defined the users with access permisions, I mean where must I especify the role-nametomcat/role-name ?? In the directory /conf/users there are some files:admin-users.xml example-users.xml global-users.xml tomcat-users.xml thanks a lot ! -Original Message- From: John Burgess [mailto:[EMAIL PROTECTED]] Sent: jueves 6 de junio de 2002 14:54 To: Tomcat Users List Subject: RE: Restricting Access to Web Resources I believe the URL you want is /* i.e. the /MyApp is assumed since you are defining the constraint in the MyApp context Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Urtzi Larrazabal [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 10:01 AM To: 'Tomcat Users List' Subject: Restricting Access to Web Resources Hi friends, I am trying to protect my application with an authentification but I don't know why my security constraint is ignored. When I access to the application I'm not prompted for a user and a password. Does anyone know what am I doing wrong? #cd webapps/Myaplicaion/WEB-INF #more web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app security-constraint web-resource-collection web-resource-name Restricted Area /web-resource-name url-pattern/Myaplication/*/url-pattern /web-resource-collection auth-constraint role-nametomcat/role-name /auth-constraint /security-constraint login-config auth-methodBASIC/auth-method realm-nameMy Secure Test Area/realm-name /login-config /web-app regards, Urtzi Larrazabal -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: This has me ???Puzzled???: Switch being done but not really
Without a default case or some other initialisation for subTitle etc what would happen if page was passed in as 99, for example. The java compiler is being very 'nanny'ish but it is sensible in its own terms. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Nicholas Orr [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 12:35 AM To: 'Tomcat Users List' Subject: RE: This has me ???Puzzled???: Switch being done but not really Thanks for that, How come those lines make all the difference? When I had a 'default' case in my switch everything worked fine, but I didn't want a default in there. So I took it out. Then I got my problem, how come. Nicholas -Original Message- From: Galbayar [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 9:28 AM To: Tomcat Users List Subject: RE: This has me ???Puzzled???: Switch being done but not really add this sPage = request.getParameter(Page); sSubTitle=null; sFormName=null; sPageName ** The information contained in this e-mail is confidential and is intended only for the use of the addressee(s). If you receive this e-mail in error, any use, distribution or copying of this e-mail is not permitted. You are requested to forward unwanted e-mail and address any problems to the MIM Holdings Limited Support Centre. For general enquires: ++61 7 3833 8000 Support Centre e-mail: [EMAIL PROTECTED] Support Centre phone: Australia 1800500646 International ++61 7 38338042 ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.365 / Virus Database: 202 - Release Date: 24/05/02 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ApacheJSSI.jar and Tomcat
I believe jars for servlets need to go in the TOMCAT_ROOT/webapps/your_app_name/WEB-INF/lib folder. i.e. to be in your web application's folder hierarchy. Also JSSI seems a rather old tool -- could you not use jsp:include page=relative URL flush=true / and use JSP instead. Best Wishes (and I hope your trousers have dried out a bit!) John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Elizabeth Barham [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 28, 2002 6:16 AM To: Tomcat Users List Subject: ApacheJSSI.jar and Tomcat Hi, I download ApacheJSSI.jar from: http://java.apache.org/jservssi/dist/ And placed it in: TOMCAT_ROOT/server/lib I then updated web.xml: servlet servlet-namejhtml/servlet-name servlet-classorg.apache.servlet.ssi.SSI/servlet-class init-param param-namedebug/param-name param-valueyes/param-value /init-param load-on-startup4/load-on-startup /servlet servlet-mapping servlet-namejhtml/servlet-name url-pattern*.jhtml/url-pattern /servlet-mapping Unfortunatly, though, when I startup Tomcat, I get this error in the log: java.lang.ClassNotFoundException: org.apache.servlet.ssi.SSI Although this is in ApacheJSSI.jar residing in the TOMCAT_ROOT/server/lib directory: 2395 06-22-99 19:20 org/apache/servlet/ssi/SSI.class I have tried renaming ApacheJSSI.jar to servlets-jssi.jar but it still continues to have the problem. I'm interested in using SSI pages that have the servlet tag - jssi. Any ideas on how to remedy this are most welcome! Thank you, Elizabeth -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/02 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Question about web.xml
In your servlet section after the servlet-class entity you can put in 0, 1 or more init-param entities ... servlet init-param param-namedns_server/param-name param-valuemyDNS/param-value /init-value ... /servlet ... In your code for the servlet init method you get passed a ServletConfig and that has a method getInitParameter which takes the param-name as a string and returns the param-value also as a string Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: IvanLatysh [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 5:39 PM To: Tomcat Apache Subject: Question about web.xml Hi All. I have small problem and I couldn't decide what to do. My application (JSP + Servelt) using dns server to perform dns lookup. I want to put dns server name into some external configuration file for convience. It seems that file web.xml could be used for this. Please help with idea where to put some configuration parameters for application. Sincerely yours, Ivan Latysh. [EMAIL PROTECTED] http://ivan.yourmail.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/02 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: LoadModule webapp_module modules/mod_webapp.so
One thing I've noticed is that you have two WebAppConnection lines, both defining the same name of connection -- either remove one or give its connection a name other than warpConnection. (See at end, and just before the virtualhost section (40 lnes up maybe?) ) Also you don't do AddModule Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: yilmaz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 5:25 PM To: Tomcat Users List Subject: Re: LoadModule webapp_module modules/mod_webapp.so okey, Here is my httpd.conf file, can someone please help me find out , where the problem is? Thanks :) (though a little bit dangerous, it seems that there is no other way to be able to solve the problem) - Original Message - From: Simon Stewart [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 12:07 AM Subject: Re: LoadModule webapp_module modules/mod_webapp.so Above any WebApp* directives. In apache 2, also include the port number. I've got: ServerName localhost:80 in my httpd.conf On Wed, Apr 24, 2002 at 11:52:45AM -0400, Dan K. wrote: Also, make sure you have a ServerName directive in your httpd.conf if you don't have it. Regards, Dan Cheers, Simon -- Even had to open up the case and gaze upon the hallowed peace that graced the helpdesk that day. -- Megahal (trained on asr), 1998-11-06 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/02 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Directory Listing per web-app
Adding a welcome file for the web-app should turn off directory listing Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Chad Perry [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 6:53 PM Subject: Directory Listing per web-app I know I can turn off directory listing for the entire tomcat 4.0.3 server via the conf/web.xml: servlet . . . param-namelistings/param-name param-valuefalse/param-value . . /servlet But how can one turn it off on a per web-app, per directory basis? Thanks -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/02 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Adobe Acrobat
Or alternatively use a printer driver that produces pdf files (Adobe Acrobat or Xeon Docucom are two) and print to file from the servlet, then return the file produced. The other suggestions are probably neater and open source but this does definitely work :-) Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Ravindra K. Bhat [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 10:39 PM To: Tomcat Users List Subject: Adobe Acrobat Hi: How do I render my html pages to pdf for printing. My servelet generated html table is too wide and columns get cut off if I print directly using the print icon on the browser... Thanks -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: NullPointerException when using JDBC ResultSet next() method
rs is NOT Being set -- you are getting the results into rset so use rset.next() etc. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Philip Kazmier, CEM RD [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 10:55 PM To: 'Tomcat Users List' Subject: RE: NullPointerException when using JDBC ResultSet next() method I apologize but I posted the wrong code. Here is the correct code. Line 45 is rs.next. I am not sure that the driver has loaded properly. How can I tell? Thanks. import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class ListAllOpenBugs extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { Connection con = null; //Statement stmt = null; ResultSet rs = null; int i = 0; res.setContentType(text/html); PrintWriter out = res.getWriter(); try { // Load Oracle driver //DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); // Load the MySQL driver Class.forName(org.gjt.mm.mysql.Driver); // Connect to the local database //Connection conn = //DriverManager.getConnection(jdbc:oracle:thin:172.24.230.20:1521:ORCL, system, manager); // Get a connection to the database con = DriverManager.getConnection(jdbc:mysql://localhost:3306/pssoftware?user=phi lkpassword=kirov); // Query the employee names Statement stmt = con.createStatement (); //ResultSet rset = stmt.executeQuery (select b.bug_row_id, b.status, ps.name, b.short_desc, b.date_opened from bug b, ps_software ps where b.software_id = ps.pss_row_id and b.status = 1); ResultSet rset = stmt.executeQuery (select sc_id from bug_status_codes); // Display the result set as a list out.println(HTMLHEADTITLEAll Open Bugs/TITLE); out.println(LINK REL=STYLESHEET HREF=\..\\NICEStyle.css\); out.println(/HEAD); out.println(BODY); out.println(TABLE); while(rs.next()) { // if (i == 1) // { // i=0; //out.println(TRTD + rs.getString(bug_row_id) + /TDTD + rs.getString(name) + /TDTD + rs.getString(status) + /TDTD + rs.getString(date_opened) + /TDTD + rs.getString(short_desc) + /TD/TR); //out.println(TRTD + rs.getString(bug_row_id) + /TD/TR); out.println(TRTD + rs.getString(sc_id) + /TD/TR); // } // else // { // i=1; //out.println(TRTD + rs.getString(bug_row_id) + /TDTD + rs.getString(name) + /TDTD + rs.getString(status) + /TDTD + rs.getString(date_opened) + /TDTD + rs.getString(short_desc) + /TD/TR); //out.println(TRTD + rs.getString(bug_row_id) + /TD/TR); // } } out.println(/TABLE); out.println(/BODY/HTML); } catch (ClassNotFoundException e) { out.println(Couldn't load the database driver- + e.getMessage()); } catch(SQLException e) { out.println(SQLException caught: + e.getMessage()); } finally { try { if (con != null) con.close(); } catch(SQLException ignored) { } } } }; -Original Message- From: August Detlefsen [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 1:19 PM To: Tomcat Users List Subject: Re: NullPointerException when using JDBC ResultSet next() method The stack trace says that your NullPointer occurs on line 45, but line 45 is blank. Is there some more code that you didn't ost? Import statements, perhaps? I think it probably happened here: stmt = con.createStatement(); -IE: You were not able to get a Connection, con is null and calling its methods will give you the NullPointer. Are you sure the driver loaded properly
RE: Adobe Acrobat
The two I know of are: Acrobat Distiller -- £150 or so but with horrendous licensing costs for using it in a web application Zeon Docucom http://www.zeon.com.tw costs about $65 but the license seems fine for use as part of a web app. However, both are windows specific. Zeon has a demo version but it requires you to press OK to a nag screen before each print. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Adrian Beech [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 11:06 AM To: Tomcat Users List Subject: Re: Adobe Acrobat Huh, there is a printer driver that produces PDF files? Tell me more... oh please tell me more! This could be an answer to an issue I have with trying to read reports generated in Crystal reports within a browser, h... Adrian [EMAIL PROTECTED] - Original Message - From: John Burgess [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, April 09, 2002 6:55 PM Subject: RE: Adobe Acrobat Or alternatively use a printer driver that produces pdf files (Adobe Acrobat or Xeon Docucom are two) and print to file from the servlet, then return the file produced. The other suggestions are probably neater and open source but this does definitely work :-) Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Ravindra K. Bhat [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 10:39 PM To: Tomcat Users List Subject: Adobe Acrobat Hi: How do I render my html pages to pdf for printing. My servelet generated html table is too wide and columns get cut off if I print directly using the print icon on the browser... Thanks -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 -- 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] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: N/w Problem (Puneet Sachar)
Hi Puneet This is off topic but If your structured cabling is already connected to the panel (usually called a patch panel) then its all very easy on the hardware side. Just make sure that the switching hub you are using is an UNMANAGED one -- if the ADCOM is managed then it requires setting up and will be a total pain for a tiny network like yours -- a 24 port unmanaged switching hub should only cost around £60 for a 10Mbs one, maybe £120 for a 10/100 autosensing one that will work with both 10Mbs and 100Mbs network interface card. Assuming you have an unmanaged hub then no setup is required. All you need are short patch cables (i.e. 40cm say lengths of cable with an rj45 jack at each end). You can buy tools for making the cables up but its a serious pain and quite expensive when you can buy them ready made for £1 or less each. You just take a patch cable from each socket on the patch panel into a socket on the switch and all is done. All the client machines need is a similar cable (but longer - 2M is probably good) to go from their network interface card (NIC) to the wall or floor box where each length of structured cabling comes out. If the panel isn't wired up or if you don't have any floor boxes wired up then the simplest thing is just to forget it and simply use an unmanaged switch on its own. All you need is a length of network cable for each machine and you just connect the machine's NIC to any port on the hub. That's it! The only problem with this is getting the cable neatly arranged and then working out which cable is which when machines move around -- structured cabling helps by hiding all the mess under the floor :( To begin with why not start simply peer to peer with the built in windows networking- you can add a dedicated server and make it Primary Domain Controller (PDC) later, once you're happy with the cabling etc.. Setting up the client machines could be as simple as installing the netbeui protocol on each one, giving it a unique name and setting the workgroup name to be the same for all machines (by default, windows uses a workgroup name of WORKGROUP -- there's no reason why you shouldn't stick with that. ) If however, you want shared internet access or to set up a workgroup web browser then you will have to use TCP/IP. You can use both TCP/IP and Netbeui but its probably better to just install tcp/ip in this case. The simplest way of doing this is then to create a text file called hosts with no suffix and put in it one line for each machine giving its name and a unique tcp/ip address. There are a number of ranges of numbers available for use by internal networks that you should choose from for example 192.168.x.y where x and y are arbitrary numbers between 1 and 222. So, assuming you use planets as your machine names, the file might look like 127.0.0.1 localhost ##always a good idea 192.168.1.1 mercury 192.168.1.2 venus 192.168.1.3 earth 192.168.1.4 mars 192.168.1.5 jupiter etc... Then set up each machine by installing tcp/ip protocol and configuring it to not use DNS and not use WINS and to have a fixed ip address, using the address for each machine assigned in the hosts file. Give the machine the correct name and put it in the workgroup. Then copy the hosts file to c:\winnt\system32\drivers\etc (for NT, 2000 and XP) or to c:\windows (for 95, 98, and ME) At a command prompt you should then be able to type ping localhost and see a list of replies received from the machine you typed the command on. Then try ping venus and you should see text to the effect of Pinging venus[192.168.1.2] with 32 bytes of data Reply from 192.168.1.2 bytes=32 time10ms TTL=128 Reply from 192.168.1.2 bytes=32 time10ms TTL=128 Reply from 192.168.1.2 bytes=32 time10ms TTL=128 Reply from 192.168.1.2 bytes=32 time10ms TTL=128 If so, then all should be well If not, promise your network knowledgeable friend a large drink if he'll help you out!!! Or start by uninstalling tCP/IP and installing netbeui which will almost certainly just work and let people use that for a time while you read up on simple tcp/ip installations.. It's really not difficult. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: puneet sachar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 10:50 AM To: Tomcat Users List; Tom Drake Subject: N/w Problem (Puneet Sachar) Hi friends Plz find with the word file along with this mail(virus scanned ) and help me if u have solutions for this Puneet __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version
RE: error 404
If 8080 is what you actually put in httpd.conf, are you sure that is the port the warp connector is on. 8008 is more usual, with 8080 being the http port for standalone tomcat. Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Yunce Gunawan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 1:22 PM To: Tomcat Users List Subject: error 404 hi all, i have added this charakters to my configuration on httpd.conf IfModule mod_webapp.c WebAppConnection conn warp picard:8080 WebAppDeploy tomcat conn / WebAppDeploy cocoon conn /cocoon WebAppInfo /webapp-info /IfModule and than on my browser i always see this error. WebApp: Error 404 (File: wa_request.c Line: 205) Web-application not yet deployed can anybody help me ? -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: error 404
Yunce Assuming a default tomcat setup- can you connect to http://localhost:8080/tomcat/your_file.jsp_here or http://localhost:8080/cocoon/your_file.jsp_here or http://picard.rz.hu-berlin.de:8080/tomcat/your_file.jsp_here If you first get tomcat standalone working then you have a firm foundation for getting apache/tomcat integration going Best Wishes John Burgess [EMAIL PROTECTED] Tel: 01865 718666 Fax: 01865 718600 -Original Message- From: Yunce Gunawan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 3:08 PM To: Tomcat Users List Subject: Re: error 404 On Wednesday 03 April 2002 15:23, you wrote: 1) What's the URL you are using? i use picard.rz.hu-berlin.de 2) check the tomcat logs to see if there were any errors when deploying the cocoon and tomcat web applications. i don't see any errors just this . .. 2002-04-03 15:46:33 DEBUG (2002-04-03) 15:46.33:597 [] (Unknown-URI) Unknown-thread/LogKitLogge r: Logger for category sitemap.serializer.html not defined in configuration. New Logger created and returne d 2002-04-03 15:46:33 DEBUG (2002-04-03) 15:46.33:604 [] (Unknown-URI) Unknown-thread/LogKitLogge r: Logger for category sitemap.serializer.html not defined in configuration. New Logger created and returne d 2002-04-03 15:46:33 DEBUG (2002-04-03) 15:46.33:608 [] (Unknown-URI) Unknown-thread/LogKitLogge r: Logger for category sitemap.serializer.html not defined in configuration. New Logger created and returne d 2002-04-03 15:46:33 DEBUG (2002-04-03) 15:46.33:621 [] (Unknown-URI) Unknown-thread/LogKitLogge r: Logger for category core.xscript not defined in configuration. New Logger created and returned 2002-04-03 15:46:33 StandardWrapper[/cocoon:default]: Loading container servlet default 2002-04-03 15:46:33 default: init 2002-04-03 15:46:33 StandardWrapper[/cocoon:invoker]: Loading container servlet invoker 2002-04-03 15:46:33 invoker: init 2002-04-03 15:46:33 jsp: init i don't understand, whats mean Unknown-URI) Unknown-thread/LogKitLogger , may u can help me... 3) The port in your WebAppConnection line should match port defined in server.xml. By default the WarpConnector listens on port 8008. See server.xml snip Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008/ /snip i have done 4) And again as others have already said, start Tomcat first and once you know that Tomcat has started, start Apache. i have done too... but this error always come :( i don't know now, what must i do thanks anyway... -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]