Problems running JNI code inside Tomcat 5.0.28
Hey Folks, We have a C++ SDK that we HAVE to integrate using JNI. We are able to create a console Java app that works perfectly (and beautifully) using JNI and our C++ SDK. When we wrap this up in servlets and attempt to run it within Tomcat 5.0.28, we get an UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: nativeMethod com.mv.jni.MyNewString.nativeMethod(Native Method) com.mv.jni.MyNewString.test(MyNewString.java:6) com.mv.HelloWorldExample.doGet(HelloWorldExample.java:46) javax.servlet.http.HttpServlet.service(HttpServlet.java:697) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) The stack trace above is actually from a highly oversimplified "Hello World" prototype example (which also works in its console app form but not servlet form). We have checked and doubled checked everything - static initializer for the *.dll (did I forget to mention this is in Windows?) and the -Djava.library.path=C:\tomcat\shared\lib. There must be something we are overlooking which will get this to work within Tomcat. Does Tomcat prevent native code from being loaded or accessed? Has anyone run across this problem before or know how to fix it? Any tutorials??? Thanks Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error Building Tomct 5.0.28 with JDK 1.5
Thanks Shinobu (especially for getting back so quickly) I'll try compiling Tomcat 5.5 instead. The only reason I didn't want to go straight to Tomcat 5.5 was to isolate changes. I'm currently running/compiling Tomcat 5.0.28 against the 1.4.2 JDK in our production environment. I am thinking of upgrading to 1.5 JDK (and eventaully Tomcat 5.5), but I didn't want to introduce too many changes at once. Joe From: Shinobu Kawai [mailto:[EMAIL PROTECTED] Sent: Sat 10/16/2004 6:42 PM To: Tomcat Users List Subject: [SPAM] - Re: Error Building Tomct 5.0.28 with JDK 1.5 - Found word(s) check out in the Text body. Hi Joe, > I'm trying to compile Tomcat 5.0.28 from source using Sun's new JDK 1.5. I am using > Ant 1.6.2 (which I built from source against the 1.5 JDK). I successfully get > through grabbing all of the dependant libraries that I need. Once the build script > gets to the "build-main" target, I get an error which states "javac: target release > 1.1 conflicts with default source release 1.5". > > Can Tomcat be built against the 1.5 JDK? Also, does this error indicate that Tomcat > is being built using the 1.1 JDK target, thus skipping optimizations introduced in > the 1.2 - 1.5 JDKs? Or, is this a library that was built using 1.1, and is > conflicting with 1.5? I believe Tomcat 5.5 is built with 1.5. Don't know what happens to 5.0, though. Why not try 5.5? > Here's more of the ANT error output: > > build-main: >[javac] javac: target release 1.1 conflicts with default source release 1.5 Check out the "source" and "target" attributes of the "javac" task. http://ant.apache.org/manual/CoreTasks/javac.html And of course, the javac document. http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javac.html Best regards, -- Shinobu Kawai -- Shinobu Kawai <[EMAIL PROTECTED]> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error Building Tomct 5.0.28 with JDK 1.5
I'm trying to compile Tomcat 5.0.28 from source using Sun's new JDK 1.5. I am using Ant 1.6.2 (which I built from source against the 1.5 JDK). I successfully get through grabbing all of the dependant libraries that I need. Once the build script gets to the "build-main" target, I get an error which states "javac: target release 1.1 conflicts with default source release 1.5". Can Tomcat be built against the 1.5 JDK? Also, does this error indicate that Tomcat is being built using the 1.1 JDK target, thus skipping optimizations introduced in the 1.2 - 1.5 JDKs? Or, is this a library that was built using 1.1, and is conflicting with 1.5? Here's more of the ANT error output: build-main: [echo] - Java-utils - [echo] -- puretls.present = ${puretls.present} [echo] -- jsse.present = true /usr/share/java/jsse-1.0.3/lib/jsse.jar [echo] -- commons-logging = true [echo] -- jmx = true /usr/share/java/mx4j-1.1.1/lib/mx4j-jmx.jar [echo] -- modeler = true /usr/share/java/commons-modeler-1.1/commons-modeler.jar [echo] -- JDK14 = true [javac] Compiling 63 source files to /usr/local/src/jakarta-tomcat-5.0.28-src/jakarta-tomcat-5/build/classes [javac] javac: target release 1.1 conflicts with default source release 1.5 BUILD FAILED /usr/local/src/jakarta-tomcat-5.0.28-src/build.xml:50: The following error occurred while executing this line: /usr/local/src/jakarta-tomcat-5.0.28-src/jakarta-tomcat-5/build.xml:445: The following error occurred while executing this line: /usr/local/src/jakarta-tomcat-5.0.28-src/jakarta-tomcat-5/build.xml:170: The following error occurred while executing this line: /usr/local/src/jakarta-tomcat-5.0.28-src/jakarta-tomcat-connectors/util/build.xml:67: Compile failed; see the compiler error output for details. It says to check the copuiler error output for details - but I don't know where that is... Much thanks for looking at this and setting me in the right direction Joe Krause
Absolute path to webapp???
How do you specify an absolute path to a webapplication. I don't want to run my webapp from within $CATALINA_HOME/webapps. When I set it up to point to an absolute path outside of the webapps directory, it still looks for it there: THis is the error I am getting: java.lang.IllegalArgumentException: Document base /usr/tomcat/jakarta-tomcat-5.0.27/webapps/dvr does not exist or is not a readable directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Removing Balancer Webapp?
Thanks for getting back to me. The server.xml that I posted was the wrong one (that one actaully works because its pointing to webapps). Anyhow, I tried to remove it by taking out the balancer.xml files, but then MY webapp never loads. Heres the real server.xml I am using: I giess I don't understand the autoDeploy mechanism... Joe -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 03, 2004 6:14 AM To: Tomcat Users List Subject: RE: Removing Balancer Webapp? Hi, You remove it the same way you remove any other webapp. You have several options: shutting down the server and physically removing the files, undeploying it via the Manager webapp HTML, or via Ant. The server-minimal.xml wasn't present in Tomcat 4 but if it were it would work exactly the same as it does now: with it, autoDeploy and its equivalents are on, so if there's a balancer.xml in conf/[engine]/[host] it will be deployed. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Joe Krause [mailto:[EMAIL PROTECTED] >Sent: Monday, August 02, 2004 8:43 PM >To: [EMAIL PROTECTED] >Subject: Removing Balancer Webapp? > >How do you remove the balancer webapp. I don't want to deploy my web app >into the webapps directory - I want to use my own path. But everytime I >change the path of the appBase, I get startup errors. Here's my >server.xml file: > > > > > > > > > > > > > > > > > >This is very simple and clean and use to work in Tomcat 4. > >Heres the startup messages: > >Starting Tomcat >Using CATALINA_BASE: /usr/local/tomcat5 >Using CATALINA_HOME: /usr/local/tomcat5 >Using CATALINA_TMPDIR: /usr/local/tomcat5/temp >Using JAVA_HOME: /usr/local/java >Aug 2, 2004 5:36:40 PM org.apache.coyote.http11.Http11Protocol init >INFO: Initializing Coyote HTTP/1.1 on http-8080 Aug 2, 2004 5:36:40 PM >org.apache.catalina.startup.Catalina load >INFO: Initialization processed in 769 ms Aug 2, 2004 5:36:40 PM >org.apache.catalina.core.StandardService start >INFO: Starting service Catalina >Aug 2, 2004 5:36:40 PM org.apache.catalina.core.StandardEngine start >INFO: Starting Servlet Engine: Apache Tomcat/5.0.27 Aug 2, 2004 5:36:40 >PM org.apache.catalina.core.StandardHost start >INFO: XML validation disabled >Aug 2, 2004 5:36:40 PM org.apache.catalina.core.StandardHost getDeployer >INFO: Create Host deployer for direct deployment ( non-jmx ) Aug 2, >2004 5:36:40 PM org.apache.catalina.core.StandardHostDeployer >install >INFO: Processing Context configuration file URL >file:/usr/tomcat/jakarta-tomcat-5.0.27/conf/Catalina/localhost/admin.xm l >Aug 2, 2004 5:36:41 PM org.apache.catalina.realm.JAASRealm setContainer >INFO: Setting JAAS app name Catalina >Aug 2, 2004 5:36:41 PM org.apache.struts.util.PropertyMessageResources > >INFO: Initializing, config='org.apache.struts.util.LocalStrings', >returnNull=true >Aug 2, 2004 5:36:41 PM org.apache.struts.util.PropertyMessageResources > >INFO: Initializing, config='org.apache.struts.action.ActionResources', >returnNull=true >Aug 2, 2004 5:36:41 PM org.apache.struts.util.PropertyMessageResources > >INFO: Initializing, >config='org.apache.webapp.admin.ApplicationResources', returnNull=true >Aug 2, 2004 5:36:43 PM org.apache.catalina.core.StandardHostDeployer >install >INFO: Processing Context configuration file URL >file:/usr/tomcat/jakarta-tomcat-5.0.27/conf/Catalina/localhost/balancer . >xml >Aug 2, 2004 5:36:43 PM org.apache.catalina.core.StandardContext >resourcesStart >SEVERE: Error starting static Resources >java.lang.IllegalArgumentException: Document base /dvr/web/balancer does >not exist or is not a readable directory >at >org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.ja v >a:138) >at >org.apache.catalina.core.StandardContext.resourcesStart(StandardContext . >java:3910) >at >org.apache.catalina.core.StandardContext.start(StandardContext.java:413 8 >) >at >org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.j a >va:823) >at >org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) >at >org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) >at >org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDepl o >yer.java:903) >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >at >sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja v >a:39) >at >sun.reflect.DelegatingMethodAccessorIm
Removing Balancer Webapp?
How do you remove the balancer webapp. I don't want to deploy my web app into the webapps directory - I want to use my own path. But everytime I change the path of the appBase, I get startup errors. Here's my server.xml file: This is very simple and clean and use to work in Tomcat 4. Heres the startup messages: Starting Tomcat Using CATALINA_BASE: /usr/local/tomcat5 Using CATALINA_HOME: /usr/local/tomcat5 Using CATALINA_TMPDIR: /usr/local/tomcat5/temp Using JAVA_HOME: /usr/local/java Aug 2, 2004 5:36:40 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Aug 2, 2004 5:36:40 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 769 ms Aug 2, 2004 5:36:40 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Aug 2, 2004 5:36:40 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.27 Aug 2, 2004 5:36:40 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Aug 2, 2004 5:36:40 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) Aug 2, 2004 5:36:40 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:/usr/tomcat/jakarta-tomcat-5.0.27/conf/Catalina/localhost/admin.xml Aug 2, 2004 5:36:41 PM org.apache.catalina.realm.JAASRealm setContainer INFO: Setting JAAS app name Catalina Aug 2, 2004 5:36:41 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true Aug 2, 2004 5:36:41 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true Aug 2, 2004 5:36:41 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true Aug 2, 2004 5:36:43 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:/usr/tomcat/jakarta-tomcat-5.0.27/conf/Catalina/localhost/balancer. xml Aug 2, 2004 5:36:43 PM org.apache.catalina.core.StandardContext resourcesStart SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base /dvr/web/balancer does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.jav a:138) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext. java:3910) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4138 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeplo yer.java:903) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:2 52) at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256) at org.apache.commons.digester.Rule.end(Rule.java:276) at org.apache.commons.digester.Digester.endElement(Digester.java:1058) at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.ja va:76) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unk nown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno wn Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1567) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeploy er.java:488) at org.apache.catalina.core.StandardHost.install(StandardHost.java:863) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java :482) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:968)
Advanced Question about tag
I have a complicated menu structure that is dynamically generated per client on login of the webapp. Each client has a different set of folders which don't change often but require a bit of processing to produce - so I decided to create an include file and cache it on the server. I include that cached HTML/Javascript menu structure with the following command: This works great! However, a problem occurs when I need to update one of these cached files because the client added or deleted a folder. Sometimes, the pages that are returned contain the state prior to any change. If I then refresh or go to another page, the folder structure is immediately changed. Sometime this happens, sometimes it works right. It seems like Tomcat is caching the contents of the file that <%= clientSession.menuPath %> is poiting to. I know for a fact that the browser is not caching the page (I've included all the appropriate HTML header tags to stop browser caching, plus there is data on the page that is changing with each page refresh). Also, I am not using any threads, and my updating of the page is happening prior to the including of the page. Has anyone had this problem before? Is ther a way to tell tomcat to always go and get the page every time? Joe Krause
RE: JDBC + MySQL Datasource + Tomcat = ClassCastException
Ok - implemented the getGeneratedKeys() method and everything works great. Thank you very much Mike! On another topic, is there any quick way to determine the total rows returned in a ResultSet without stepping through it. I want to build array's or objects and I need to know in advance what the array dimension will be. I could use lists, but I'd rather use array's. Here's what I came up with: ResultSet rs = ps.executeQuery(); rs.last(); int total = rs.getRow(); rs.beforeFirst(); When I get the resultset, I go to the last row, get its number, and then reset the resultset cursor back to before the first row. Is there already a method to give me this data? I looked but couldn't find any... Joe -Original Message- From: Mike Curwen [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 1:05 PM To: 'Tomcat Users List' Subject: RE: JDBC + MySQL Datasource + Tomcat = ClassCastException I'd drop the non-compliant way of getting this value, and use what's provided by JDBC 3.0 (available with JDK 1.4.x and ConnectorJ 3.x) statement.getGeneratedKeys() No casting required. http://www.mysql.com/articles/autoincrement-with-connectorj.html > -Original Message- > From: Joe Krause [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 22, 2003 2:49 PM > To: '[EMAIL PROTECTED]' > Subject: JDBC + MySQL Datasource + Tomcat = ClassCastException > > > Hi Folks, I am trying to recast the JDBC Statement object > that is given to me from a Connection object that I get out > of Tomcat's datasource connection pool. If I recast the > generic java.sql.Statement to a com.mysql.jdbc.Statment, I > can use the non JDBC compliant methods such as > getLastInsertID. When I do this in a test class using > standard JDBC, it works perfectly. But when I try to do this > from a connection object that is retrived from tomcat's > connection pool, I get a ClassCastException. Does the > datasource mechanism alter the connection somehow so that it > would no longer give me com.mysql.jdbc.Statment objects, but > some other kind? > > > > Here's the code that works... > > > > Class.forName("com.mysql.jdbc.Driver"); > > Connection con = > DriverManager.getConnection(:mysql://jedi.x:3306/vegas?autoRec > onnect=true, > username, password); > > > > Statement stmt = con.createStatement(); > > stmt.executeUpdate("INSERT INTO role VALUES > (null, 'test', '123')"); > > > > com.mysql.jdbc.Statement m = > (com.mysql.jdbc.Statement) stmt; > > long id = m.getLastInsertID(); > > > > Here's the code that doesn't work: > > > > Context ctx = new InitialContext(); > > DataSource ds = > (DataSource)ctx.lookup("java:comp/env/jdbc/vegas"); > > Connection con = ds.getConnection(); > > > > Statement stmt = con.createStatement(); > > stmt.executeUpdate("INSERT INTO role VALUES > (null, 'test', '123')"); > > > > com.mysql.jdbc.Statement m = > (com.mysql.jdbc.Statement) stmt; > > long id = m.getLastInsertID(); > > > > I should note that other than this, everything works fine > with the datasource. Its configured properly (I think) and I > can fully access the database in all respects. > > > > I am using: > > Tomcat 4.1.24 > > Linux 2.4.20 > > Mysql 4.0.13 > > Java 1.4.1.03 > > Mysql Connector/J 3.0.8 > > > > Thanks For the help! > > > > Joe Krause > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDBC + MySQL Datasource + Tomcat = ClassCastException
Hi Folks, I am trying to recast the JDBC Statement object that is given to me from a Connection object that I get out of Tomcat's datasource connection pool. If I recast the generic java.sql.Statement to a com.mysql.jdbc.Statment, I can use the non JDBC compliant methods such as getLastInsertID. When I do this in a test class using standard JDBC, it works perfectly. But when I try to do this from a connection object that is retrived from tomcat's connection pool, I get a ClassCastException. Does the datasource mechanism alter the connection somehow so that it would no longer give me com.mysql.jdbc.Statment objects, but some other kind? Here's the code that works... Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection(:mysql://jedi.x:3306/vegas?autoReconnect=true, username, password); Statement stmt = con.createStatement(); stmt.executeUpdate("INSERT INTO role VALUES (null, 'test', '123')"); com.mysql.jdbc.Statement m = (com.mysql.jdbc.Statement) stmt; long id = m.getLastInsertID(); Here's the code that doesn't work: Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/vegas"); Connection con = ds.getConnection(); Statement stmt = con.createStatement(); stmt.executeUpdate("INSERT INTO role VALUES (null, 'test', '123')"); com.mysql.jdbc.Statement m = (com.mysql.jdbc.Statement) stmt; long id = m.getLastInsertID(); I should note that other than this, everything works fine with the datasource. Its configured properly (I think) and I can fully access the database in all respects. I am using: Tomcat 4.1.24 Linux 2.4.20 Mysql 4.0.13 Java 1.4.1.03 Mysql Connector/J 3.0.8 Thanks For the help! Joe Krause
RE: JK2 Servlet Configuration Problem
Great! Thanks guys - this works. -Original Message- From: John Turner [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 6:09 AM To: Tomcat Users List Subject: Re: JK2 Servlet Configuration Problem I don't use JK2, but as far as I know, this is prefectly valid: [uri:vegas.x.multivisioninc.com/*.jsp] worker=ajp13:localhost:8009 [uri:vegas.x.multivisioninc.com/action/*] worker=ajp13:localhost:8009 Are you saying you have tried this and it does not work? Regarding your comments on the documentation, patches are always welcome. John On Wed, 16 Jul 2003 14:06:40 -0700, Joe Krause <[EMAIL PROTECTED]> wrote: > I'm running Tomcat 4.1.24 with Apache 2.0.46 using JK2 2.0.2 on a Red Hat > 9 > system (kernel 2.4.20). I followed the last HOWTO on the JK docs page > (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhosthowto.html) > and everything works great. Except it only specifies how to have *.jsp > files > sent to tomcat. None of my servlets work because JK2 is setup to only > send > requests ending in *.jsp to Tomcat. Here's what I have in > workers2.properties: > > [uri:vegas.x.multivisioninc.com/*.jsp] > worker=ajp13:localhost:8009 > > [uri:admin.vegas.x.multivisioninc.com/*.jsp] > worker=ajp13:localhost:8009 > > My servlets all start at /action. If I change the uri path to /action/* > then > I loose JPSs. If I change it to * then it works, however, then tomcat is > serving up my /images/* folder instead of Apache. I can't move all the > JSPs > under the /action directory. Is there any way to specify more than one > uri > per virtual host? > The documentation for JK is really bad. Someone should re-write it. > > Joe Krause > -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JK2 Servlet Configuration Problem
I'm running Tomcat 4.1.24 with Apache 2.0.46 using JK2 2.0.2 on a Red Hat 9 system (kernel 2.4.20). I followed the last HOWTO on the JK docs page (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhosthowto.html) and everything works great. Except it only specifies how to have *.jsp files sent to tomcat. None of my servlets work because JK2 is setup to only send requests ending in *.jsp to Tomcat. Here's what I have in workers2.properties: [uri:vegas.x.multivisioninc.com/*.jsp] worker=ajp13:localhost:8009 [uri:admin.vegas.x.multivisioninc.com/*.jsp] worker=ajp13:localhost:8009 My servlets all start at /action. If I change the uri path to /action/* then I loose JPSs. If I change it to * then it works, however, then tomcat is serving up my /images/* folder instead of Apache. I can't move all the JSPs under the /action directory. Is there any way to specify more than one uri per virtual host? The documentation for JK is really bad. Someone should re-write it. Joe Krause
JK2 Servlet Configuration
I'm running Tomcat 4.1.24 with Apache 2.0.46 using JK2 2.0.2 on a Red Hat 9 system (kernel 2.4.20). I followed the last HOWTO on the JK docs page (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhosthowto.html <http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhosthowto.html> ) and everything works great. Except it only specifies how to have *.jsp files sent to tomcat. None of my servlets work because JK2 is setup to only send requests ending in *.jsp to Tomcat. Here's what I have in workers2.properties: [uri:vegas.x.multivisioninc.com/*.jsp] worker=ajp13:localhost:8009 [uri:admin.vegas.x.multivisioninc.com/*.jsp] worker=ajp13:localhost:8009 My servlets all start at /action. If I change the uri path to /action/* then I loose JPSs. If I change it to * then it works, however, then tomcat is serving up my /images/* folder instead of Apache. I can't move all the JSPs under the /action directory. Is there any way to specify more than one uri per virtual host? The documentation for JK is really bad. Someone should re-write it. Joe Krause
RE: The "servlet" prefix
what was the context and the final URL for this deployment? just so i can get an idea? I've never seen the tag before. thanks for the help - think you're pointing me in the right direction. Joe -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Sent: Wednesday, April 25, 2001 1:59 PMTo: [EMAIL PROTECTED]Subject: RE: The "servlet" prefix You don't have to use the jsp extension. Map them to your servlet name, but without an extension. Your going to have to set your WEB.XML file up anyways. Something like this: UserServices /UserServices I just tested it, it works fine. Wes -Original Message-From: Joe Krause [mailto:[EMAIL PROTECTED]]Sent: Wednesday, April 25, 2001 4:56 PMTo: '[EMAIL PROTECTED]'Subject: RE: The "servlet" prefix Thanks for getting back to me so quick. However, if i map my servlets to a .JSP extension, then I will still have to rewrite all the hyperlinks on the site. Right? -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Sent: Wednesday, April 25, 2001 1:51 PMTo: [EMAIL PROTECTED]Subject: RE: The "servlet" prefix I map my servlets to a .JSP extension, then I can use relative URLs both for my serlvets and in my servlets when I do redirects. This may not be the best way, but it works great. Wes -Original Message-From: Joe Krause [mailto:[EMAIL PROTECTED]]Sent: Wednesday, April 25, 2001 4:31 PMTo: '[EMAIL PROTECTED]'Subject: The "servlet" prefix How do you get rid of the "servlet" prefix that Tomcat appends to every servlet URL? I have a web site that is currently using jserv, but we are upgrading the server and I want to move the site over to tomcat. However, tomcat's default behaviour is to stick the work "servlet" in the URL between the context name and the servlet being accessed. This breaks all my HREFs. Instead of rewritting all the HREFs on 50 pages, I want tomcat to not use a the "servlet" prefix. I have tracked this default behaviour down to a couple of lines in the server.xml file. className="org.apache.tomcat.request.InvokerInterceptor" debug="0" prefix="/servlet/" /> The problem is that when i remove this RequestInterceptor or make prefix="" or prefix="/" - i don't get access to the servlets and end up with a 404 error. Has anyone seen this problem before? Can anyone help me? Thanks for taking the time to read this! Joe Krause
RE: The "servlet" prefix
Thanks for getting back to me so quick. However, if i map my servlets to a .JSP extension, then I will still have to rewrite all the hyperlinks on the site. Right? -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Sent: Wednesday, April 25, 2001 1:51 PMTo: [EMAIL PROTECTED]Subject: RE: The "servlet" prefix I map my servlets to a .JSP extension, then I can use relative URLs both for my serlvets and in my servlets when I do redirects. This may not be the best way, but it works great. Wes -Original Message-----From: Joe Krause [mailto:[EMAIL PROTECTED]]Sent: Wednesday, April 25, 2001 4:31 PMTo: '[EMAIL PROTECTED]'Subject: The "servlet" prefix How do you get rid of the "servlet" prefix that Tomcat appends to every servlet URL? I have a web site that is currently using jserv, but we are upgrading the server and I want to move the site over to tomcat. However, tomcat's default behaviour is to stick the work "servlet" in the URL between the context name and the servlet being accessed. This breaks all my HREFs. Instead of rewritting all the HREFs on 50 pages, I want tomcat to not use a the "servlet" prefix. I have tracked this default behaviour down to a couple of lines in the server.xml file. className="org.apache.tomcat.request.InvokerInterceptor" debug="0" prefix="/servlet/" /> The problem is that when i remove this RequestInterceptor or make prefix="" or prefix="/" - i don't get access to the servlets and end up with a 404 error. Has anyone seen this problem before? Can anyone help me? Thanks for taking the time to read this! Joe Krause
The "servlet" prefix
How do you get rid of the "servlet" prefix that Tomcat appends to every servlet URL? I have a web site that is currently using jserv, but we are upgrading the server and I want to move the site over to tomcat. However, tomcat's default behaviour is to stick the work "servlet" in the URL between the context name and the servlet being accessed. This breaks all my HREFs. Instead of rewritting all the HREFs on 50 pages, I want tomcat to not use a the "servlet" prefix. I have tracked this default behaviour down to a couple of lines in the server.xml file. className="org.apache.tomcat.request.InvokerInterceptor" debug="0" prefix="/servlet/" /> The problem is that when i remove this RequestInterceptor or make prefix="" or prefix="/" - i don't get access to the servlets and end up with a 404 error. Has anyone seen this problem before? Can anyone help me? Thanks for taking the time to read this! Joe Krause