java startup option trouble
Hello List... I have a requirement to startup java with a -noverify option. I've put this is /etc/profile as a JAVA_OPTS value. My probem is on system startup, Tomcat starts ok but the classes that need the -noverify parameter don't work until I login as root, shutdown Tomcat then start it up again. It seems that the profile is not read until I've logged in (as root). If that's the case, how can I set it up so the -noverify parameter is the default when java loads? Tomcat 4.1.27 on Redhat 8.0 Thanks for any assistance. /j-p.
alias directive/Virtual host problem
Hello List... In order that a virtual host respond correctly to urls: http://mydomain.com http://www.mydomain.com I've had to add two host entries in server.xml (one for mydomain.com, the other for www.mydomain.com). I thought it would have been enough to add the alias directive for the www.mydomain.com in the mydomain.com host, thereby avoiding duplication within server.xml? Are there problems with the alias directive - or am I misinterpreting it's function? Is it just that my configuration is probably bad? Versions: Tomcat 4.1.24 standalone on redhat 9 Thanks for any suggestions, /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: alias directive/Virtual host problem
Thanks Patrick... then as suspected, I must have a misconfiguration: Host name=mydomain.com debug=0 appBase=webapps/mdom unpackWARs=true autoDeploy=true Context path= docBase= debug=0 reloadable=true crossContext=true Aliaswww.mydomain.com/Alias ... Now the index.jsp in mydomain.com (forwards to a servlet) works ok, but when I try www.mydomain.com, I get a 404 requested resource (/index.jsp) is not available. Any suggestions why this is occurring are much appreciated, /j-p. On Mon, 24 Nov 2003, Patrick Willart wrote: Hi JP, You don't need to do that. The Alias directive is able to do this. Alias111.111.111.111/Alias Aliasmydomain.com/Alias Aliaswww.mydomain.com/Alias In order that a virtual host respond correctly to urls: http://mydomain.com http://www.mydomain.com I've had to add two host entries in server.xml (one for mydomain.com, the other for www.mydomain.com). I thought it would have been enough to add the alias directive for the www.mydomain.com in the mydomain.com host, thereby avoiding duplication within server.xml? Are there problems with the alias directive - or am I misinterpreting it's function? Is it just that my configuration is probably bad? Versions: Tomcat 4.1.24 standalone on redhat 9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: alias directive/Virtual host problem
Bravo...that did it! Thanks again Patrick, /j-p. On Mon, 24 Nov 2003, Patrick Willart wrote: You might want to try placing you alias directives as the first thing inside the host directive. That's how I have it and if I am right the order of this is important (although I would expect you to see an error message in such case). Patrick -Original Message- From: john-paul delaney [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2003 9:33 AM To: Tomcat Users List Subject: RE: alias directive/Virtual host problem Thanks Patrick... then as suspected, I must have a misconfiguration: Host name=mydomain.com debug=0 appBase=webapps/mdom unpackWARs=true autoDeploy=true Context path= docBase= debug=0 reloadable=true crossContext=true Aliaswww.mydomain.com/Alias ... Now the index.jsp in mydomain.com (forwards to a servlet) works ok, but when I try www.mydomain.com, I get a 404 requested resource (/index.jsp) is not available. Any suggestions why this is occurring are much appreciated, /j-p. On Mon, 24 Nov 2003, Patrick Willart wrote: Hi JP, You don't need to do that. The Alias directive is able to do this. Alias111.111.111.111/Alias Aliasmydomain.com/Alias Aliaswww.mydomain.com/Alias In order that a virtual host respond correctly to urls: http://mydomain.com http://www.mydomain.com I've had to add two host entries in server.xml (one for mydomain.com, the other for www.mydomain.com). I thought it would have been enough to add the alias directive for the www.mydomain.com in the mydomain.com host, thereby avoiding duplication within server.xml? Are there problems with the alias directive - or am I misinterpreting it's function? Is it just that my configuration is probably bad? Versions: Tomcat 4.1.24 standalone on redhat 9 - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT]Re: Mobile phone on serial port - Howto send sms?
Hello List... Apologies for the cut and paste of the thread below... I just wanted to add an answer to the problem I had of how to send an sms using a servlet. I'm sure that the ability to send GSM text messages would be very useful - at least for the Euro-tomcatters. The following URL provides a small .jar to do exactly that: http://www.waex.com/techinfo/sms.htm (Many thanks to Philippe Bertramo for the code) /j-p. List: tomcat-user Subject: Re: Mobile phone on serial port - Howto send sms? From: Christopher Williams ccwilliams3 () ntlworld ! com Date: 2003-09-11 8:36:27 Seems a bit cheeky: the question how do I send SMS messages using Tomcat? is really how do I send SMS messages using Java? and there are probably more relevant mailing lists for that question. Anyway, presumably your mobile phone can impersonate a Hayes modem, so you need to open up your COM port and write Hayes commands to dial the number you want. Then you need to write your SMS message. This is a standard, so you need to obtain the appropriate standards documents. Then you hangup the phone, again using Hayes commands. An alternative is to use a web-based SMS service, such as the one on Lycos, and then post the appropriate data to the URL. There are commercial services available as well - do a Google search. List: tomcat-user Subject: [OT]Re: Mobile phone on serial port - Howto send sms? From: Kwok Peng Tuck pengtuck () makmal ! net Date: 2003-09-11 5:12:38 Another option is available to you John-Paul, specifically, http://www.kannel.org which is a wap and sms gateway. This gateway is based on linux although you can use cygwin to compile and run it, far from ideal but it does work and is usable enough for testing. The gateway does support most GSM modems and supports other major protocols like SMPP, CIMD... for connecting to telcos. Once you set it up you can send sms through it's http interface. So from your servlet or business logic class, just make a http call to the gateway with the correct parameters and your sms will be sent of. A library like commons http-client will be quite useful in this case. FYI : kannel is open source. Sai Sivanesan wrote: we have an affilliate company that has a product comming on the market that uses a Nokia 30 or Nokia 31 GSM modem(phone without a headset and with a rs232 port) and does exactly that. we have a client server version comming out - i will ask how its done - can't be too difficult as the app is mostly a vb piece. as long as i am not going to give away anything to proprietary i'll share it - why do you want to use a serial conection - do you need to receive sms msgs as well as send? cause if all you need to do is send, why don't you just dispatch it as an email? Sai. On Wed, 10 Sep 2003 23:34:51 -0100 (GMT+1), john-paul delaney wrote Hello List... this is a tricky one I believe, Serial port-connected mobile phone - I'd like to find out how to send sms messages using tomcat on linux. Anyone got any leads? I'd appreciate any help. thanks, /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Upload 2 images with one jdbc INSERT?
Hello List... Apologies if this is off-topic, I posted to the jdbc forum on sun with little response. I insert an image into a postgres db using the following code: URL urlImage = getServletContext().getResource( /images/ + imageFilename); URLConnection urlImageConn = urlImage.openConnection(); int urlImageLength = urlImageConn.getContentLength(); InputStream is = urlImage.openStream(); ... and using a preparedStatement, pStmt.setBinaryStream(1, is, urlImageLength); However I'd like to insert a second image into the same db record but don't know if it's possible to use the same inputstream. Thanks for any suggestions, /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Upload 2 images with one jdbc INSERT?
Thanks for the advice(s) Chris... I ignorantly hadn't realized I could open more than one stream, using only one stream returned a negativearray exception (?), while the second stream appears to have worked nicely. And yes, as you guessed - I hadn't closed the streams and URLConnections. I'll remember in future. regards /j-p. On Fri, 7 Nov 2003, Christopher Schultz wrote: I always try www.jguru.com -- I used to answer a lot of questions there. I should go back... Actually, I'm not entirely clear on when the stream is read. Either the PreparedStatement reads the stream immediately, or it reads the stream when you perform the execute(). I read the 1.4 JavaDoc and I'm still not convinced either way. Just in case it doesn't read the stream until later, simply use another stream: URL urlImage2 = getServletContext().getResource(second image); URLConnection urlImageConn2 = urlImage2.openConnection(); int urlImageLength2 = urlImageConn.getContentLength(); InputStream is2 = urlImage2.openStream(); pStmt.setBinaryStream(x, is2, urlImageLength2); Don't forget to close your streams and URLConnections when you're done (i.e. in a finally block)! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT: db pool problems - jdbc connection count?
Hello List... Sorry if this is off-topic. Although I think I'm following the jndi-resources-howto fairly well, I find I'm running out of connections and I have to restart tomcat to free them up. I'd like to know how many jdbc connections are in use at any given time with the intention of finding the offending servlet(s). I'm using postgreSQL. I've googled and looked at the postgres user lists but not found an example on how to detect the current number of connections in use. Can anyone help? tomcat 4.1.24 postgresql 7.3.3 pg73jdbc3.jar commons-pool 1.0.1 I believe I'be been pretty thorough in closing down resultsets, preparedstatements and connections after use, and use the removeAbandoned parameter in the DataSource Resource section of server.xml. Any leads are much appreciated. thanks /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OT: db pool problems - jdbc connection count?
Thanks Oscar... I ran some servlets and observed the postgres processes going over the maxActive (33 to 30) limit set in server.xml and also those processes marked idle topped the maxIdle value (21 to 15). The number of processes then dropped to 25, and I don't experience any problems with db connection resources. It appears some reclaiming of connections did take place. I'm as much in the dark as ever regarding the cause of connection resource maxing out however. Any further suggestions on how to test this behaviour given the apps/versions belown are much appreciated. regards /j-p. On Thu, 30 Oct 2003, Oscar Carrillo wrote: How about just watching the processes for postgresql while you access the site?: ps auxw | grep postgres tomcat 4.1.24 postgresql 7.3.3 pg73jdbc3.jar commons-pool 1.0.1 I believe I'be been pretty thorough in closing down resultsets, preparedstatements and connections after use, and use the removeAbandoned parameter in the DataSource Resource section of server.xml. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OT: db pool problems - jdbc connection count?
Thanks Yoav... sorry it's a wee bit above my immediate understanding (e.g lookup my connection pool by JNDI name - I could do with an example of what this means) plese be patient and point me to a resource that will give me some lead to catch up with you. regards /j-p. On Thu, 30 Oct 2003, Shapira, Yoav wrote: Howdy, You can write a bit of code to do this: - Create an InitialContext - Get the java:comp/env context - Lookup your connection pool by JNDI name - Cast your connection pool to the appropriate type as specified in your server.xml Then you can call the implementation-specific method, e.g. getNumActive() / getNumIdle() for org.apache.commons.dbcp.BasicDataSource, to look at values. Yoav Shapira Millennium ChemInformatics - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OT: db pool problems - jdbc connection count?
Oscar... I'll keep a close lookout for when you publish your HOWTO. In the meantime, I'll try to follow Yoav's instructions, and get back to the list with any eventual errors I make. thanks again to you both, /j-p. On Thu, 30 Oct 2003, Oscar Carrillo wrote: Thanks for a more complete solution Yoav! I'm still using a homebrew connection pool, so I'm lacking in some features. I'm planning on moving to one of the standard connection pools since they exist now and look quite good. Can I put your example up on my site when I finally get to doing a HOWTO on how to do connection pools? Regards, Oscar On Thu, 30 Oct 2003, Shapira, Yoav wrote: Howdy, It's very similar to how you get a connection. Let's say your datasource is defined in server.xml with name jdbc/myDataSource. Then: InitialContext ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup(java:comp/env/jdbc/myDataSource); If you wanted a connection, you'd call ds.getConnection(). But you want to find the number of active connections, which is not part of the DataSource interface. So you need to cast ds to the specific type, which is the type your specified in server.xml. Assuming that type is org.apache.commons.dbcp.BasicDataSource, you'd do: BasicDataSourcs bds = (BasicDataSource) ds; int numActive = bds.getNumActive(); int numIdle = bds.getNumIdle(); System.out.println(There are + numActive + active connections and + numIdle + idle connections in the pool.); I'm assuming you're using DBCP. If you're using another connection pool, the above code must be modified accordingly. Yoav Shapira Millennium ChemInformatics - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Apologies] Re: Mobile phone on serial port - Howto send sms?
Ok sorry List... it came into my head last thing before going to bed, and I didn't even bother to think it out before firing off the message. Stupid me. As suggested, I'll do some research and take it up to a more appropriate venue. Thanks for the replies however. /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Mobile phone on serial port - Howto send sms?
Hello List... this is a tricky one I believe, Serial port-connected mobile phone - I'd like to find out how to send sms messages using tomcat on linux. Anyone got any leads? I'd appreciate any help. thanks, /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JNDI DataSource - need to synchronize?
Hello List... Some coding help please. Following earlier advice on this list and the TC datasource how-to, I've now got a working test servlet. Basically I declare the Context(s) and DataSource as instance variables, and initialize them in init: Context initContext = null; Context envContext = null; DataSource ds = null; public void init() throws ServletException { try { initContext = new InitialContext(); envContext = (Context) initContext.lookup( java:comp/env); ds = (DataSource) envContext.lookup( jdbc/jpdb); } catch (NamingException e) { throw new ServletException( Couldn't setup JNDI Context/DataSource, e); } } == If this is the correct approach, should I be synchronizing the Context(s)/DataSource in the doGet method? If another http request thread closes it's own connection, will it affect the Context or DataSource object of this request? Thanks for any clarification, /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Can't find Commons-Pool jarfile
Hello List... I'm trying to setup a jndi datasource connection (following the tc docs) but I can't find the commons-pool 1.0.1 jarfile on the jakarta download site. Anyone point me to a download link for Pool please? Thanks /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Can't find Commons-Pool jarfile
Thanks but... http://jakarta.apache.org/commons/pool/downloads.html ... links to the jakarta binary download page but there's no reference to Pool there. /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] JDBC confusion
Hello List... newbie question coming up: If I set up a jdbc connection object in one servlet, do I have to close it each time or can the same connection be re-utilized by other servlets each using a different sql statement (perhaps storing the connection as a session attribute?). Is there a significant resource saving by not creating a JDBC connection object for each database access? I'm thinking of storing a connection for each user in the session, as opposed to pooling - primarily because I'm not sure how a database pool works nor how to set it up. Should I do a re-think on this? I'm using one postgresql 7.3.3 thanks /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Fileupload](java newbie):cannot resolve symbol
I had posted the following to the jakarta commons list but maybe it has more to do with Tomcat administration (or my bad programming). Any advice is much appreciated. /j-p. ** Hello List... My plan is to to stream uploaded files directly into a database. This may be a bit ambitious for my little programming experience nevertheless here goes. I've placed commons-fileupload-1.0.jar into WEB-INF/lib directory of my tomcat context. I've added the package statement: package org.apache.commons.fileupload; The following statement has been added to the import section of my test servlet: import org.apache.commons.fileupload.*; The compile chokes at the first assignment: boolean isMultipart = FileUpload.isMultipartContent(req); with a cannot resolve symbol on the FileUpload object. btw the context log shows the jar being loaded: 2003-07-28 17:05:43 ContextConfig[/mlist]: Scanning JARs in /WEB-INF/lib subdirectory 2003-07-28 17:05:43 ContextConfig[/mlist]:Adding path '/WEB-INF/lib/commons-fileupload-1.0.jar' 2003-07-28 17:05:43 ContextConfig[/mlist]: Scanning JAR at resource path '/WEB-INF/lib/commons-fileupload-1.0.jar' What am I doing wrong? Thanks, /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Fileupload](java newbie):cannot resolve symbol
On Mon, 28 Jul 2003, john-paul delaney wrote: The compile chokes at the first assignment: boolean isMultipart = FileUpload.isMultipartContent(req); with a cannot resolve symbol on the FileUpload object. btw the context log shows the jar being loaded: 2003-07-28 17:05:43 ContextConfig[/mlist]: Scanning JARs in /WEB-INF/lib subdirectory 2003-07-28 17:05:43 ContextConfig[/mlist]:Adding path '/WEB-INF/lib/commons-fileupload-1.0.jar' 2003-07-28 17:05:43 ContextConfig[/mlist]: Scanning JAR at resource path '/WEB-INF/lib/commons-fileupload-1.0.jar' It working now. I added a reference to the jarfile in the $CLASSPATH environment variable and then it compiled ok. Nevertheless I seem to have read somewhere that tomcat ignored the java classpath and relied on loading classes from it's various lib directories? Is this presumption incorrect? Thanks /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Fileupload](java newbie):cannot resolve symbol
Thanks Brian... I had tried removing the package line but the compiler complained the package couldn't be found. Is it overkill to have a package statement and an import statement for the same? In the end I just added the jar to the classpath... but I don't understand why it failed when the jar was loaded by the context. How will it be possible to install a war file on a new system if I'm relying on modifying the classpath? Apologies for the multiple newbie questions. thanks /j-p. On Mon, 28 Jul 2003, Brian wrote: Hi, Try removing the line: package org.appache.commons.fileupload; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Fileupload](java newbie):cannot resolve symbol
On Mon, 28 Jul 2003, John Turner wrote: Build != Run. Tomcat is not involved in the build process, only the run process. When your servlet is running, Tomcat ignores CLASSPATH so you will need to make sure your JAR files are in the appropriate location according to the ClassLoader HOWTO: Succinct and clear; well explained, thanks. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html rtfm I know, I know. I confess to having read but the new terminology and pithy explanations just wouldn't sink in. I go back and try again. Best regards /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
TC on port 80: run as root?
Hello List... I'm just using the latest release 4.1.24 as my webserver (no apache) with the intention of generating all (or nearly all) content from a back-end db. However I'm worried about starting the server and running as root - security issues. How does the apache server use it's own account to run a service below port 1024? And can I do similar for my tomcat setup? Any leads much appreciated, /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
web.xml:session-timeout error
Hello List... I've upgraded to 4.1.24 (from a 4.1.x earlier version) and now the following error reported in my catalina.out log. (it's caused by this timeout setting in web.xml: session-config session-timeout 30 /session-timeout /session-config ) however, I didn't have this problem before. Any ideas? Thanks /j-p. Apache Tomcat/4.1.24-LE-jdk14 Jul 27, 2003 3:46:08 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 385 column -1: Element web-app does not allow session-config here. org.xml.sax.SAXParseException: Element web-app does not allow session-config here. at org.apache.crimson.parser.Parser2.error(Parser2.java:3317) at org.apache.crimson.parser.ValidatingParser$ChildrenValidator.consume(ValidatingParser.java:349) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1464) at org.apache.crimson.parser.Parser2.content(Parser2.java:1926) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634) at org.apache.crimson.parser.Parser2.parse(Parser2.java:333) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) at org.apache.commons.digester.Digester.parse(Digester.java:1543) at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:282) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat5: Where's webdav?
Hello List... webdav doesn't appear to be available by default in tc5 - how do I go about setting it up? /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
catalina.out: Unable to open config
Hello List... this is the output of the catalina.out file in CATALINA_HOME/logs directory. What config file is he unable to open (see lines 3 6 of output)? thanks /j-p. == Nov 15, 2002 10:41:30 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 Unable to open config file Starting service Tomcat-Standalone Apache Tomcat/4.1.12-LE-jdk14 Unable to open config file Nov 15, 2002 10:42:49 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 == -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Compile jk2: make breaks
Hello List... I'm trying to setup (compile from source) mod_jk2 with apache2 tomcat 4.1.12-LE. Following the instructions on the mod_jk howto on the jakarta website, I've run into a problem. When I run make from the connectors jk/native2 directory, I get the following error: /usr/bin/ld: cannot find -lapr collect2: ld returned 1 exit status make[1]: *** [../../../build/jk2/apache2/jkjni.la] Error 1 make[1]: Leaving directory `/bak/jakarta-tomcat-connectors-4.1.12-src/jk/native2/server/apache2' make: *** [jk2-build] Error 1 What is lapr (something to do with apache portable runtime)? How do I install it? I've searched on the web but found little info, and there doesn't appear to be any docs in the connectors source download. thanks /j-p. JUSTATEST Art Online http://www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Solved! Dumb Question com.justatest.test.MyServlet error
That was it... thanks a bunch for figuring it out for me Jon. With Regards /j-p. On Sat, 21 Sep 2002, jon wingfield wrote: Open the InitSnoop.java source file. If the first line is not: package com.justatest.test; then that is your problem. The directory structure under WEB-INF/classes maps to the package stucture of your servlet and other java classes deployed in the webapp. Change the package name to the right one, recompile the class, redeploy and that should be it. Your servlet mapings are otherwise ok. Jon -Original Message- From: john-paul delaney [mailto:[EMAIL PROTECTED]] Sent: 21 September 2002 00:22 To: Tomcat Users List Subject: RE: Dumb Question com.justatest.test.MyServlet error Thanks Andreas... at first I didn't want to use any web.xml entries as this was just a test directory to run the examples of the oreilly book. I just wanted to compile the examples and run them without messing with web.xml. Nevertheless, I took your advice but I get the same server exceptions (cannot allocate servlet instance for path /jat/servlet/com.justatest.test.InitSnoop ... and ... cause NoClassDefFoundError: com/justatest/test/InitSnoop (wrong name: InitSnoop)) even when I run http://localhost:8080/jat/servlet/MyServletName after adding your entry into web.xml and restarting the server. It's looking like the problem lies somewhere else i.e. the url's I've been using are correct? thanks /j-p. On Fri, 20 Sep 2002, Andreas Mohrig wrote: A servlet residing in tomcat-root/webapps/jat/classes/com/justatest/test/MyServlet.class should be reachable under http://yourserver/jat/servlet/com.justatest.test.MyServlet , at lest if you put it in the right package (package com.justatest.test;, see the other answer below). If you define your servlet in your web.xml (which - in my humble opinion - you should always do), you get some more URLs for your servlet. The following will give you http://yourserver/jat/servlet/MyServletName and http://yourserver/jat/MyServletURL servlet servlet-nameMyServletName/servlet-name servlet-classcom.justatest.test.MyServlet/servlet-class /servlet servlet-mapping servlet-nameMyServletName/servlet-name url-pattern/MyServletURL/url-pattern /servlet-mapping Try it and tell us if it works for you too. --- JUSTATEST Art Online www.justatest.com -- 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] --- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Dumb Question ../servlet/com.justatest.test.MyServlet error
Hello List... I've created the directory path: tomcat-rootwebapps/jat/WEB-INF/classes/com/justatest/test/ but I get an error when I try to run the oreilly servlet from URL: http://localhost:8080/jat/servlet/com.justatest.test.InitSnoop The same servlet will run ok from URL: http://localhost:8080/jat/servlet/InitSnoop The exception is: Cannot allocate servlet instance for path /jat/servlet/com.justatest.test.InitSnoop cause: lang.NoClassDefFoundError: com/justatest/test/InitSnoop (wrong name: InitSnoop) Any suggestions on what I'm doing wrong would be appreciated, thanks /j-p. JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Dumb Question ../servlet/com.justatest.test.MyServlet error
Then what is the URL I should be using to invoke the InitSnoop servlet if the file system location is: tomcat-rootwebapps/jat/WEB-INF/classes/com/justatest/test/InitSnoop? thanks /j-p. On Fri, 20 Sep 2002, Miguel Angel Mulero Martinez wrote: Maybe the InitSnoop.java don't start with package com.justatest.test; --- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Dumb Question com.justatest.test.MyServlet error
Hello... Sorry about pushing so - but I'm stuck with this one What URL do I use to launch the servlet MyServlet deployed (not a .war) as: tomcat-root/webapps/jat/classes/com/justatest/test/MyServlet.class? (tomcat-root/webapps/jat/classes/MyServlet.class launches successfully with this url: http://localhost:8080/jat/servlet/MyServlet) I'm running tomcat 4.0.1 with sun jdk 1.3.1 on redhat 7.0. thanks for any help, /j-p. Quoting Miguel Angel Mulero Martinez [EMAIL PROTECTED]: Maybe the InitSnoop.java don't start with package com.justatest.test; -Mensaje original- De: John-Paul Delaney [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 20 de septiembre de 2002 12:43 Para: [EMAIL PROTECTED] Asunto: Dumb Question ../servlet/com.justatest.test.MyServlet error Hello List... I've created the directory path: tomcat-rootwebapps/jat/WEB-INF/classes/com/justatest/test/ but I get an error when I try to run the oreilly servlet from URL: http://localhost:8080/jat/servlet/com.justatest.test.InitSnoop The same servlet will run ok from URL: http://localhost:8080/jat/servlet/InitSnoop The exception is: Cannot allocate servlet instance for path /jat/servlet/com.justatest.test.InitSnoop cause: lang.NoClassDefFoundError: com/justatest/test/InitSnoop (wrong name: InitSnoop) Any suggestions on what I'm doing wrong would be appreciated, thanks /j-p. JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Re[2]: Dumb Question ../servlet/com.justatest.test.MyServleterror
Thanks for confirming that Jacob... I was beginning to doubt that I had understood the web app. deployment strategy. Nevertheless, an internal server error is returned when I use the url you suggested: Cannot allocate servlet instance for path /jat/servlet/com.justatest.test.InitSnoop. And the root cause is: NoClassDefFoundError: com/justatest/test/InitSnoop (wrong name: InitSnoop) I haven't used a servlet-mapping, and I can confirm an InitSnoop.class exists in that directory. Can anyone shed some light on this for me? thanks /j-p. On Fri, 20 Sep 2002, Jacob Kjome wrote: Hello john-paul, If you haven't provided a servlet-mapping, you can use Tomcat's invoker servlet like this: http://localhost:8080/jat/servlet/com.justatest.test.InitSnoop Otherwise, you could provide a servlet-mapping to, say, /initsnoop and access it like this: http://localhost:8080/jat/initsnoop Jake Friday, September 20, 2002, 11:32:08 AM, you wrote: jpd Then what is the URL I should be using to invoke the InitSnoop servlet if the file system location is: jpdtomcat-rootwebapps/jat/WEB-INF/classes/com/justatest/test/InitSnoop? jpd thanks jpd /j-p. jpd On Fri, 20 Sep 2002, Miguel Angel Mulero Martinez wrote: Maybe the InitSnoop.java don't start with package com.justatest.test; jpd --- jpd JUSTATEST Art Online jpd www.justatest.com jpd -- jpd To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] jpd For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Re[2]: Dumb Question ../servlet/com.justatest.test.MyServleterror
Are you saying that your directory structure (where the servlet .class file resides) looks like the following: TOMCAT_HOME/webapps/your-app-name/WEB-INF/classes/com/justatest/test /InitSnoop.class Yes. Firstly, I needed to know if I was reading the docs correctly - it works for others apparantly, so that's something I suppose. Now to find out what's causing that wrong name error message. thanks /j-p. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Dumb Question com.justatest.test.MyServlet error
Thanks Andreas... at first I didn't want to use any web.xml entries as this was just a test directory to run the examples of the oreilly book. I just wanted to compile the examples and run them without messing with web.xml. Nevertheless, I took your advice but I get the same server exceptions (cannot allocate servlet instance for path /jat/servlet/com.justatest.test.InitSnoop ... and ... cause NoClassDefFoundError: com/justatest/test/InitSnoop (wrong name: InitSnoop)) even when I run http://localhost:8080/jat/servlet/MyServletName after adding your entry into web.xml and restarting the server. It's looking like the problem lies somewhere else i.e. the url's I've been using are correct? thanks /j-p. On Fri, 20 Sep 2002, Andreas Mohrig wrote: A servlet residing in tomcat-root/webapps/jat/classes/com/justatest/test/MyServlet.class should be reachable under http://yourserver/jat/servlet/com.justatest.test.MyServlet , at lest if you put it in the right package (package com.justatest.test;, see the other answer below). If you define your servlet in your web.xml (which - in my humble opinion - you should always do), you get some more URLs for your servlet. The following will give you http://yourserver/jat/servlet/MyServletName and http://yourserver/jat/MyServletURL servlet servlet-nameMyServletName/servlet-name servlet-classcom.justatest.test.MyServlet/servlet-class /servlet servlet-mapping servlet-nameMyServletName/servlet-name url-pattern/MyServletURL/url-pattern /servlet-mapping Try it and tell us if it works for you too. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Can servlet write to file in /WEB-INF?
Thanks Milt... yes I'm reading servlet programming by the same author, he'd written a servlet example that reads and writes a counter to an external file resource but it seems the file location varies depending on the container implementation - I was trying to understand how to determine an exact location of a resource for reading from, and writing to. Any further advice gratefully accepted. /j-p. On Sat, 22 Jun 2002, Milt Epstein wrote: Well, I've never tried it before, but what you've got is pretty much as described in an old Jason Hunter article: http://www.javaworld.com/jw-12-1998/jw-12-servletapi-p3.html I don't know if things have changed since then. Of course, another issue is whether the user that the servlet is running as has the appropriate permissions to write into that file/directory. Milt Epstein Research Programmer Systems and Technology Services (STS) Campus Information Technologies and Educational Services (CITES) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED] --- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Servlet reloading not working.
Hello List... Running tomcat 4.01 and apache 1.3.24 (with mod_webapp and virtual hosts) , when modifying and recompiling any servlet, I need to restart the tomcat for my changes to take effect. A simpler tomcat test install on xp reloads the changes as advertised. I've tried to add a reloadable value to Host name for virtual hosts in the server.xml but it caused an error. Advice gratefully appreciated. /j-p. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Can servlet write to file in /WEB-INF?
I was trying to see if I could write to a file in the /WEB-INF directory but I couldn't get it to work - is there a problem with a servlet writing to this directory or is it just me (again ;( ) ? thanks /j-p. URL url = context.getResource(/contextTest.txt); URLConnection con = url.openConnection(); con.setDoOutput(true); OutputStream out = con.getOutputStream(); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out)); pw.println(foo); pw.close(); out.close(); --- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
SysV init script RH7.0
Hello list... I've setup tomcat4.01 on RH7.0, on jdk1.3. In order to load tomcat successfully, I need to run the following command: ulimit -s 2048. I'd also like to load Tomcat as user tc. Does anyone have a suitable script that I can run in /etc/rc.d/init.d/ on startup - or at least send me a pointer to pertinent examples? I've not been successful with my own attempts so far. thanks /j-p. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: SysV init script RH7.0
Thanks VERY much Chad... your script was a winner for me. It's a real relief to have Tomcat starting automatically finally. Regards /j-p. On Fri, 3 May 2002, chad kellerman wrote: j-p, Depending on the location of everything. apachectl, tomcat etc. You can try this one. #!/bin/sh # case $1 in start) echo -n Starting TomCat 4 and httpd: su - tc -c /usr/local/tomcat/bin/startup.sh sleep 10 /etc/httpd/bin/apachectl start /usr/local/apache-ssl/bin/apachectl start ;; restart) /etc/httpd/bin/apachectl stop /usr/local/apache-ssl/bin/apachectl stop echo -n Stopping TomCat 4 and httpd: su - tc -c /usr/local/tomcat/bin/shutdown.sh sleep 10 echo -n Restarting TomCat 4 and httpd: su - tc -c /usr/local/tomcat/bin/startup.sh sleep 10 /etc/httpd/bin/apachectl start /usr/local/apache-ssl/bin/apachectl start ;; stop) /etc/httpd/bin/apachectl stop /usr/local/apache-ssl/bin/apachectl stop echo -n Stopping TomCat 4 and httpd: su - tc -c /usr/local/tomcat/bin/shutdown.sh sleep 10 ;; *) echo Usage: $0 {start|stop|restart} exit 1 ;; esac -chad ps. don't forget to link it in rc3.d and rc6.d On Fri, 3 May 2002 13:35:24 -0200 (CEST) john-paul delaney [EMAIL PROTECTED] wrote: Hello list... I've setup tomcat4.01 on RH7.0, on jdk1.3. In order to load tomcat successfully, I need to run the following command: ulimit -s 2048. I'd also like to load Tomcat as user tc. Does anyone have a suitable script that I can run in /etc/rc.d/init.d/ on startup - or at least send me a pointer to pertinent examples? I've not been successful with my own attempts so far. thanks /j-p. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Html/jpg from db to client?
Are there any examples of these techniques available? thanks /j-p. On Mon, 22 Apr 2002, Jeffrey Bonevich wrote: Nope. Only need two at most. Each of them sets their own content type (image streamer sets it to image/jpg, HTML producer to text/html). And in answer to your other question, yes, this could be reduced to just one servlet that does conditional setting of content-type and content. But you will then need a querystring (or other) key/value pair to do the conditional on. Suppose your HTML page url is /servlets/showimage/1. Suppose the 1 in the subpath is the id for the image. Then you need to have a switch in the URL to tell it whether you are getting html or image: /servlets/showimage/1?show=1 SO now your HTML page is accessed with the URL /servlets/showimage/1 and inside that page is embedded an img src=/servlets/showimage/1?show=1 height= + image height + width= + image width + Then in your showimage servlet, you grab the show request parameter and, if it is present/equals 1, then set content type to image and stream the image, otherwise set content type to html and output HTML (or forward to JSP - just be sure to stick the image info somewhere in a context so you can access it in the JSP page). Make sense? jeff john-paul delaney wrote: On Mon, 22 Apr 2002, Nikola Milutinovic wrote: Thanks Nix... then I'm thinking I need three servlets to handle for each page sent to the client... 1. Write the html header, 2. Get image from db and send the image, 3.Add in dimensions to img tag add the footer. Is this correct? regards /j-p. If you wish to send BOTH html and the image in the same invocation of the servlet, then you're mistaken. HTTP/HTML, in general, doesn't work that way. You should make a servlet which can retrieve a single picture, something like: /servlets/showImage?src=my_test_pic.gif Then make your servlet accept src parameter, retrive the image from the database. Based on the extension you should set the correct MIME type, in this case image/gif and send it. You should set Response-contentType to your MIME type and open a servlet output stream in the Response and just splash your image into it. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Html/jpg from db to client?
Hello List... Using a servlet, I retrieve an image from a database, but I want to send it in a formatted html page to the client... any suggestions on how to approach this (combining html and streaming images) appreciated. thanks /j-p. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Html/jpg from db to client?
On Sun, 21 Apr 2002, Jeffrey Bonevich wrote: Thanks Jeff... I'll try this out - following your suggestion, I was thinking to put the dimensions of the image (jpg) in the database too and to retrieve it along with the image - the html will be a combination of includes and dynamic written by the servlet. Don't know if this is really a relevant question - from a design point of view, is it better to use one servlet to handle all of this or multiple chained servlets? regards /j-p. img src=http://mydomain.com/mywebapp/imagestreamservlet?imageID=xxx; The only sticking point is that you do not know the image dimensions before grabbing the image (duh!), so if you need width/height info for the image in the page, it may be worthwhile having the HTML page also produced by a servlet that also looks up the image, but only retrieves metadata about it and sticks it in the appropriate places. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Html/jpg from db to client?
On Mon, 22 Apr 2002, Nikola Milutinovic wrote: Thanks Nix... then I'm thinking I need three servlets to handle for each page sent to the client... 1. Write the html header, 2. Get image from db and send the image, 3.Add in dimensions to img tag add the footer. Is this correct? regards /j-p. If you wish to send BOTH html and the image in the same invocation of the servlet, then you're mistaken. HTTP/HTML, in general, doesn't work that way. You should make a servlet which can retrieve a single picture, something like: /servlets/showImage?src=my_test_pic.gif Then make your servlet accept src parameter, retrive the image from the database. Based on the extension you should set the correct MIME type, in this case image/gif and send it. You should set Response-contentType to your MIME type and open a servlet output stream in the Response and just splash your image into it. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
NewB/Default Servlet:Can't find .gif
Hello List... NEWBIE: I want to generate the welcome page for my domain so I mapped a test servlet to / in the web.xml for my context. PROBLEM: A test.gif image is not rendered by the servlet - as it appears the path is not found. OBSERVED: If I map the servlet instead to /intro then the test.gif is rendered ok. TRIED: Using various path combinations/test.gif, test.gif etc - no result. NOTE: I've read some postings advising locating files should be done as in InputStream [getResourceAsStream()]. Is it applicable in this case when all I want is a simple out.println( img src=\/test.gif ... etc )? Your advice greatly appreciated /j-p. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: NewB/Default Servlet:..rethink...
(Subject Was: NewB/Default Servlet:Can't find .gif) On second thoughts.. with regard to this (my previous post) it may have been smarter to simply ask what is the best way to generate a welcome page for a domain using a servlet...? thanks/j-p. NEWBIE: I want to generate the welcome page for my domain so I mapped a test servlet to / in the web.xml for my context. PROBLEM: A test.gif image is not rendered by the servlet - as it appears the path is not found. OBSERVED: If I map the servlet instead to /intro then the test.gif is rendered ok. TRIED: Using various path combinations/test.gif, test.gif etc - no result. NOTE: I've read some postings advising locating files should be done as in InputStream [getResourceAsStream()]. Is it applicable in this case when all I want is a simple out.println( img src=\/test.gif ... etc )? Your advice greatly appreciated --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: NewB/Default Servlet:Can't find .gif
On Mon, 18 Feb 2002, Justin Rowles wrote: PROBLEM: A test.gif image is not rendered by the servlet - as it appears the path is not found. Are you trying to return html including an image link (such as img src=test.gif) or trying to stream an image via the servlet? If the latter, then jsp is the wrong tool - it is text only. If not, read on: Yes, the latter. Only I was thinking of generating the page with a servlet, and not creating a .jsp file. Is this terribly mistaken? OBSERVED: If I map the servlet instead to /intro then the test.gif is rendered ok. I'm confused as to why once I change the servlet-mapping from / to /intro that the .gif is read. The path to the servlet is standard: $CATALINA_HOME/webapps/ap.org/WEB-INF/classes/intro.class. The image is in the context root $CATALINA_HOME/webapps/ap.org/ NOTE: I've read some postings advising locating files should be done as in InputStream [getResourceAsStream()]. Is it applicable in this case when all I want is a simple out.println( img src=\/test.gif ... etc )? Oh, then you are trying to do it right! Good. But the simple PrintWriter statement to write the html img element works fine when the servlet-mapping is not /? Can't I just use the same in some other guise - or am I way off-track? thanks for your comments/j-p. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: NewB/Default Servlet:Can't find .gif
Thanks Justin... excerpt from web.xml servlet servlet-name intro /servlet-name servlet-class intro /servlet-class /servlet servlet-mapping servlet-nameintro/servlet-name url-pattern/intro/url-pattern /servlet-mapping intro.class is in $CATALINA_HOME/webapps/ap.org/WEB-INF/classes test.gif in in $CATALINA_HOME/webapps/ap.org/ intro.java import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class intro extends HttpServlet { public void doGet( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException { res.setContentType(text/html); PrintWriter out = res.getWriter(); out.println( htmlheadtitlejustatest/title/head ); out.println(img src=\/test.gif\ width=\146\ height=\125\ alt=\TEST\); out.println( bodyh1Justatest...!/h1/body/html ); } } Here I realise I may have misled you: This page renders ok if I explicitly point to url www.domain.org/intro ^ It fails if I change the url-pattern within the servlet-mapping to / (and access it with the url www.domain.org/) - the test.gif is no longer found by the server. Any suggestions? Rgds/j-p. On Mon, 18 Feb 2002, Justin Rowles wrote: I'm confused as to why once I change the servlet-mapping from / to /intro that the .gif is read. So am I ;-) Can you print out the output from either case and send it. J. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: NewB/Default Servlet:Can't find .gif
Is there a way then, to automatically invoke a servlet by pointing to the url www.mydomain.com (Or am I obliged to use .jsps)? thanks/j-p. On Mon, 18 Feb 2002, Larry Isaacs wrote: The default servlet handles requests that don't map to some other serlvet. This usually includes all static content and requests that match directories. It is the resposibility of the default servlet to serve these requests in a appropriate manner. The default servlet supplied by Tomcat implements serving static resources and directory listings. If your default servlet doesn't support this, you will lose this feature if you replace Tomcat's default servlet. Larry --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
NuB:javac:cannot resolve symbol
Hello List... I'm trying to compile sample code from Jason Hunter's book 'About Servlet Programming' from O'Reilly. The code is for reusing database connections, and it refers to an external class which had been created on a previous exercise. Although the class from the previous exercise is within the same context directory (/WEB-INF/classes) as the new class, when I try to compile the new class, I get an error: cannot resolve symbol symbol : class previous-class-name There is no specific reference to the location of the previous class within the code - so I presume I have some mis-configuration on my setup. I'm not sure what it is thoug? Any help gratefully appreciated. /j-p. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: problem with WebAppConnection at boot time
FWIW, I've noticed that the Tomcat-Apache sequence works when the text: Starting service Tomcat-Apache Apache Tomcat/4.0.1 is written to the $CATALINA_HOME/logs/catalina.out log. Would it be possible to check in the daemon script for this/or whatever process triggers it - in order to complete successfully? thanks /j-p. On Thu, 7 Feb 2002, John Wadkin wrote: The error Web-application not yet deployed is a weird and wacky one. It seems to come and go. If you restart rather than stop and start Apache at the command line, it seems to manifest itself. It sometimes disappears of its own accord with no intervention from me! As I understand it, it's caused by Apache starting before TomCat has fully loaded. But this wouldn't explain its weird behaviour. I think it's a known bug that's fixed in TC 4.0.1 My rc script starts both TomCat and Apache (i.e. not separate scripts) with a sleep 10 between the commands. This appears to work but who knows :) I don't think further separating the scripts (i.e. S2 and S99) would make much difference in terms of time. John Quote for the week: Experience is not what happens to a man; it is what a man does with what happens to him. Aldous Huxley, Texts and Pretexts , (1932) p. 5 -Original Message- From: Cindy Ballreich [mailto:[EMAIL PROTECTED]] Sent: 07 February 2002 19:30 To: [EMAIL PROTECTED] Subject: problem with WebAppConnection at boot time I've been reading through the archives and I've seen a lot of questions about using mod_webapp. In general, mod_webapp seems to be working pretty well for me. My problem is that it doesn't seem to be able to make a connection when httpd is started at boot time. I'm using RedHat 7.0 and I've written init.d scripts for both Tomcat 4.0.1 and Apache 1.3.19 (both installed manually rather than from RPMs). Tomcat starts before Apache (Tomcat is S80 and Apache is S89). Both seem to be starting correctly and both can be accessed directly from their respective ports. The problem is that the Apache error_log has a string of entries like this... [Thu Feb 7 10:20:24 2002] [error] Connection conn cannot connect [Thu Feb 7 10:20:24 2002] [error] Cannot open connection conn ... and when I try to access a jsp from one of the contexts defined by WebAppDeploy in Apache, I get a WebApp: Error 404 (File: wa_request.c Line: 198) Web-application not yet deployed page, and an entry in the log like this one... [Thu Feb 7 10:20:42 2002] [error] Web-application not yet deployed Interestingly, viewing the source of this error page gives me the html that should be produced by the jsp application I was trying to access!! Restarting my web server seems to correct this problem. The connection is made and my jsp files are accessible as I would expect. This indicates to me that my configuration is essentially correct, but something is preventing the connection from being made at boot time. Could Tomcat not be fully loaded when Apache is trying to start? Should I put more space between the init.d scripts? Are there other daemons that need to be started in order for webapp to deploy? Any suggestions would be greatly appreciated. Cindy By the way, mod_webapp is version 1.0.1 built from source with -DEAPI. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
TC4-Warp-Apache:Removed TC-Standalone Service
Hello List, newb question... I've setup virtual hosts with tc-warp-apache by moving all my host elements into the Tomcat-Apache Connector Service element. I then removed the Tomcat-Standalone Connector Service as I want Apache to be the webserver (i.e I don't need TC for that). It appears to be working ok i.e. Apache handling all the static content and passing to TC for servlet/jsps. My question is: Will I have problems with this setup? thanks /j-p. --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: I'm stuck. Apache-tom4.0 virtual hosts
I'm a newbie with this but here's what I got... The jakarta documentation says the Host element represents a Virtual Host. One or more Host elements are nested inside an Engine element. ..and on an Engine element it says, Exactly one Engine element must be nested inside a Service element, following all of the corresponding Connector elements associated with a Service. ..and on a Connector it says, HTTP/1.1 and Warp are typical connectors. So in the server.xml file, I used the Tomcat-Apache Service, and placed some Warp Connectors (making sure they utilized unique ports), one for each one of my virtual hosts within the service as follows: !-- Define an Apache-Connector Service -- Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=false acceptCount=10 debug=0/ Connector className=org.apache.catalina.connector.warp.WarpConnector port=8015 minProcessors=5 maxProcessors=75 enableLookups=false acceptCount=10 debug=0/ !-- Replace localhost with what your Apache ServerName is set to -- Engine className=org.apache.catalina.connector.warp.WarpEngine name=www.myServer.com debug=99 appBase=webapps Then I added in my Hosts (Default Host as in server.xml and others for each virtual host). It was only when I used this configuration that the entries in httpd.conf were accepted and responded ok. Example from httpd.conf follows: VirtualHost 192.168.1.2 ServerAdmin ... DirectoryIndex index.html DocumentRoot ... ServerName www.virtualhost1.org WebAppConnection apoWarpConn warp www.virtualhost1.org:8015 WebAppDeploy myapp apoWarpConn/apps/ WebAppDeploy manager apoWarpConn /manager/ ErrorLog ... CustomLog ... /VirtualHost At this point, I even removed the Tomcat-Standalone Connector Service from server.xml and all seems to be responding as I want. Nevertheless beware... this outcome is more the result of trial error than a logical understanding of the components on my part. HTH /j-p. On Thu, 7 Feb 2002, chad kellerman wrote: Hey guys, I am stuck again. This time with the virtual host section in apache. Here is what I got: VirtualHost jakarta.domain.com WebAppConnection warpConnection warp localhost:8008 WebAppDeploy examples warpConnection /home/jak/jakarta-www/examples/ User jak Group jakartagrp ServerName jakarta.domain.com ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/jak/jakarta-www TransferLog /home/jak/jakarta-logs/access-log ScriptAlias /cgi-bin/ /home/jak/jakarta-www/cgi-bin/ /VirtualHost an /etc/httpd/bin/apachectl configtest says it does not like WebAppDeploy examples warpConnection /home/jak/jakarta-www/examples/ I am trying to get tomcat working with multiple virtual hosts. I have the module loading fine. But I haven't found how to configure httpd.conf for tomcat as well as the server.xml file. Anyone get this working properly? I on red hat. But I would think the config should be similar on other os's.. Thanks for the info, Chad -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --- JUSTATEST Art Online www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Using Warp Connector only: remove http from server.xml?
Hello List... Newbie question. Setting up Redhat7.0/TC4.0.1/Apache1.3.20 and after some ironing out, all now appears to work as expected. My question is: do I still need the standalone http connector (configured in server.xml) when I'm using Warp with Apache? thanks /j-p. - JUSTATEST Art Online. www.justatest.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]