Re: definitive answer on JSPC?
Don't know how 'definitive' this is, but here are my experiences. Its a bug/feature of jspc, depending on how you look at it. As it loads all relevant jsp files into memory to compile, it only used the file name, not the full path, making the compiler see all your index.jsps as the same, which causes the error. I believe there is a fix for this out there somewhere. I found a pointer to the fix on an Ant message board. I also added functionality to Ant that compiles each jsp in its own memory space, thus working around the bug. Let me know if you can't find the fix (it might already be part of the next Tomcat build) and want to dork around with my effort. The work I did on it was back about 3 months ago, so I don't know what has been done recently. Chris On Tue, 2003-02-04 at 23:15, Brett Porter wrote: Hi, I'm looking for a definitive answer about JSPC in Tomcat 4.1 and precompilation. Searching the archives hasn't yielded answers to the questions I've been curious about. It'd be great to get definitive answers for the archive, and perhaps a FAQ as it is not covered in either tomcat-user, the doco, or JGuru. Background: In TC3.2.4 I currently precompile all JSPs using the ant jspc task and the TC3.2 jasper/webserver jars. I then munged the generated java files into the format required by TC3.2.4 and compiled them, then renamed them again to match. A little weird, but it worked since it used a flat directory structure, formatting the filenames with_002f etc. I dropped this into /WEB-INF/classes/precompiled_jsp and symlinked it from work/localhost_8080%2Fapps. The reason this was necessary was that the server choked under the load trying to compile the JSPs. There seemed to be no deadlocking so it would spawn numerous javacs and start swapping, and you get the picture :) With TC4.1 I can't take this approach because of the (albeit nicer) directory approach. However, because of duplicate names and the same package being used, I will need to compile each java file individually, complicating the build process considerably. BTW, I'm aware of ?jsp_precompile=1 and it's not suitable. Here are my questions regarding jspc from ant/cmd line: 1) is the definitive way to do it supposed to be the web.xml include method? If so, shouldn't JSP take a web.xml input and output a processed one? Regardless, doesn't this have negative side effects, like not then being able to edit the JSPs to make changes? (note that while we precompile, we may need to change some, and filtering them out would be a fair nuisance). 2) is there a way to do what I am looking for above, generating classes for all JSPs that are not fragments (for static include) which can be placed in the work dir? Does it have to have the same layout as the server to work? 3) what is the reason for the current layout and differences between cmd line and server compilation? ie. different dirs but same package. My desired requirements for JSPC to work would be: 1) both JSPC and server generate the same java files to the same locations. 2) javac can be executed on the base directory on **/*.java, and the resulting classes dropped into the work directory. They would be used as long as their timestamps were newer than the jsp in question. To achieve this, I'd suggest this: 1) package name is org.apache.jsp.PATH.TO.FILE (substituting/eliminating special characters - eg WEB-INF - WEBINF) 2) class remains myJsp_jsp.java 3) have TC not only look under work but /WEB-INF/classes to avoid the symlink (ie if I specified my package as precompiled_jsp I'd get the result as I have for 3.2.4). And a final question: how likely am I to encounter the problems had with 3.2.4 if I upgrade to 4.1? I believe the jasper2 compiler is designed to be much more effecient - will it avoid generating the java files more than once and hence compiling them more than once, instead synchronizing on the operation? (this is effectively enough, although precompilation would still be even faster). I'd appreciate any responses regarding this, and apologise for the verbosity level of the email! :) Thanks, Brett - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDBC Driver for sql server 2000
I can vouch for FreeTDS as well. We've had no problems with it. -Original Message- From: Jim Urban [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 4:23 PM To: [EMAIL PROTECTED] Subject: RE: JDBC Driver for sql server 2000 FreeTDS is free and it works fine. http://www.freetds.org/ Jim Urban Product Manager Netsteps Inc. Suite 505E 1 Pierce Pl. Itasca, IL 60143 Voice: (630) 250-3045 x2164 Fax: (630) 250-3046 -Original Message- From: Stéphane De Jonghe [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 11:35 AM To: [EMAIL PROTECTED] Subject: RE: JDBC Driver for sql server 2000 Hi, But is there any free (or open source) JDBC driver for MS SQL Server who is not using the jdbc:odbc link ? I tried JSQLConnect, but it is a trial version... Thanks, Stef -Original Message- From: Jonathan Eric Miller [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 6:05 PM To: [EMAIL PROTECTED] Subject: Re: JDBC Driver for sql server 2000 http://www.inetsoftware.com has a great driver IMHO. It's a JDBC type 4 and they seem to be very proactive about keeping it up to date. I tried JTurbo awhile back and I liked Inet's driver better. The JTurbo one seemed buggy to me. I don't remember what the specific issue was that I found with it. It was a long time ago, so, it may no longer be an issue. I can say that I really like the driver that Inetsoftware has though. I've been using it for about a year and a half and it works great. Also, they come out with periodic updates. Probably at least one per quarter. I'm using the Opta2000 driver, version 4.11. Jon - Original Message - From: Saritha Pula [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 11:00 AM Subject: RE: JDBC Driver for sql server 2000 Hi JTurbo JDBC driver works well with SQLServer2000 --Pula -Original Message- From: Trig Gullberg [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 8:54 AM To: '[EMAIL PROTECTED]' Subject: JDBC Driver for sql server 2000 Does any one know of a good sql server 2000 jdbc driver that works well with tomcat? Any help or suggestions are appreciated.
RE: JDBC Driver for sql server 2000
There is a rogue group that have started a version on SourceForge, https://sourceforge.net/projects/jtds/ although its not ready to use, I don't believe. The one guy (Craig H.) on dev list on Source Forge has his own version which is the one I'm currently using. It's pretty up to date. Chris -Original Message- From: Jonathan Eric Miller [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 4:29 PM To: [EMAIL PROTECTED] Subject: Re: JDBC Driver for sql server 2000 Doesn't look very up to date though. The file date is 1/25/2000. I guess if it works, that's all that matters... Jon - Original Message - From: Chris McNeilly [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 3:25 PM Subject: RE: JDBC Driver for sql server 2000 I can vouch for FreeTDS as well. We've had no problems with it. -Original Message- From: Jim Urban [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 4:23 PM To: [EMAIL PROTECTED] Subject: RE: JDBC Driver for sql server 2000 FreeTDS is free and it works fine. http://www.freetds.org/ Jim Urban Product Manager Netsteps Inc. Suite 505E 1 Pierce Pl. Itasca, IL 60143 Voice: (630) 250-3045 x2164 Fax: (630) 250-3046 -Original Message- From: Stéphane De Jonghe [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 11:35 AM To: [EMAIL PROTECTED] Subject: RE: JDBC Driver for sql server 2000 Hi, But is there any free (or open source) JDBC driver for MS SQL Server who is not using the jdbc:odbc link ? I tried JSQLConnect, but it is a trial version... Thanks, Stef -Original Message- From: Jonathan Eric Miller [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 6:05 PM To: [EMAIL PROTECTED] Subject: Re: JDBC Driver for sql server 2000 http://www.inetsoftware.com has a great driver IMHO. It's a JDBC type 4 and they seem to be very proactive about keeping it up to date. I tried JTurbo awhile back and I liked Inet's driver better. The JTurbo one seemed buggy to me. I don't remember what the specific issue was that I found with it. It was a long time ago, so, it may no longer be an issue. I can say that I really like the driver that Inetsoftware has though. I've been using it for about a year and a half and it works great. Also, they come out with periodic updates. Probably at least one per quarter. I'm using the Opta2000 driver, version 4.11. Jon - Original Message - From: Saritha Pula [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 11:00 AM Subject: RE: JDBC Driver for sql server 2000 Hi JTurbo JDBC driver works well with SQLServer2000 --Pula -Original Message- From: Trig Gullberg [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 8:54 AM To: '[EMAIL PROTECTED]' Subject: JDBC Driver for sql server 2000 Does any one know of a good sql server 2000 jdbc driver that works well with tomcat? Any help or suggestions are appreciated.
RE: help please!
Aaron, Are you running apache/tomcat on your PC? We had this problem before and it turned out to be a case problem on the directories. The PC ignores case while UNIX is case-sensitive. We had Web-Inf instead of WEB-INF. Chris -Original Message- From: Aaron Cooper [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:41 PM To: [EMAIL PROTECTED] Subject: help please! Hi I've checked documentation and have tried things already suggested, but still without success. Does anyone know where I could go to get information or give me some help? I have placed a /baseball under /webapps. When I type in http://localhost:8080/baseball from my UNIX workstation, it works fine. However, when I type the URL/baseball from my PC, it cannot find the directory. Apache came already set up with tomcat, I do not understand why it wont show from my PC, when the /examples directory shows perfectly finr from my PC. Any help greatly appreciated. Aaron
RE: help please!
I'm going to take another shot at it ;-) Check your JkMounts and make sure that there are some for /baseball. mod_jk.conf-auto or whatever you changed it to. Chris -Original Message- From: Aaron Cooper [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 3:37 PM To: [EMAIL PROTECTED] Subject: RE: help please! hi Andrew I thought that might be the case, but why would I be able to view the /examples directory from my PC if it were not configured correctly? Because of that, I thought it was configured properly. Andrew Inggs [EMAIL PROTECTED] 07/24/01 04:38pm Aaron Cooper wrote: when I try http://localhost/baseball from my UNIX box, it says Not Found OK, now we're getting somewhere. Apache is not configured correctly to forward JSP requests off to Tomcat. See if this helps: http://jakarta.apache.org/tomcat/tomcat-3.2-doc/tomcat-apache- howto.html -- Andrew
RE: Tomcat 3.2.2 and Xerces
Sorry. Asleep at the wheel. I didn't see this earlier. The problem is that Tomcat uses a different xml parser than xerces and there is a version conflict of some sort that I knew back when I had the problem but have since forgotten. To fix, the easiest way is to modify the tomcat.bat or tomcat.sh file in the way the CLASSPATH is created. Simply put your CLASSPATH defs before the ones that are added by the script. There should be a line like this CP = CP + CLASSPATH just flip it around CP = CLASSPATH + CP excuse the non-standard syntax, but hopefully you get the idea. This lets xerces be found first and the world is good. Chris -Original Message- From: Sam Newman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 10:22 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Tomcat 3.2.2 and Xerces If it was an inbuilt limitation of Tomcat, I wouldn't expect to see a ClassDefNotFoundExceptionare you sure you've put your xerces parser .jar file in the WEB-INF/lib directory of your webapp? Also Mail Archive does have a search facility for this list. Its pretty crap but its better than nothing :-) sam - Original Message - From: Ben Rometsch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 3:08 PM Subject: Tomcat 3.2.2 and Xerces Hi There, I'm new to the group - apologies if this has been asked 100 times before. I'm writing a web application that parses an XML file with SAX in order to retrieve database connection details. The beans responsible for this make use of the xerces XML parser. Testing the beans in JBuilder, everything works fine. When I compile the class files and attempt to invoke the methods through a jsp page in Tomcat, it throws a java.lang.NoClassDefFoundError error. I've been scouring Deja and the tomcat documentation. It sounds like I can't use another XML parser on top of the one tomcat uses to parse its configuration information. Is this correct? If this is the case, is the only solution to re-write the SAX parser bean to make use of JAXP? Thanks in advance, Ben snip
Re: JDBC drivers for SQL server
We're using freetds (http://www.freetds.org) which is an open source JDBC driver for SQL Server. We've been running with it for a month and only had one problem (jdbc realm wasn't working) that got cleared up by some supportive folks on their mailing list. Chris Alexandre Bouchard wrote: I am looking for goodcheap (free if possible) JDBC drivers for SQL server. Randy, you told me inetsoftware.de make good drivers. Maybe we will opt for this cie but their prices range from USD 200 to 400... Its expensive for mere drivers (are JDBC drivers so difficult to develop?) And i was wondering if there isn't any JDBC drivers supplied with SQL server. If so, we wouldn't have to pay third-party cie, the migration to servlet would be cheaper, and my boss, happier. If not, what other (cheaper or free if possible) alternatives do i have? Thx alex
JDBCRealm NullPointerException error
My JDBC driver is blowing up with a NullPointerException error as soon as it tries authenticating. This is even before my login page gets called. It looks like its trying to authenticate username=null and password=null. Not sure what to do. Any ideas? Thanks, Chris
RE: Src.jar and Classpath
I modify my autoexec.bat. On Win98, you'll probably have to reboot to have it take effect. set classpath=.;C:\jdk1.3.0_02\lib\tools.jar ... Chris -Original Message- From: Kotsari Aspasia [mailto:[EMAIL PROTECTED]] Sent: Friday, June 01, 2001 8:51 AM To: '[EMAIL PROTECTED]' Subject: Src.jar and Classpath Any ideas on how to include src.jar in the classpath??? I'm using Win98. S.-
RE: Re: How to debug a missing servlet error?
I removed the servlet-mapping and still no luck. This is really odd. Is there any way to see where Tomcat is actually looking for the class? Chris -Original Message- From: Chris McNeilly [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 31, 2001 6:54 PM To: [EMAIL PROTECTED] Subject: [Fwd: Re: How to debug a missing servlet error?] Original Message Subject: Re: How to debug a missing servlet error? Date: Thu, 31 May 2001 14:02:01 -0700 From: Jeff Kilbride [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] References: [EMAIL PROTECTED] Hi Chris, Tomcat should recognize /servlet/briefXSL without the explicit servlet-mapping you are using -- but I don't know if that is what's causing your problem. For all my servlets, I have the following type of entry: servlet servlet-namebriefXSL/servlet-name servlet-classcom.smartbrief.BriefXSL.Servlet/servlet-class /servlet The default Invoker automatically sets up /servlet/ as a mapping for all your defined servlets. So, the above should be enough to get /servlet/briefXSL to pull up correctly -- without the servlet-mapping you have below. Maybe the explicit servlet-mapping you are doing is somehow messing with the default Invoker on Linux, but that's only speculation... Thanks, --jeff - Original Message - From: Chris McNeilly [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 31, 2001 1:15 PM Subject: How to debug a missing servlet error? Hi, I have a development environment that works correctly (Win 98), but when I move the code over to my QA environment (Linux) tomcat can no longer find the servlet. I have a web.xml file in the Web-Inf directory that has the following: web-app servlet servlet-name briefXSL /servlet-name servlet-class com.smartbrief.BriefXSLServlet /servlet-class /servlet servlet-mapping servlet-namebriefXSL/servlet-name url-pattern/servlet/briefXSL/url-pattern /servlet-mapping /web-app Tomcat receives the request from apache, but doesn't know what to do with it and spits back a 404. It's almost as if tomcat isn't reading the web.xml file at all. Thanks, Chris
RE: Servlets and relative paths
Title: RE: Servlets and relative paths That's eventually what I did. I now have two top xsl pages, one includes with fully qualified urls and the other uses the relative includes. One for the xsl designer and the other for testing/prod. It's not ideal, but isn't too much of a pain. Chris -Original Message-From: Cox, Charlie [mailto:[EMAIL PROTECTED]]Sent: Friday, June 01, 2001 8:45 AMTo: '[EMAIL PROTECTED]'Subject: RE: Servlets and relative paths What I had to do was put the xsl files in the root directory for my webapp where I could make the href the full url (http://localhost/webapp/sections.xsl) This was the only way I could get it to work correctly. Obviously this exposes your stylesheet to anyone who requests that url. I finally gave up on the include since I was only sharing with 2 stylesheets, but I still use it for my dtd, which has the same problem when processed by a stylesheet. I didn't think that I would get it to work as I wanted since Xalan(library I'm using) doesn't know about tomcat, and I couldn't find anywhere in xalan to set a default path to look for include files/dtd's. Therefore it always assumes the 'working dir' for the application when looking for includes. The ugly option is that you could make the include path = "../webapps/MyContext/sections.xsl" assuming your context is under webapps. Of course this is inconsistant with other paths in your application(i.e. getResourceAsStream()) and is a pain to maintain if you move your context. The other ugly option being chucking the includes into the bin directory, but that defeats the purpose of separating contexts. Charlie -Original Message----- From: Chris McNeilly [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 2:22 PM To: [EMAIL PROTECTED] Subject: RE: Servlets and relative paths No, my problem is that I can use this method to read the xsl file just fine. It's the includes inside the xsl file that aren't working. For example, inside the xsl file (which I read into the servlet using your pointer from the earlier email) there is the line xsl:include href='sections.xsl'/ and I get an error saying that it cannot find file tomcat/bin/sections.xsl. Which, of course, it cannot, since the file is located in Meta-Inf/. Chris -Original Message- From: Bo Xu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 10:45 AM To: [EMAIL PROTECTED] Subject: Re: Servlets and relative paths Chris McNeilly wrote:Thanks Bo. This is certainly a step in the right direction. I can now include the xml file and xsl file using relative paths. My only problem now is that there are xsl includes inside the xsl files and they are still being loaded incorrectly (using the tomcat/bin directory as root, not the servlet context). Any ideas? Thanks, Chris Chris McNeilly wrote:I've got a servlet and am trying to open files. Theproblem is that its defaulting to the tomcat/bin directory whenever I attempt to refer to them. How can I change this? Hardcoding the path isn'tsuch a good idea as my dev environment is different from production.These are xml and xsl files and they are located on the webroot. Thanks, Chris Hi :-) from several emails in Servlet-List and this List: * InputStream is = this.getServletContext(). getResourceAsStream("/WEB-INF/testApp.properties"); now testApp.properties is in myapp/WEB-INF/ *- InputStream is = this.getClass().getResourceAsStream("testApp.properties");- InputStream is = Thread.currentThread().getContextClassLoader(). getResourceAsStream("myservlet.conf"); now, (normally), myservlet.conf/testApp.properties is inmyapp/WEB-INF/classes BoMay.29, 2001 [...] Hello Chris :-) I am not sure, do you want to read a file in TOMCAT_HOME/bin? is the following possible? - put MyUtil.class in TOMCAT_HOME/bin - include TOMCAT_HOME/bin/MyUtil.class into CLASSPATH - put testApp.properties into TOMCAT_HOME/bin - in MyServlet, write the following code: ... MyUtil myobject=new MyUtil(); InputStream is = myobject.getClass().getResourceAsStream("testApp.properties"); ... I don't test it, if it is not right, please correct it, thanks! :-)Bo May.30, 2001
RE: Servlets and relative paths
That's an improvement, although not quite it. Now I have the full path portion hardcoded in the java and not the xsl. Ideally, I'd like it all to be a relative path, but if I don't fully qualify the systemID portion, the include still tries to prepend the tomcat/bin directory. This helps, though. Thanks, Chris -Original Message- From: Steve Meyfroidt [mailto:[EMAIL PROTECTED]] Sent: Friday, June 01, 2001 9:40 AM To: '[EMAIL PROTECTED]' Subject: RE: Servlets and relative paths Set the SystemID for xsl includes: this line is part of the setup for some SAX-driven XSL processing I've used in servlets: StreamSource source = new StreamSource(stream, getSystemID()); // set system id for xsl includes where getSystemID() returns the URI to use as a base location for xsl includes. See the xalan javadoc. Hope that helps. SteveM -Original Message- From: Chris McNeilly [mailto:[EMAIL PROTECTED]] Sent: Friday, June 01, 2001 2:18 PM To: [EMAIL PROTECTED] Subject: RE: Servlets and relative paths That's eventually what I did. I now have two top xsl pages, one includes with fully qualified urls and the other uses the relative includes. One for the xsl designer and the other for testing/prod. It's not ideal, but isn't too much of a pain. Chris -Original Message- From: Cox, Charlie [mailto:[EMAIL PROTECTED]] Sent: Friday, June 01, 2001 8:45 AM To: '[EMAIL PROTECTED]' Subject: RE: Servlets and relative paths What I had to do was put the xsl files in the root directory for my webapp where I could make the href the full url (http://localhost/webapp/sections.xsl) This was the only way I could get it to work correctly. Obviously this exposes your stylesheet to anyone who requests that url. I finally gave up on the include since I was only sharing with 2 stylesheets, but I still use it for my dtd, which has the same problem when processed by a stylesheet. I didn't think that I would get it to work as I wanted since Xalan(library I'm using) doesn't know about tomcat, and I couldn't find anywhere in xalan to set a default path to look for include files/dtd's. Therefore it always assumes the 'working dir' for the application when looking for includes. The ugly option is that you could make the include path = ../webapps/MyContext/sections.xsl assuming your context is under webapps. Of course this is inconsistant with other paths in your application(i.e. getResourceAsStream()) and is a pain to maintain if you move your context. The other ugly option being chucking the includes into the bin directory, but that defeats the purpose of separating contexts. Charlie -Original Message- From: Chris McNeilly [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 2:22 PM To: [EMAIL PROTECTED] Subject: RE: Servlets and relative paths No, my problem is that I can use this method to read the xsl file just fine. It's the includes inside the xsl file that aren't working. For example, inside the xsl file (which I read into the servlet using your pointer from the earlier email) there is the line xsl:include href='sections.xsl'/ and I get an error saying that it cannot find file tomcat/bin/sections.xsl. Which, of course, it cannot, since the file is located in Meta-Inf/. Chris -Original Message- From: Bo Xu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 10:45 AM To: [EMAIL PROTECTED] Subject: Re: Servlets and relative paths Chris McNeilly wrote: Thanks Bo. This is certainly a step in the right direction. I can now include the xml file and xsl file using relative paths. My only problem now is that there are xsl includes inside the xsl files and they are still being loaded incorrectly (using the tomcat/bin directory as root, not the servlet context). Any ideas? Thanks, Chris Chris McNeilly wrote: I've got a servlet and am trying to open files. The problem is that its defaulting to the tomcat/bin directory whenever I attempt to refer to them. How can I change this? Hardcoding the path isn't such a good idea as my dev environment is different from production. These are xml and xsl files and they are located on the webroot. Thanks, Chris Hi :-) from several emails in Servlet-List and this List: * InputStream is = this.getServletContext(). getResourceAsStream(/WEB-INF/testApp.properties); now testApp.properties is in myapp/WEB-INF/ * - InputStream is = this.getClass().getResourceAsStream(testApp.properties); - InputStream is = Thread.currentThread().getContextClassLoader(). getResourceAsStream(myservlet.conf); now, (normally), myservlet.conf/testApp.properties is in myapp/WEB-INF/classes Bo May.29, 2001 [...] Hello Chris :-) I am not sure, do you
How to debug a missing servlet error?
Hi, I have a development environment that works correctly (Win 98), but when I move the code over to my QA environment (Linux) tomcat can no longer find the servlet. I have a web.xml file in the Web-Inf directory that has the following: web-app servlet servlet-name briefXSL /servlet-name servlet-class com.smartbrief.BriefXSLServlet /servlet-class /servlet servlet-mapping servlet-namebriefXSL/servlet-name url-pattern/servlet/briefXSL/url-pattern /servlet-mapping /web-app Tomcat receives the request from apache, but doesn't know what to do with it and spits back a 404. It's almost as if tomcat isn't reading the web.xml file at all. Thanks, Chris
RE: How to debug a missing servlet error?
Nope. I removed it entirely and still got the 404. Also, that invoker is still in my server.xml file on my localhost and it works fine. I can copy the code base to other Win boxes and it works right off, too. So its not something particularly unique to my config on my localhost. Chris -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 31, 2001 3:46 PM To: [EMAIL PROTECTED] Subject: RE: How to debug a missing servlet error? This is a guess, but have you disabled the servlet invoker in the server.xml file? I believe that the servlet invoker will grab the request for /servlet/* before the webapp will check its mappings. I would suggest removing the servlet invoker from your server.xml file and see if this works. If so, then you'll need to decide if you need it and need to change your servlet's mapping or if you can get along just fine without it. (Remember that this is a server-wide setting). Randy -Original Message- From: Chris McNeilly [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 31, 2001 4:15 PM To: [EMAIL PROTECTED] Subject: How to debug a missing servlet error? Hi, I have a development environment that works correctly (Win 98), but when I move the code over to my QA environment (Linux) tomcat can no longer find the servlet. I have a web.xml file in the Web-Inf directory that has the following: web-app servlet servlet-name briefXSL /servlet-name servlet-class com.smartbrief.BriefXSLServlet /servlet-class /servlet servlet-mapping servlet-namebriefXSL/servlet-name url-pattern/servlet/briefXSL/url-pattern /servlet-mapping /web-app Tomcat receives the request from apache, but doesn't know what to do with it and spits back a 404. It's almost as if tomcat isn't reading the web.xml file at all. Thanks, Chris
RE: Re: Servlets and relative paths
Thanks Bo. This is certainly a step in the right direction. I can now include the xml file and xsl file using relative paths. My only problem now is that there are xsl includes inside the xsl files and they are still being loaded incorrectly (using the tomcat/bin directory as root, not the servlet context). Any ideas? Thanks, Chris Chris McNeilly wrote: I've got a servlet and am trying to open files. The problem is that its defaulting to the tomcat/bin directory whenever I attempt to refer to them. How can I change this? Hardcoding the path isn't such a good idea as my dev environment is different from production. These are xml and xsl files and they are located on the webroot. Thanks, Chris Hi :-) from several emails in Servlet-List and this List: * InputStream is = this.getServletContext(). getResourceAsStream(/WEB-INF/testApp.properties); now testApp.properties is in myapp/WEB-INF/ * - InputStream is = this.getClass().getResourceAsStream(testApp.properties); - InputStream is = Thread.currentThread().getContextClassLoader(). getResourceAsStream(myservlet.conf); now, (normally), myservlet.conf/testApp.properties is in myapp/WEB-INF/classes Bo May.29, 2001
RE: Servlets and relative paths
No, my problem is that I can use this method to read the xsl file just fine. It's the includes inside the xsl file that aren't working. For example, inside the xsl file (which I read into the servlet using your pointer from the earlier email) there is the line xsl:include href='sections.xsl'/ and I get an error saying that it cannot find file tomcat/bin/sections.xsl. Which, of course, it cannot, since the file is located in Meta-Inf/. Chris -Original Message- From: Bo Xu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 10:45 AM To: [EMAIL PROTECTED] Subject: Re: Servlets and relative paths Chris McNeilly wrote: Thanks Bo. This is certainly a step in the right direction. I can now include the xml file and xsl file using relative paths. My only problem now is that there are xsl includes inside the xsl files and they are still being loaded incorrectly (using the tomcat/bin directory as root, not the servlet context). Any ideas? Thanks, Chris Chris McNeilly wrote: I've got a servlet and am trying to open files. The problem is that its defaulting to the tomcat/bin directory whenever I attempt to refer to them. How can I change this? Hardcoding the path isn't such a good idea as my dev environment is different from production. These are xml and xsl files and they are located on the webroot. Thanks, Chris Hi :-) from several emails in Servlet-List and this List: * InputStream is = this.getServletContext(). getResourceAsStream(/WEB-INF/testApp.properties); now testApp.properties is in myapp/WEB-INF/ * - InputStream is = this.getClass().getResourceAsStream(testApp.properties); - InputStream is = Thread.currentThread().getContextClassLoader(). getResourceAsStream(myservlet.conf); now, (normally), myservlet.conf/testApp.properties is in myapp/WEB-INF/classes Bo May.29, 2001 [...] Hello Chris :-) I am not sure, do you want to read a file in TOMCAT_HOME/bin? is the following possible? - put MyUtil.class in TOMCAT_HOME/bin - include TOMCAT_HOME/bin/MyUtil.class into CLASSPATH - put testApp.properties into TOMCAT_HOME/bin - in MyServlet, write the following code: ... MyUtil myobject=new MyUtil(); InputStream is = myobject.getClass().getResourceAsStream(testApp.properties); ... I don't test it, if it is not right, please correct it, thanks! :-) Bo May.30, 2001
RE: xalan ApplyXSL sample servlet fails
Funny you should ask. I had (possibly) a very similar problem last week. After combing through maillists etc, I found a reference suggesting that there was a conflict with the xerces xml parser and the xml parser included with tomcat. It suggested removing parser.jar and jaxp.jar from the classpath in the tomcat startup scripts (tomcat.bat for me). That worked for me. I've only been playing with it for a day or two, but it doesn't seem to break tomcat and now my xalan-based servlets function. Chris -Original Message- From: Stan Devitt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 29, 2001 8:35 AM To: [EMAIL PROTECTED] Subject: xalan ApplyXSL sample servlet fails Any pointers to additional info, a working example, or direct help in resolving the following would be most appreciated. Stan Devitt == I am attempting to run the servlet example that is part of the xalan1.2.2 zip file - specifically with DefaultApplyXSL, whose purpose is to apply xslt transformations. I am using tomcat 3.2.1. (more details below) I have installed the servlet in a Test context and a sample xml and style file tested independently. I successfully link to the servlet using: http://localhost:8080/Test/servlet/DefaultApplyXSL? debug=trueURL=/Test/main.xmlxslURL=/Test/styles/main.xsl but the transformation fails in the process method in ApplyXSL during xslprocessor.process(xmlSource, xslSource, outBuffer); The debug response indicates that a) it is finding the servlet, b) it is finding the xml file and its style file, however, a SAX exception occurs while it is being processed to generate html output - the log shows SystemId Unknown; Line 1; Column 1; SystemId Unknown; Line 0; Column 0; Exception is org.xml.sax.SAX Exception Additional Notes: 1. The xml and style file has been validated and successfully transformed using both xt and xalan in command line mode. 2. I am using tomcat 3.2.1, together with jdk1.3.1, xerces 1.2.3 and xalan 1.2.2 on Windows 2000. 3. There is no DOCTYPE in the xml file, nor is there a style sheet processing instruction. 4. The xalan.jar and xerces.jar files are at the start of the class path. Thanks in advance.
mod_jk and mod_rewrite? Do they work together?
Does anyone have an answer to this question? I'm attempting to map my root web directory to a particular jsp page. For example, I would like the URL www.byteme.com to resolve to www.byteme.com/context1/jsp/index.jsp Any ideas? Thanks, Chris