DataSourceRealm exception (TC4.1.18)
Greetings, I'm trying to configure a DataSourceRealm in tomcat 4.1.18, but I'm getting an exception when I try to use this configuration in my context: Context path=/ngincare docBase=ngincare.war debug=0 reloadable=true Realm className=org.apache.catalina.realm.DataSourceRealm dataSourceName=java:comp/env/jdbc/ngincaredb userTable=ws_users userNameCol=username userCredCol=password userRoleTable=ws_user_roles roleNameCol=role / /Context the exception: ServerLifecycleListener: createMBeans: MBeanException java.lang.Exception: ManagedBean is not found with DataSourceRealm at org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:614 ) at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(Serve rLifecycleListener.java:429) at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(Serve rLifecycleListener.java:651) at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(Serve rLifecycleListener.java:590) at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(Serve rLifecycleListener.java:783) at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(Serve rLifecycleListener.java:751) at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(Serve rLifecycleListener.java:339) at org.apache.catalina.mbeans.ServerLifecycleListener.lifecycleEvent(Ser verLifecycleListener.java:206) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:166) at org.apache.catalina.core.StandardServer.start(StandardServer.java:218 2) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) -- id name=pedro salazar email[EMAIL PROTECTED]/email pgp-key-id0E129E31D803BC61/pgp-key-id /id - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
REALM, 3 questions...
Greetings, I would like to know a few things about the using of REALMS in tomcat. 1)If I configure a invalid database host on my realm (imagine that the network link is broken), I can't start tomcat - it blocks!! Shouldn't tomcat startup normally and only throws an error when trying to access that realm by a web application? For instance, I could need restart a tomcat instance by using a load balancing architecture with apache, and if the database host is unreachable my tomcat would block... 2)Can I use a SSL authentication using openssl certificates going beyond the BASIC authentication? 3)Is it possible that I use a custom REALM (JDBC for example), where I could define my user/password parameters encrypted? thanks, Pedro Salazar -- id name=pedro salazar email[EMAIL PROTECTED]/email pgp-key-id0E129E31D803BC61/pgp-key-id /id signature.asc Description: This is a digitally signed message part
migrate from tomcat 4.1.2 - 4.1.17 (JVM1.4.1) : JasperException
Greetings, I created a web application developed and tested on tomcat 4.1.2 (Java Web Services Devepoper Pack). When I deployed it in tomcat 4.1.17, I started to get a few unexpected errors: 1) The mapping from the context root / to a start page (jsp) doesn't work: (web.xml) servlet-mapping servlet-namestart/servlet-name url-pattern//url-pattern /servlet-mapping 2)[more important] When I forced to go the start.jsp page, I get the exception listed below. I don't know if it is caused by the use of JVM1.4.1 or the miss of a correct or a different version of jasper package. Could anyone give me a hint here? thanks, Pedro Salazar. org.apache.jasper.JasperException: /start.jsp(41,1) Unterminated %@ include tag at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorH andler.java:94) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.j ava:428) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.j ava:170) at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:388) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:800) at org.apache.jasper.compiler.Parser.parse(Parser.java:122) at org.apache.jasper.compiler.ParserController.parse(ParserController.ja va:199) at org.apache.jasper.compiler.ParserController.parse(ParserController.ja va:153) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:223) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:351) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext .java:474) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2 95) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) ... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: migrate from tomcat 4.1.2 - 4.1.17 (JVM1.4.1) : JasperException
I try with the 4.1.18 and it worked just fine. I try to use a new 4.1.17 in another machine and it works just fine too. So, I should presume that my development 4.1.17 may corrupted with some conflicts in some packages that I eventually put there. I should know more about the packages in tomcat distribution to better debug these problems (it reminds me how the windows problems are solved... reinstall windows! I'm kidding!). thanks, Pedro Salazar. On Tue, 2003-01-21 at 18:17, Pedro Salazar wrote: Greetings, I created a web application developed and tested on tomcat 4.1.2 (Java Web Services Devepoper Pack). When I deployed it in tomcat 4.1.17, I started to get a few unexpected errors: 1) The mapping from the context root / to a start page (jsp) doesn't work: (web.xml) servlet-mapping servlet-namestart/servlet-name url-pattern//url-pattern /servlet-mapping 2)[more important] When I forced to go the start.jsp page, I get the exception listed below. I don't know if it is caused by the use of JVM1.4.1 or the miss of a correct or a different version of jasper package. Could anyone give me a hint here? thanks, Pedro Salazar. org.apache.jasper.JasperException: /start.jsp(41,1) Unterminated %@ include tag at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorH andler.java:94) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.j ava:428) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.j ava:170) at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:388) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:800) at org.apache.jasper.compiler.Parser.parse(Parser.java:122) at org.apache.jasper.compiler.ParserController.parse(ParserController.ja va:199) at org.apache.jasper.compiler.ParserController.parse(ParserController.ja va:153) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:223) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:351) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext .java:474) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2 95) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) ... -- 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]
configure CoyoteConnector with mod_jk in tomcat 4.1.x
Greetings, I would like to use the CoyoteConnector rather than the Ajp13Connector since I'm using tomcat 4.1(.17) and the listener org.apache.catalina.mbeans.GlobalResourcesLifecycleListener (to have a global database resource) is incompatible with Ajp13Connector (plus the Ajp13Connector will be deprecated facing the CoyoteConnector). But I don't know how to configure the jk2.properties of the CoyoteConnector for tomcat. I have in my apache server pointing to a older worker.properties (simple configuration) that should work with the jk2.properties - I believe that for both of them are required (one for apache and one for tomcat). How should I define the workers list in jk2.properties for they match with the workers.properties of apache? For now I didn't touch in jk2.properties (is all commented). And I have defined a worker called ajp13 (type ajp13) in the workers.properties for apache. My configuration is: -apache2.0.43 + mod_jk -tomcat 4.1.17 -linux redhat 8.0 (2.4.19) thanks, Pedro Salazar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: configure CoyoteConnector with mod_jk in tomcat 4.1.x
1- About the Apache, I have no doubts that the mod_jk uses the file defined in JkWorkersFile directive. But, is that clear that Tomcat (4.1.x), I mean the CoyoteConnector, uses only and just only the workers.properties inside $TOMCAT_HOME/conf/? Or could it be in another place? I heard something about workers2.properties, another about conf/jk/workers.properties, I don't know if they were specific for apache or if the location can be defined. I would like to clarify this issue, I mean, the correct file name and location of the configuration of the workers to CoyoteConnector that should be the same for Apj13Connector. 2- About the images, they are located inside WAR files in webapps of tomcat. I tried to use JkAutoAlias /opt/tomcat/webapps but apparently it isn't a known directive of mod_jk (probably only to mod_jk2). So, I thought that by default any request of a image inside a JkMount context should be handled by Apache in transparent way. It appears that I should have a two web applications, one with a dynamic content and another with the static, but it isn't like that, is it? thanks, Pedro Salazar. On Thu, 2003-01-16 at 17:50, Turner, John wrote: I can't explain those log messages. I do know that mod_jk uses a single file called workers.properties. I believe, if you use the JkWorkersFile command in httpd.conf, that you can tell mod_jk to use any file you like, like my.properties. So, if you want to use jk2.properties, you probably can. I only use mod_jk, and I can assure you I have no files named jk2.properties. mod_jk2 is a completely different module. It takes different configuration commands, it uses two files instead of one (or can use a single file if you use JkUriSet in httpd.conf). So, the confusion can be clarified by you telling us which module you are using: JK (mod_jk), or JK2 (mod_jk2). Then we can help you figure out your configuration questions, if any. Otherwise we are just going in circles. Regarding your question about the images: where are the images located relative to Apache and Tomcat? Does Tomcat have access to that directory? Does Apache have access to that directory? More information is needed. John -Original Message- From: Pedro Salazar [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 12:29 PM To: Tomcat Users List Subject: RE: configure CoyoteConnector with mod_jk in tomcat 4.1.x Greetings, John, if what you said is right why is that happens: 1)when my tomcat starts, it logs a message saying the configuration is the jk.properties: 25984 [main] INFO http11.Http11Protocol - Starting Coyote HTTP/1.1 on port 8080 26167 [main] INFO common.ChannelSocket - JK2: ajp13 listening on /0.0.0.0:8009 26278 [main] INFO server.JkMain - Jk running ID=0 time=3/294 config=/opt/tomcat/conf/jk2.properties is it also using the workers.properties? (is this the name to use?) 2)and not touching in any apache configuration (pointing to tomcat's workers.properties), the Apj13Connector works just fine, but the CoyoteConnector doesn't log any message in log file! Could you figure why? thanks Pedro Salazar. PS. With my Apj13Connector (the only one I could put it to work yet), accessing the http://localhost/index.jsp (I have a mapping JkMount /*.jsp ajp13), the images don't appear in the default web page of tomcat. Why? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: configure CoyoteConnector with mod_jk in tomcat 4.1.x
clear OK, I wasn't clear about the workers.properties. I was thinking that it was also used by tomcat. I thought that I could configure several workers by in configuration file that a tomcat would create on initialization. Workers to me were processes: 2 workers for apj13, more 2 for apj14, But, workers are just *tomcat instances*! In that context, workers.properties only have meaning to apache! I'm clear now, thanks! /clear two-more-things one To have several tomcat instances in one machine, they must run in different ports. To achieve that we should create several Connectors configured in different ports on the server.xml, or should we run different processes (different JVMs) by running several catalinas? /one two So, what could be wrong when I use the CoyoteConnector? The workers.properties should be the same as for the Apj13Connector, and it works with me! /two /two-more-thing On Thu, 2003-01-16 at 19:29, Turner, John wrote: Sorry, I'm just not clear what you are asking. Mod_jk uses workers.properties for information on how to reach Tomcat. That's all...that file is not used by CoyoteConnector in any way. Regarding mod_jk2, anything I could tell you would be a guess, as I do not use JK2. Unless you have a JkMount directing an image URL like /*.gif to Tomcat, then Apache will serve that content, not Tomcat. Tomcat only knows about URLs that are in JkMount statements. If the content is in a WAR file, Apache has no way to get to that content. If you are going to use a JkMount statement that sends static and dynamic content requests to Tomcat, there's really no reason to use Apache at all, in which case the question is moot. Unless you have some sort of legacy requirement or requirement to use mod_rewrite or some other Apache modules in addition to mod_jk. John -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat + commons-logging + log4j
Greetings, I would like to configure log4j in my tomcat environment. I included a log4j.properties in my web application inside WEB-INF/classes/. I put my war (ngincare.war) in webapps and included a context for my web application in server.xml with the following lines: context docBase=ngincare.war debug=9 reloadable=true path=ngincare Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_ngincare_log. suffix=.txt timestamp=true / /context But unfortunately my log is still being appended in catalina.out! My log4j.properties is defined like this: log4j.rootLogger=,NGIN log4j.category.PT.ptinovacao.ngincare=NGIN log4j.appender.NGIN=org.apache.log4j.ConsoleAppender log4j.appender.NGIN.layout=org.apache.log4j.PatternLayout log4j.appender.NGIN.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n I don't know if my context is being really used by my web application since I never could configure a resource element there! The only way I could get a resource to work was put it inside the DefaultContext element!! Could it be? I will appreciate any help you can give. thanks, Pedro Salazar. On Tue, 2002-12-10 at 07:12, Bill Barker wrote: Wendy Smoak [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Jacob wrote: Set up your Context ... entry to look something like this: Context path=/myapp docBase=myapp debug=5 Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_myapp_servlet_log. suffix=.txt timestamp=true / /Context Wow, nothing like it being right there in front of my face. The context tag for the examples does have a Logger tag-- I must have been searching for 'Logging' instead. Thanks! Dan wrote: Use Tomcat log interface will make your code depending on Tomcat appserver. What if you want run your app on other servers in the future? I take it logging isn't in the servlet spec? From another message, I got the impression that the container would want to send some messages itself. If there is no Logger configured for the webapp, does it just send them to the console? There is a 'log' method (serveral, actually) in the ServletContext object. There are also conveniance 'log' methods in GenericServlet (which most servlets extend, since HttpServlet does). This works fine if all you want to do is to log from your servlets. If you also want to be able to log from your Beans as well, it's not much help, since they usually won't have access to the ServletContext. In this case you are better off with commons-logging and/or log4j. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- pedro salazar (pt-inovacao) [EMAIL PROTECTED] key id: D803BC61 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat + commons-logging + log4j
On Tue, 2002-12-10 at 16:31, Wendy Smoak wrote: I put my war (ngincare.war) in webapps and included a context for my web application in server.xml with the following lines: context docBase=ngincare.war debug=9 reloadable=true path=ngincare Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_ngincare_log. suffix=.txt timestamp=true / /context But unfortunately my log is still being appended in catalina.out! AFAIK, this has nothing to do with log4j, but it should have caused the stuff that the container is logging to go to the file you specified. But... shouldn't 'Context' be capitalized? Not sure if that matters, but since it's not working, I would capitalize it and try again. 1)I was thinking that the configurations weren't case sensitive since they are XML elements, but after I move context to Context, it created the log file I was expecting. Now, on to log4j: My log4j.properties is defined like this: log4j.rootLogger=,NGIN log4j.category.PT.ptinovacao.ngincare=NGIN log4j.appender.NGIN=org.apache.log4j.ConsoleAppender log4j.appender.NGIN.layout=org.apache.log4j.PatternLayout log4j.appender.NGIN.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n I don't know if my context is being really used by my web application since I never could configure a resource element there! The only way I could get a resource to work was put it inside the DefaultContext element!! Could it be? I haven't done anything with contexts or resources in order to get log4j working, so I'm not sure if that's another way to do this or if it's just not necessary. 2) If I didn't included the log4j.properties, I was getting only this warning message, and no output of any log: log4j:WARN No appenders could be found for logger (PT.ptinovacao.ngincare.service.NGINCareImpl). log4j:WARN Please initialize the log4j system properly. How are you using this logger? I'm using commons-logging on top of log4j. So in my classes, I have: import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; //replace ClassName with the actual class name: private static Log log = LogFactory.getLog( ClassName.class ); //then to write a message: log.debug( a debug message ); 3)Well, I'm using only the log4j! ... import org.apache.log4j.Logger; ... private static Logger logger; static { logger = Logger.getLogger(NGINCareImpl.class); } ... logger.info(testing); ... When you say it's not working... are you not seeing *any* logging messages, or seeing them in the wrong format? I was able to confirm that my properties file was being used by changing the ConversionPattern and looking to see if the output changed. 4)I get the output but not in the expected log file! I was hoping that the Logger element could specify the destination, and the log in application through log4j just would define the format and things like that. Since I move context to Context (1), it started to log ok. [THE PROBLEM NOW] 5)now I get the log of my web application generated by the container in the specific log file, but the log I use through log4j appears in catalina.out!! How can I redirect this log also to the specific file?? thnaks, Pedro Salazar. -- pedro salazar (pt-inovacao) [EMAIL PROTECTED] key id: D803BC61 signature.asc Description: This is a digitally signed message part
RE: Tomcat + commons-logging + log4j
Greetings, Wendy, first let me give my thanks to you for your assistance, and let's go to my problem here. I updated log4j.properties to log to a file (I comment in the ConsoleAppender). but, I don't know why it not only doesn't creates the log file I specified, that it also only updates in catalina only to the INFO level! The DEBUG level logs aren't passing the filter!! What am I doing wrong?? my log4j.properties in WEB-INF/classes/: log4j.rootLogger=DEBUG,NGIN log4j.category.PT.ptinovacao.ngincare=DEBUG,NGIN #log4j.appender.NGIN=org.apache.log4j.ConsoleAppender log4j.appender.NGIN=org.apache.log4j.RollingFileAppender log4j.appender.NGIN.File=../logs/ngincare.log log4j.appender.NGIN.MaxFileSize=1024KB log4j.appender.NGIN.layout=org.apache.log4j.PatternLayout log4j.appender.NGIN.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n thanks, Pedro Salazar -- pedro salazar (pt-inovacao) [EMAIL PROTECTED] key id: D803BC61 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
oracle+tomcat 4.1.x+dbcp = driverClassName is required!
Greetings, I'm getting this exception when I try to lookup and cast a DataSource: [catalina.out] javax.naming.NamingException: DbcpDataSourceFactory: driverClassName is required org.apache.naming.factory.DbcpDataSourceFactory.getObjectInstance(DbcpDataSourceFactory.java:199) org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:177) javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301) org.apache.naming.NamingContext.lookup(NamingContext.java:835) ... [server.xml] I'm using a resource inside globalNamingResources and linked with resourceLink in context (but I already tried a explicit resource inside context). [web.xml] I'm using a resource-ref. System: -tomcat 4.1.2 (JavaWebServicesDeveloperPack 1.0.1) -dbcp 1.0 -jdbc oracle driver (renamed to jar and without javax.sql package) in common/lib directory. But I know that the driver is being loaded because before call my web application, I saw this info message in catalina.out: DbcpDataSourceFactory: driverClassName=oracle.jdbc.driver.OracleDriver, url=jdbc:oracle:thin:@192.168.89.52:1521:dbtest, user=test_01 I don't know why but it works fine in tomcat 4.0.6 I got it in other machine. So, what is the problem here? If need I can supply the exactly configurations (resource, resource-ref, ...). thanks, Pedro Salazar. -- pedro salazar (pt-inovacao) [EMAIL PROTECTED] key id: D803BC61 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required!
Greetings, Eric, I'm getting a javax.naming.NameNotFoundException: Name jdbc is not bound in this Context exception! I have a resource link inside my context (no resource here or resource-ref in web.xml): resourceLink name=jdbc/ngincaredb global=jdbc/ngincaredb_global type=javax.sql.DataSource / and I'm doing a lookup in my code for jdbc/ngincaredb: Context initCtx = new InitialContext(); Context envCtx = (Context)initCtx.lookup(java:comp/env); this.ds = (DataSource)envCtx.lookup(/jdbc/ngincaredb); So, what's wrong here? thanks, Pedro Salazar. On Mon, 2002-12-09 at 13:06, Roberts, Eric wrote: Pedro, You need javax.sql - that is the package containing DataSource. Your Resource type should be: type=javax.sql.DataSource You need these parameters in addition to url, username and password: parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter In the Context the ResourceLink type should be: type=javax.sql.DataSource You do not need any resource-ref in your web.xml - just use your ResourceLink name as follows: Context ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/{name_of_resource_link}); if (ds != null) { DbCon = ds.getConnection(); } Hope this helps. -- pedro salazar (pt-inovacao) [EMAIL PROTECTED] key id: D803BC61 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required!
Greetings, I find a way of put it to work (tested on 4.0.4, 4.1.2). I put the Resource inside a *DefaultContext*. I couldn't put it to work inside a specific context or even through a resourceLink to a global resource. Now, I don't know why is that happens! I'm deploying in war file, and apparently my context element I put in server.xml isn't mapping resources right: context docBase=ngincare.war debug=0 reloadable=true path=ngincare {Resource+ResourceParam|ResourceLink} /context If you could explain this, it would be just fine! For now I'll use the DefaultContext... thanks, Pedro Salazar On Mon, 2002-12-09 at 16:09, Manavendra Gupta wrote: Hi Pedro, Welcome to the club - there are a number of ppl facing the exact same problem, but are unable to find answer. Do let me know what you did if you find a solution. Manav. -Original Message- From: Pedro Salazar [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 9:12 PM To: Tomcat Users List Subject: RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required! Greetings, Eric, I'm getting a javax.naming.NameNotFoundException: Name jdbc is not bound in this Context exception! I have a resource link inside my context (no resource here or resource-ref in web.xml): resourceLink name=jdbc/ngincaredb global=jdbc/ngincaredb_global type=javax.sql.DataSource / and I'm doing a lookup in my code for jdbc/ngincaredb: Context initCtx = new InitialContext(); Context envCtx = (Context)initCtx.lookup(java:comp/env); this.ds = (DataSource)envCtx.lookup(/jdbc/ngincaredb); So, what's wrong here? thanks, Pedro Salazar. On Mon, 2002-12-09 at 13:06, Roberts, Eric wrote: Pedro, You need javax.sql - that is the package containing DataSource. Your Resource type should be: type=javax.sql.DataSource You need these parameters in addition to url, username and password: parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter In the Context the ResourceLink type should be: type=javax.sql.DataSource You do not need any resource-ref in your web.xml - just use your ResourceLink name as follows: Context ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/{name_of_resource_link}); if (ds != null) { DbCon = ds.getConnection(); } Hope this helps. -- pedro salazar (pt-inovacao) [EMAIL PROTECTED] key id: D803BC61 -- 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] -- pedro salazar (pt-inovacao) [EMAIL PROTECTED] key id: D803BC61 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: New Tomcat Linux User - Unable to compile class for JSP
Hi, It's the tools.jar that exists in j2sdk's lib directory that is missing on your container's lib path. Some containers have it their lib directory structure, some don't. My tomcat standalone version have it, but the tomcat that comes in JBOSS's package (a LE version) don't have it. So if you put it on your servlet container lib directory or put it in jdk's jre's ext directory (by default is on \lib and it isn't in jre\lib\ext) would solve that problem. regards, Pedro Salazar. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
org.apache.jasper.JasperException: Unable to compile class for JSP
I deployed my web application in JBOSS and I got the exception below when tried to access my root application url mapping. I'm using jdk1.4.1 + JBOSS 3.0.4+tomcat4.1.12LE. (I already deployed in J2EE 1.3.1 R.I. in a EAR and it worked fine). thanks, Pedro Salazar. 2002-11-13 17:38:29,810 ERROR [org.jboss.web.localhost.Engine] ErrorDispatcherValve[localhost]: Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/errorpage.jsp] org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:313) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356) at org.apache.catalina.valves.ErrorDispatcherValve.custom(ErrorDispatcherValve.java:391) at org.apache.catalina.valves.ErrorDispatcherValve.throwable(ErrorDispatcherValve.java:250) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:178) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151) at java.lang.Thread.run(Thread.java:536) -- pedro salazar (pt-inovacao) [EMAIL PROTECTED] key id: D803BC61 -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
tomcat 4.0.4, JNDI, Datasource.getConnection() - No suitable driver,[Oracle]
Greetings, I'm moving a webservice from tomcat 4.1.2 (WSDP 1.0) -- tomcat 4.0.4 because I want to go to production environment and instead of using the tomcat bundled with WebServiceDevelopmentPack 1.0 (WSDP 1.0), I want to use a conventional/isolated tomcat. I choose the tomcat 4.0.4 (latest stable version). I added a default context in tomcat isolated service section on conf/server.xml with my jdbc resources, and I deploy my oracle driver package in common/lib/ directory (renamed as a jar file). PROBLEM: -- I'm having problems using a connection manager from JNDI! I'm getting an exception java.sql.SQLException: No suitable driver when I try to get a connection from datasource: ds = (DataSource)initCtx.lookup(java:comp/env/jdbc/crumpetdb); ds.getConnection(); //EXCEPTION!! It appears that tomcat 4.0.4 uses tyrex connection manager (tyrex-0.9.7.0.jar). What is connection manager of tomcat 4.1.2 (WSDP 1.0)? I tried the tyrex's latest version (1.0), but still have the same problem. In tomcat 4.1.2 I didn't have this problem! Please, anyone figures what is my problem? PS. By the way, how to insert a zip file with classes to a tomcat's lib directory but without renaming it to a jar file? What should I change in catalina startup script? thanks, Pedro Salazar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: getSession(true) takes more than 20 seconds????
Well, I shouldn't reply just for thanks, but, the relief you gave me here compels me to do it!, since I'm trying to exhibit (and prove) the Java technology (and other good partnerships as linux) to some people here... Thank you very much! :-) pedro salazar [to all: forgive me this useless and somehow kind of spam in this heavy distribution list] - Original Message - From: Endre Stølsvik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 18, 2001 8:30 AM Subject: Re: getSession(true) takes more than 20 seconds On Tue, 17 Jul 2001, psalazar wrote: | How can it be?? 20 seconds to get (create) a session object?? The first | time I create a session object it takes 20 seconds!! bcoz it uses SecureRandom. It only happens the first time (first getSession()), when the secure stuff initializes. God knows what it's doing, but the next calls to random goes much faster, just try to log in another user, and you'll see. You can, for development sake, use another random class, you set this in tomcat-conf.xml thingy. | | I really, really appreciate any help on this Happy? ;) -- Mvh, Endre
creating a instance of a servlet: takes too long!!
Greetings, why is that my servlet when the first time is invoked, it takes about 30 seconds or more to start when the servlets that came in tomcat are instantaneous? After the servlet container instantiated and initialized my servlet, all the following requests are very fast. Is there any advice for what we should do and don't do in init() method? I just initialize some properties and a connection pool Well is it possible that my servlet container at any time my may shutdown my servlet to release memory, and another time it will be requested to start again and take another time too long to start, correct? How can I benchmark the time of instantiation of my servlet and the time of my init method? System configuration: -Tomcat 3.2.1 -JDK 1.3 -Linux RedHat 6.2 [kernel 2.2.18] -PII400Mhz 256Mbytes thanks. -- psalazar/
SERVLET : transform XSL+XML -OUTPUT = blank page
Greetings, I made a servlet where I try to produce a result to output stream of the response object that came from a transformation of XML + XSL. But, I just get a blank page in output...!? I put the same piece of code that exists in doGet() of my servlet in a isolated test class [but redirecting the output to a file]. I ran it and it works ok... Why my servlet doesn't give nothing to my client?? I put my code below. My servlet runs in the root / of my context. In my servlet, if I put a println of a string, i will saw the string, but just the string... thanks, Pedro Salazar --- SAMPLE ISOLATED --- ... Source xmlSource = null; Source xslSource = null; xmlSource = new javax.xml.transform.stream.StreamSource(login.xml); xslSource = new javax.xml.transform.stream.StreamSource(login.xsl); TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(xslSource); transformer.transform(xmlSource, new StreamResult(new java.io.FileOutputStream(login.out))); ... --- SERVLET doGet() --- ... Source xmlSource = null; Source xslSource = null; PrintWriter out = null; xmlSource = new StreamSource ( getServletContext().getResourceAsStream(/WEB-INF/classes/login.xml)); xslSource = new javax.xml.transform.stream.StreamSource ( getServletContext().getResourceAsStream(/WEB-INF/classes/login.xsl)); Transformer transformer = tFactory.newTransformer(xslSource); response.setContentType(text/html; charset=UTF-8); out = response.getWriter(); transformer.transform(xmlSource, new StreamResult(out)); //out.println(OK); ...
Re: SERVLET : transform XSL+XML -OUTPUT = blank page
Pedro Salazar wrote: Greetings, I made a servlet where I try to produce a result to output stream of the response object that came from a transformation of XML + XSL. But, I just get a blank page in output...!? I put the same piece of code that exists in doGet() of my servlet in a isolated test class [but redirecting the output to a file]. I ran it and it works ok... Why my servlet doesn't give nothing to my client?? I put my code below. My servlet runs in the root / of my context. In my servlet, if I put a println of a string, i will saw the string, but just the string... I just solve my problem... but before,... [remember] -I haven't no exception in servlet, just a blank page; -my isolated class test worked just fine with the output expected; [my test] -I put my classpath in my isolated class test exactly with the same classpath as tomcat gets when it starts. [result] - An exception occurred: javax.xml.transform.TransformerConfigurationException: Namespace not supported by SAXParser [why...] Why there is no exception in servlet? I just don't know!?! [What I did...] -I edited my tomcat.sh script I just after the definition of CLASSPATH, I redefined the CLASSPATH with xerces.jar (the one that came with xalan) in the beginning and the rest after. [what happened...] -Works ok... [conclusions...] -Why there is no exception in servlet since in any exception I write in log and I write to outputstream of response??? -What is the conflict jar of tomcat with xerces.jar, since when I use xerces it works just fine. thanks, Pedro Salazar
open xml/xsl files inside classpath
Greetings, I have a servlet which read some properties (using the ResourceBundle) from a properties file in a package PT.teste.props where exists a relation like this: fileA.xml = file1.xsl fileB.xml = file2.xsl ... Of course getting the properties file is simple task because I just use the location in classpath, ex: rb=ResourceBundle.getBundle(PT.teste.props.+properties_file); But, now I would like to open both files, the xml and the xsl file, which are in a package PT.teste.xml. I tested using the absolute path to them, but is not very recommendable because tomorrow I probably will put it in another location or in another machine... Source xmlSource = new javax.xml.transform.stream.StreamSource (new java.net.URL(file:///opt/jakarta-tomcat-3.2.1/webapps/servlet_teste/WEB-INF/classes/PT/teste/xml/fileA.xml).openStream()); Source xslSource = new javax.xml.transform.stream.StreamSource (new java.net.URL(file:///opt/jakarta-tomcat-3.2.1/webapps/servlet_teste/WEB-INF/classes/PT/teste/xml/file1.xsl).openStream()); Is there a easy way to open a file in a classpath directly? Or at least a way where the path is relative to the web application? A not very recommendable way just to solve my problem is use a path in a properties file which I would read in the init() of servlet... but, I wouldn't like to do it! thanks, Pedro Salazar.
web pages in tomcat context not showing gif images through apache
Greetings, I put apache working with tomcat [mod_jk] and even in the default web pages that come in tomcat where exists gif images, through apache the images don't appear in web pages... For example, http://localhost:8080/admin - acess directly to tomcat, the images come ok http://localhost/admin - the web site appears ok, but images are missing... Well, the more strange is that in my old linux redhat 6.2 with apache 1.3.14 it works fine. In my new release, with redhat 7.0 or 7.1 [with kernel 2.4.x] I have this problem with the same configuration... -- psalazar/
calling other servlets inside a servlet...
Greetings, how can I call another servlet inside a servlet? And I would like to have two options: one is that the servlet called is the final servlet, and the other option is calling a servlet just to get a result (outputstream) o the main servlet and continue processing the main servlet. This is just a servlet question specification or it depends if I'm working on tomcat or other product? thanks, Pedro Salazar.
Re: WAR file behavior and Tomcat 3.2.x
Greetings, I read a document which it tolds that or we put our application already expanded, or by using a WAR file when TOMCAT is started, it will automatically expand the web application archive file into its unpacked form. I didn't know that there was a unpackWARfiles option! Where should I get a manual with all these options documented? thanks... -- psalazar/ - Original Message - From: Darrell Porter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 11, 2001 11:54 PM Subject: RE: WAR file behavior and Tomcat 3.2.x REPOST as I REALLY need help on this... I've read the documentation. I've added the unpackWARfiles=FALSE to my server.xml Why is Tomcat still unpacking the WAR file into the WEBAPPS directory? Should it not simply be unpacking files to WORK as it needs them? I had heard that it was possible to encrypt or password-protect the WAR file but I can find no instructions on configuring Tomcat to access these encrypted files. Any sources? Thanks Darrell Porter Only a man who can not conquer his deficiencies feels the need to convince the world he has none.
Re: How to connect Apache and Tomcat?
I think you must build apache with support for module_so (Dynamid Shared Object). Please, read INSTALL and it explains how to enable mod_so. I just don't tell you exactly what you should do because I don't know what is the option for sure... probably it may be something like this: ./configure --enabled-shared --enable-module=so make make install read the INSTALL and look about the options to use in configure shell script. -- psalazar/ - Original Message - From: Tomeu Bennàssar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 06, 2001 6:31 PM Subject: How to connect Apache and Tomcat? Hi everybody: I'm new in Apache and I'm trying to integrate Tomcat as an in-process servlet container of Apache but I can't. I have a SUN ULTRA 1 running solaris 5.7, Apache 1.3.4 and Tomcat 3.2.2. I'm following the Minimalistic User's Guide of Apache, and I'm trying to compile the Jserv module (mod_jserv) but it doesn't work. When I execute the build command apxs: apxs -c -o mod_jserv.so *.c I get the next error: apxs: Error: Sorry no shared object support for Apache apxs: Error: available under your platform. Make sure apxs: Error: the apache module mod_so is compiled into apxs: Error: your server binary /usr/local/apache/bin/httpd I know that this error is not a compilation one, but I don't know to correct it. Could anyone help me, please? PD: The Apache that I´m running on my system is one that I have found compiled on the web, because after weeks of works i was unable to compile it. Could the fact that I´m using an Apache compiled by someone else be part of the problem?
Re: WAR file behavior and Tomcat 3.2.x
Greetings, I read a document which it tolds that or we put our application already expanded, or by using a WAR file when TOMCAT is started, it will automatically expand the web application archive file into its unpacked form. I didn't know that there was a unpackWARfiles option! Where should I get a manual with all these options documented? thanks... -- psalazar/ - Original Message - From: Darrell Porter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 11, 2001 11:54 PM Subject: RE: WAR file behavior and Tomcat 3.2.x REPOST as I REALLY need help on this... I've read the documentation. I've added the unpackWARfiles=FALSE to my server.xml Why is Tomcat still unpacking the WAR file into the WEBAPPS directory? Should it not simply be unpacking files to WORK as it needs them? I had heard that it was possible to encrypt or password-protect the WAR file but I can find no instructions on configuring Tomcat to access these encrypted files. Any sources? Thanks Darrell Porter Only a man who can not conquer his deficiencies feels the need to convince the world he has none.
Re: How to connect Apache and Tomcat?
I think you must build apache with support for module_so (Dynamid Shared Object). Please, read INSTALL and it explains how to enable mod_so. I just don't tell you exactly what you should do because I don't know what is the option for sure... probably it may be something like this: ./configure --enabled-shared --enable-module=so make make install read the INSTALL and look about the options to use in configure shell script. -- psalazar/ - Original Message - From: Tomeu Bennàssar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 06, 2001 6:31 PM Subject: How to connect Apache and Tomcat? Hi everybody: I'm new in Apache and I'm trying to integrate Tomcat as an in-process servlet container of Apache but I can't. I have a SUN ULTRA 1 running solaris 5.7, Apache 1.3.4 and Tomcat 3.2.2. I'm following the Minimalistic User's Guide of Apache, and I'm trying to compile the Jserv module (mod_jserv) but it doesn't work. When I execute the build command apxs: apxs -c -o mod_jserv.so *.c I get the next error: apxs: Error: Sorry no shared object support for Apache apxs: Error: available under your platform. Make sure apxs: Error: the apache module mod_so is compiled into apxs: Error: your server binary /usr/local/apache/bin/httpd I know that this error is not a compilation one, but I don't know to correct it. Could anyone help me, please? PD: The Apache that I´m running on my system is one that I have found compiled on the web, because after weeks of works i was unable to compile it. Could the fact that I´m using an Apache compiled by someone else be part of the problem?
Re: WAR file behavior and Tomcat 3.2.x [problem replying]
Sorry, I have replied to the list two times because I was getting all my emails delivered with this message: The original message was received at Tue, 12 Jun 2001 05:55:23 -0700 (PDT) from localhost [127.0.0.1] - The following addresses had permanent fatal errors - [EMAIL PROTECTED] (reason: 550 User unknown) - Transcript of session follows - ... while talking to inbound.namezero.com.criticalpath.net.: RCPT To:[EMAIL PROTECTED] 550 User unknown 550 5.1.1 [EMAIL PROTECTED]... User unknown Hope this problem can be solved soon! Sorry for my duplicated messages, again... psalazar/ - Original Message - From: pedro salazar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 12, 2001 3:38 PM Subject: Re: WAR file behavior and Tomcat 3.2.x Greetings, I read a document which it tolds that or we put our application already expanded, or by using a WAR file when TOMCAT is started, it will automatically expand the web application archive file into its unpacked form. I didn't know that there was a unpackWARfiles option! Where should I get a manual with all these options documented? thanks... -- psalazar/ - Original Message - From: Darrell Porter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 11, 2001 11:54 PM Subject: RE: WAR file behavior and Tomcat 3.2.x REPOST as I REALLY need help on this... I've read the documentation. I've added the unpackWARfiles=FALSE to my server.xml Why is Tomcat still unpacking the WAR file into the WEBAPPS directory? Should it not simply be unpacking files to WORK as it needs them? I had heard that it was possible to encrypt or password-protect the WAR file but I can find no instructions on configuring Tomcat to access these encrypted files. Any sources? Thanks Darrell Porter Only a man who can not conquer his deficiencies feels the need to convince the world he has none.
Re: Tomcat/Apache mapping
I think I may have a problem like this one. I have a servlet working fine when I go by using port 8080 [directly to tomcat] that simples write some test to output. When I pick the servlet mapping by apache, it shows me the root of my web directory [the default is show index.html, but there is no index.html because I just want make some output test]. Apparently, the admin context that comes with tomcat works well with apache or tomcat directly. any help will be very appreciated... thx -- psalazar/ - Original Message - From: Robert Slifka [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 12, 2001 4:01 PM Subject: RE: Tomcat/Apache mapping Do you mean that it works when you access it via Tomcat's HTTP port, but not via Apache's? - r -Original Message- From: Ricardo A Bosch [mailto:[EMAIL PROTECTED]] Sent: June 12, 2001 10:57 AM To: [EMAIL PROTECTED] Subject: Tomcat/Apache mapping Hey, I'm having a crap of a time trying to run a servlet from tomcat through apache without having to see the /servlet directory. I've messed with web.xml in my apps WEB-INF and the main tomcat.conf file for apache but I just cant get it to work. Someone must know this is easy, I just dont understand the apache files well enough maybe. I've gotten the servlet to work out of the tomcat directory but not throught apache. i have /myapp/servlets/myServlet to work (no sweat) /myapp/myServlet works too but only from the tomcat port. i want /myapp/myServlet from apache but HOW thanks(); in advance rick
starting in a default servlet
Greetings, I configured tomcat to when I start my application to run a default servlet [url-pattern is /]: in web.xml: servlet-mapping servlet-name servlet1 /servlet-name url-pattern / /url-pattern /servlet-mapping When I go to http://myserver:8080/myapp/ my servlet starts as expected. Now I would like to do the samething but with apache (without the 8080 port). But, apache assumes that the root application is only for him to handle, and only /myapp/servlet/* or /myapp/*.jsp is for TOMCAT to handle [JkMount]. What is happening is that apache shows the root of myapp!! JkMount: JkMount /myapp/servlet/* ajp13 JkMount /myapp/*.jsp ajp13 What should I do for when I request http:/myserver/myapp/ apache redirect the request to tomcat? thx -- psalazar/
make ajp13 as the default worker
Greetings, I installed recently the mod_jk on my tomcat/apache system. I include in my httpd.conf the tomcat/conf/mod_jk.conf-auto that is automatic generated when the tomcat starts. The default JkMount entries in mod_jk.conf-auto use always the ajp12 worker. If I want to use the ajp13 I must replace all the ajp12 entries with ajp13, and only after that I can start apache. How should I modify my server.xml or web.xml to use by default [I mean that the mod_jk.conf-auto reflects always those changes] the ajp13? I just can't remove the ajp12 because tomcat needs it for shutdown... system configuration: Tomcat 3.2.1 + Apache 1.3.14 on Linux Redhat 6.2 [kernel 2.2.18] thanks. -- ./psalazar
Re: make ajp13 as the default worker [new question]
Rui M . Silva Seabra wrote: Have you not read my email? DO NOT USE mod_jk.conf-auto Look into it, learn the flags you need to use, and change accordingly. You do not need to change server.xml or web.xml for that. It's a problem with the generation of mod_jk.conf-auto. On another note: you do not, I repeat... you do NOT ever need to restart apache because of shutting down or starting up tomcat. that would only be needed if you insist on using mod_jk.conf-auto (which is evil) and constantly make changes to the servlets server configuration. I am trying to get time to make a tomcat howto that's a little more explicit than the docs on the web page for begginners. I hope I have time to do it. Well, I didn't read any email yours, I just subscribed the list yesterday... But, now I have a question about use or not use the mod_jk.conf-auto... - If I'm using a copy of a modified version of mod_jk.conf-auto (say mod_jk.conf-mycopy), and if I add a new context in server.xml, then I must restart tomcat, pick up the new context from the mod_jk.conf-auto with all his properties to mod_jk.conf-mycopy, change the entry ajp12 to ajp13, and then restart apache because the httpd.conf that apache gots when it started includes a older version of mod_jk.conf-mycopy. Is this the right procedure? thanks, psalazar