Re: mod_jk dynamic update of workers.properties
On Fri, 4 Feb 2005 17:25:58 +0100, Olve Hansen [EMAIL PROTECTED] wrote: Haven't found docs about this anywher (i might be short sighted though). Can mod_jk dynamically update the contents of workers.properties? Or do I have to use mod_jk2 to be able to do that.. Nevermind (not that too many did mind :-) ) The graceful shutdown of server nodes is too complicated in mod_jk - I'll take the gamble (as it is officially unsopported), and go for mod_jk2... -- \ Olve S. Hansen \ mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fw: can't deploy Cocoon DependencyCheck Failed
- Original Message - From: Tom Sparks [EMAIL PROTECTED] To: users@cocoon.apache.org Sent: Saturday, February 05, 2005 1:40 PM Subject: can't deploy Cocoon DependencyCheck Failed help me Can't deploy Cocoon on tomcat 5.5 5/02/2005 13:12:18 org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' 5/02/2005 13:12:41 org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive cocoon.war 5/02/2005 13:12:49 org.apache.catalina.core.StandardContext start SEVERE: Error in dependencyCheck java.util.zip.ZipException: invalid entry size (expected 2472738816 but got 48 bytes) at java.util.zip.ZipInputStream.readEnd(Unknown Source) at java.util.zip.ZipInputStream.read(Unknown Source) at java.util.jar.JarInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read1(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at java.util.jar.JarInputStream.getBytes(Unknown Source) at java.util.jar.JarInputStream.init(Unknown Source) at java.util.jar.JarInputStream.init(Unknown Source) at org.apache.catalina.util.ExtensionValidator.getManifest(ExtensionValidator.java:368) at org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:187) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3942) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:800) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:497) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1183) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(Unknown Source) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(Unknown Source) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1377) at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:213) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) 5/02/2005 13:12:49 org.apache.catalina.core.StandardContext start SEVERE: Error getConfigured 5/02/2005 13:12:49 org.apache.catalina.core.StandardContext start SEVERE: Context startup failed due to previous errors 5/02/2005 13:12:49 org.apache.catalina.core.StandardContext start SEVERE: Exception during cleanup after start failed LifecycleException: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cocoon] has not been started at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4231) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4101) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at
AW: AW: certificate question for 2 domains pointing to same website
Hi Wait a second...Tomcat will determine which cert to send down based upon the IP address that the browser went to? I guess that makes sense...so does the web server never get to see what domain the browser was looking up to come to the site, or is that info available? That info is available, but already encrypted. I'm just trying to figure out if there's a way to run the website for a limited time with 2 domains and 2 certs--I mean, the 2 domains, each with their own cert, but with one single public IP address. One single public IP will NOT work. Forget it. We have a bigIP load balancer in front of our Tomcat servers...so do our Tomcat servers still see the public IP address that was used to reach them? I think not, but I dunno. I ask because those boxes only have private IPs, and the load balancer has the only public IP. If there's no way to do it, then I guess we just arbitrarily switch at some point and don't worry about the people using the old domain seeing invalid certificate messages... You'll need to. What happens with https is: a) The client get's the ip for the domain by dns lookup. b) The client connects to that ip and immediately get's the server's cert. c) The client encrypts the page request (including headers and a one time key) and sends this encryped. d) The server decrypts that request. (it know's the private key of the cert sent in b.) e) The server sends the response encrypted with the one time key of c. f) The lcient decrypts the response. (it know's the one time key send in c.) Basically the server sees the ip the client connects to and must supply a cert. Only after step d, when the server decrypted the request, it knows about the domain name. You see, no change to go with two certs. HOWEVER, for x509 email-certs extensions where developed which allow more then one address per cert. Maybe there are extensions for Server-certs that allow more then one domain name. If you get two domain names in one cert, you shoud be ready to go. Additionally newer versions of SSL/TLS support other kinds of authentication algorithms that are designed to allow more then one cert per ip. Exspecially they transmit domain names before they transmit the cert. Regards, Steffen smime.p7s Description: S/MIME cryptographic signature
Re: Problem in war deployment
Hi Doug! I think eilnet.xml IS the context.xml file you mentioned! To Manoj: As Dough said, try the following: 1) Remove eilnet.xml from .../conf/{engine}/manoj.eilnet.effectsoft.local 2) Rename eilnet.xml to context.xml 3) Put it into your war-file (into the manifest directory) Make sure context.xml is configured correctly and that your context is not configured twice (e.g. in server.xml)! Best regards, Tex Parsons Technical Services wrote: Is there a reason you are using an external eilnet.xml with a war file? Do you have a context.xml in the war file? Are you sure the app is not running? If you find it is then Tomcat is trying to deploy it twice. There are some notes in the docs on this. Post the eilnet.xml and the context.xml(if exists). Also post the server.xml. Sounds like Tomcat is trying to deploy the app from the war file but the path info in the context element is wrong. Off the wall guess. Need to see the files. Doug - Original Message - From: [EMAIL PROTECTED] To: tomcat-user@jakarta.apache.org Sent: Thursday, February 03, 2005 7:44 AM Subject: Problem in war deployment Hello all!, I am deploying my web application on tomcat5.0.27 using war. It is working fine when I deploy it first time. When I restart the tomcat it is unable to deploy the web application. I am using deployOnStartup = true in server.xml, according to the specification it should reploy it automatically. I am keeping eilnet.xml (eilnet is application name) and manager.xml file in $CATALINA_HOME/CONF/{ENGINE}/manoj.eilnet.effectsoft.local directory and war file is in /srv/vhosts/name/manoj.eilnet.effectsoft.local/webapps directory. It displays the following message, if some one knows the solution, please let us know : 2005-02-03 10:32:11 StandardContext[/manager]Manager: install: Installing web application at '/eilnet' from 'file:///vhome/manoj/vhosts/eilnet/webapps/eilnet.war' 2005-02-03 11:04:26 Have created expansion directory /srv/vhosts/name/manoj.eilnet.effectsoft.local/webapps/eilnet 2005-02-03 11:04:26 StandardHost[manoj.eilnet.effectsoft.local]: Error deploying application at context path null java.util.zip.ZipException: No such file or directory at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540) at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566) at org.apache.commons.digester.Digester.startElement(Digester.java:1276) at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:65) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 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(StandardHostDeployer.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) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at
Re: Tomcat 5.5.4/Windows 2000 server - Failed to register in JMX: BasicDataSourceFactory
Hi Greg, hi David! Sure, there is anoter factory you could use: The tomcat-built-in datasource factory. Unfortunately I do not know the classname of this factory, but I think it is somewhere in the library naming-factory-dbcp.jar which is located in common/lib. (The Tomcat-guys didn't want to add the complete jakarta-commons-pool and jakarta-commons-dbcp libraries because most of the classes inside these libraries are not needed by tomcat. So they extracted the required classes only and repacked them thogether with some other classes into naming-factory-dbcp.jar. To avoid confusions and errors, they also modified the package names - thats why you get a ClassNotFoundException when you configure the JNDI-context to use the org.apache.commons.dbcp.BasicDataSourceFactory). But I'm not sure if it is a good idea to extend one of those tomcat-internal datasource factories! This would REALLY tie your code close to tomcat! Apart from that: If you implement/extend an existing DataSource factory, you have to put your implementation inside the common/classes directory - otherwise tomcat won't find it when it initializes the JNDI-context! So why not put the commons-pool and commons-dbcp jars into common/lib too? So my suggestion: Extend BasicDataSourceFactory from commons-dbcp and put the two jars mentioned above into common/lib. Best regards, Tex Greg Guerin schrieb: Hi David, Mario, We actually specify the factory parameter because we extend the BasicDataSourceFactory so we can encrypt passwords in the resource definition. My question is: Is there already a way to do that using another factory I'm unaware of? It works fine, but we have to include the jars that Mario mentioned and it'd be nice to not have to tie our code that close to the container. Greg -Original Message- From: Mario Winterer [mailto:[EMAIL PROTECTED] Sent: Thursday, February 03, 2005 4:37 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.4/Windows 2000 server - Failed to register in JMX: BasicDataSourceFactory Hi David! I think, you do not need to explicitely define a bean factory because Tomcat 5 automatically uses dbcp for JNDI-DataSources (I think tomcat looks at the type of resource - in your case a javax.sql.DataSource - and uses the tomcat-internal dbcp-factory). In my project, I've configured a JNDI-DataSource using the Oracle thin driver and it works perfectly without specifying a bean factory and without adding any special libraries to my tomcat installation (apart from the oracle database driver which is in commons/lib). So try the following configuration: Resource name=jdbc/as400 auth=Container type=javax.sql.DataSource maxActive=20 maxIdle=10 maxWait=-1 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true driverClassName=com.ibm.as400.access.AS400JDBCDriver url=jdbc:as400://a53pb3;naming=system;libraries=,pgmdbt,caelib;errors=full username=userid password=password / Again: You do not need any additional commons-libraries! Best regards, Tex Hi Mario, Thanks for getting back to me. Below is the context I set up. After doing my own digging, I realized I was missing some jakarta commons jar files. After getting these jars and restarting Tomcat the ClassNotFoundExceptions went away. What I find really puzzling though is why I didn't get the same ClassNotFoundException on my local machine that was running the same version of Tomcat but on Windows XP profession. Context debug=0 privileged=true !-- the jdbc driver's jar needs to go into $CATALINA_HOME/common/lib -- Resource name=jdbc/as400 auth=Container type=javax.sql.DataSource factory=org.apache.commons.dbcp.BasicDataSourceFactory maxActive=20 maxIdle=10 maxWait=-1 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true driverClassName=com.ibm.as400.access.AS400JDBCDriver url=jdbc:as400://a53pb3;naming=system;libraries=,pgmdbt,caelib;errors=full username=userid password=password/ /Context Mario Winterer [EMAIL PROTECTED] 02/02/2005 07:19 PM Please respond to Tomcat Users List tomcat-user@jakarta.apache.org To Tomcat Users List tomcat-user@jakarta.apache.org cc Subject Re: Tomcat 5.5.4/Windows 2000 server - Failed to register in JMX: BasicDataSourceFactory Hi! How did you define your JDBC DataSource? As far as I know, the original jakarta-commons-dbcp and jakarta-commons-pool-libraries are not included with Tomcat. Instead, just a subset of the required classes with modified package names (starting with 'org.apache.tomcat.dbcp') are packed in 'naming-factory-dbcp.jar' that can be found in commons/lib. But if you configure your JDBC DataSource correctly, this should not bother. Please post your resource-configuration! Best regards, Tex I'm running Tomcat 5.5.4 on Windows 2000 Server and encountered the
Re: Updating running WARs?
On Fri, 04 Feb 2005 17:45:12 -0600, Jonathan Wilson [EMAIL PROTECTED] wrote: Someone else will be able to attest to this better than I, but there is a known issue with the classloader [I think] that doesn't release memory on a undeploy..eventually you'll run out of memory after a certain number of deploy/undeploys. You could try using the jvm's -Xmx modifier in your startup/catalina shell, which may buy you more time[guru input here, please]... Do you mean this ? http://issues.apache.org/bugzilla/show_bug.cgi?id=26135 It turned out to be a JDK feature ;) But my app starts up lightweight so I can schedule downtime a couple of hours or so in advance, then drop tomcat for a few minutes while I deploy manually. Maybe you could use the Manager: Stop the Service, undeploy, stop TC, start TC, deploy the service using the Manager, start service if necessary. It is indeed difficult to guarantee that everything will be cleaned up, unless the application is reasonably well written. In case of issues like usage of the bean instrospector as mentioned above, some explicit cleanup is required (now done automatically by Tomcat, but this will only be in the next release). See the bug report for info on workarounds. -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: virtualhost and deployment applications
Hi! I think, there's something wrong with your context-definition or server.xml. Make sure each of your hosts have a webapplication base directory for their own!!! Do not use one single webapps-directory for all of your hosts! My directory structure looks as follows: somewhere/Tomcat/hosts/host/web-application Inside server.xml, where the hosts are defined, each host's appBase-attribute points to the correspoding host-directory. Apart from that: If your tomcat's auto-deploy feature is activated, you can deploy a web-application by simply copying the war file into your webapps-directory (or any other directory that you specified in server.xml). Best regards, Tex Carlos Gabriel Arce wrote: But when I deploy a local .war in the administration page www.domain1.com/manager/html this war gets replicated in other virtualhosts. Mario Winterer escribió: Of course! That's Tomcat's default behaviour - and in fact, it is difficult to make it behave different! Have a look at server.xml of your tomcat's default installation (you need a host-element for each virtual host). More information can be found at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/index.html. Best regards, Tex Carlos Gabriel Arce schrieb: Good Day I have a question. Is possible deploy an application per virtualhost, where the deployed applications per virtualhost could'nt see them each other? Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reload webapp on runtime
Hei there, I'm recompiling one of my classes during runtime, but the problem is that my webapp still uses the old classes from the cache or classloader or whatever. Is there any way to avoid this caching of the classes or to reload my webapp or just this one recompiled class during runtime? This Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Diagnosing tomcat problems
Hello I'm running a tomcat 5.5.4 server with sun jdk1.5 update 1, on a RH enterprise linux 3.0 (with 2.4.21 kernel). The server processes about 20-30 requests per second, most of which include a database query (to a postgresql DB). The configuration I'm using is: JAVA_OPTS='-Dbuild.compiler.emacs=true -Xmx240m -Xms240m -Xmn60m -server -XX:+UseParallelGC' LD_ASSUME_KERNEL=2.2.5 (the problems occur with or without the -XX:+UseParallelGC switch) The problem I have is that approximately every 3 days the server stops processing requests. The only trace that is left in the logs is the following exception (which seems to be totally non-related but for some reason always occurs on such a hang): java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2190) at org.apache.catalina.connector.Request.getSession(Request.java:2012) And my automatic script for checking if the server is alive tries to restart it (with shutdown -force), which doesn't work (it doesn't kill the server for some reason and it keeps hogging the listen port and not processing requests) - so I switched to 'killall -9 java'. This does not seem to be a out-of-memory problem - I had those with tomcat 4.x, java 1.4.2 and the same webapp - and after I moved to tomcat 5.5 and java 1.5 those problems ceased - so this suggests that the webapp is OK at least memory-wise. But now this one came up. So I'm wondering how to diagnose this problem and figure out what is going wrong. The catalina.log files seem to be missing in tomcat 5.5 and that could perhaps give me some more hints than the IllegalStateException from the catalina.out logfile. Can you give me some hints what this problem could be caused by? Or perhaps ideas how to figure out what is going wrong? I've noticed in tomcat docs that I can list the worker threads using the jmxproxy in the manager webapp - but I can't really decipher the output - maybe that would give me some info on why it stops responding. Maybe I'm the one causing the problem - by some deadlock in my webapp stopping the threads one by one (which is unlikely but possible). I also diagnosed the webapp using sun's jvmstat, but that just showed that the webapp is running fine and there is enough memory and GC is taking only a small fraction of running time.. Thanks, Wojtek This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CSS mime-type vs Netscape 7 and Firefox 1
I have added the mime-type for css in Tomcat 3s conf/web.xml file as so: mime-mapping extensioncss/extension mime-typetext/css/mime-type /mime-mapping using the same format as the rest of the file and as TOmcat 4. Yet the server serves the linked css files as text/plain. Why? What can I do about this. The page only breaks in Netscape 7 (6 also I presume) and Firefox, but FF is a target broswer for my project. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Restart-On-Failure for Tomcat?
Hi, I'm supporting a web application running on Apache (2.0x) /Tomcat(5.0.x) w/ mod-jk. The web application seems to cause Tomcat (5.0.28) to fail on average once a week. Restarting tomcat tends to do the trick, however this is in a production enviornment. I've been looking for a restart-on-failure script or inherent feature in Tomcat that can perform this. Please forward me information on how to monitor Tomcat for error conditions and restart the application. Thanks! Robert [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Finer Control than CATALINA_BASE
Is there a way to specify another $CATALINA_BASE/shared/lib ? I found the -config /path/to/server.xml opt which is nice. But I would like to have more fine grain control over where everything is, not just specifying a CATALINA_BASE. Another quick question, can you specify another classpath instead of WEB-INF/classes, that if it changes the app automatically gets reloaded? Thanks for your help - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HTTPS: more than one certificate
Hi! Just because I'm interested: If I had more than one certificate in my keystore, which certificate would be used by tomcat for https? Is there a way to specify which certificate to use? Thanks, Tex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
order of creation of JNDI datasource from context.xml and Filter.init() using it
Hello, My problem is so basic that I have no doubt other people have experienced it. Still, I can't find any solutions on the web. I want Tomcat to provide my webapp with DataSources through JNDI. I want Hibernate to use these DataSources. Nothing exciting so far. I configured the BasicDataSourceFactory in the META-INF/context.xml like this: Resource name=jdbc/mydb auth=Container driverClassName=org.postgresql.Driver factory=org.apache.commons.dbcp.BasicDataSourceFactory username=* password=* type=javax.sql.Datasource url=jdbc:postgresql://localhost:5432/mywebapp scope=Shareable maxActive=10 maxIdle=100 maxWait=3000 / In the web.xml I put: filter filter-nameHibernateSessionFilter/filter-name filter-classnl.kransen.mywebapp.context.HibernateSessionFilter/filter-class /filter filter-mapping filter-nameHibernateSessionFilter/filter-name url-pattern/*/url-pattern /filter-mapping ... resource-ref descriptionMy database/description res-ref-namejdbc/mydb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref In the hibernate.cfg.xml I make a JNDI reference to the datasource: hibernate-configuration session-factory property name=connection.datasourcejava:comp/env/jdbc/mydb/property property name=dialectnet.sf.hibernate.dialect.PostgreSQLDialect/property property name=show_sqltrue/property mapping resource=hibernate-mappings/Aap.hbm.xml / mapping resource=hibernate-mappings/Noot.hbm.xml / mapping resource=hibernate-mappings/Mies.hbm.xml / /session-factory /hibernate-configuration Now I created a HibernateSessionFilter that will filter any request to the webapp and provide it with a Hibernate Session. In the init() the Hibernate SessionFactory is configured by doing a lookup on JNDI for a DataSource. My problem is that Hibernate can't find the JNDI datasource: 17:44:14,745 INFO [nl.kransen.mywebapp.context.HibernateSessionFilter] Failed to initialize Hibernate! net.sf.hibernate.HibernateException: Could not find datasource: java:comp/env/jdbc/mydb Instead, I tried to put the Datasource in the GlobalNamingResources/ of the server.xml. In the context.xml I put: ResourceLink name=My Database global=jdbc/mydb type=javax.sql.Datasource / The error I get then is: 20:31:09,550 WARN [net.sf.hibernate.cfg.SettingsFactory] Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) Instead of initializing the Hibernate SessionFactory in the Filter's init() method, I do it the first time the doFilter() is called. Then I get a similar error: 20:42:35,324 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] Cannot open connection org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) ... Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59) at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:289) ... 54 more Caused by: java.lang.NullPointerException at java.util.StringTokenizer.init(StringTokenizer.java:182) at org.postgresql.Driver.parseURL(Driver.java:251) at org.postgresql.Driver.acceptsURL(Driver.java:159) at java.sql.DriverManager.getDriver(DriverManager.java:232) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773) What I really want is the first solution with the JNDI datasource declaration in the webapp context.xml, and preferably initialization of Hibernate in the init() of the Filter. Is it possible that the reason that it doesn't work is that the Filter is first created (and its init() called) BEFORE the DatasourceFactory is created and bound to JNDI? If that is the case, wouldn't it make more sense to turn that around? After all, it's the CONTEXT.xml :-) The second and third structures brought me closer, but why does the Postgresql driver think that URL 'null' was passed, when I put a correct URL in the config? I hope anyone can help me. Jeroen Kransen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: order of creation of JNDI datasource from context.xml and Filter.init() using it
Try not specifying the factory parameter. It isn't required anyway by Tomcat-5.5.x. Tomcat-5.5.x uses its own version of commons-dbcp, so if you are specifying org.apache.commons.dbcp.BasicDataSourceFactory, that is probably not the one that Tomcat wants to use internally. I think they wrapped up the package into their own, such as maybe org.apache.tomcat.commons.dbcp.BasicDataSourceFactory (this may not be exact, I just know it is something like this), to avoid version collisions with user-provided commons-dbcp jars. Jake At 09:42 PM 2/5/2005 +0100, you wrote: Hello, My problem is so basic that I have no doubt other people have experienced it. Still, I can't find any solutions on the web. I want Tomcat to provide my webapp with DataSources through JNDI. I want Hibernate to use these DataSources. Nothing exciting so far. I configured the BasicDataSourceFactory in the META-INF/context.xml like this: Resource name=jdbc/mydb auth=Container driverClassName=org.postgresql.Driver factory=org.apache.commons.dbcp.BasicDataSourceFactory username=* password=* type=javax.sql.Datasource url=jdbc:postgresql://localhost:5432/mywebapp scope=Shareable maxActive=10 maxIdle=100 maxWait=3000 / In the web.xml I put: filter filter-nameHibernateSessionFilter/filter-name filter-classnl.kransen.mywebapp.context.HibernateSessionFilter/filter-class /filter filter-mapping filter-nameHibernateSessionFilter/filter-name url-pattern/*/url-pattern /filter-mapping ... resource-ref descriptionMy database/description res-ref-namejdbc/mydb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref In the hibernate.cfg.xml I make a JNDI reference to the datasource: hibernate-configuration session-factory property name=connection.datasourcejava:comp/env/jdbc/mydb/property property name=dialectnet.sf.hibernate.dialect.PostgreSQLDialect/property property name=show_sqltrue/property mapping resource=hibernate-mappings/Aap.hbm.xml / mapping resource=hibernate-mappings/Noot.hbm.xml / mapping resource=hibernate-mappings/Mies.hbm.xml / /session-factory /hibernate-configuration Now I created a HibernateSessionFilter that will filter any request to the webapp and provide it with a Hibernate Session. In the init() the Hibernate SessionFactory is configured by doing a lookup on JNDI for a DataSource. My problem is that Hibernate can't find the JNDI datasource: 17:44:14,745 INFO [nl.kransen.mywebapp.context.HibernateSessionFilter] Failed to initialize Hibernate! net.sf.hibernate.HibernateException: Could not find datasource: java:comp/env/jdbc/mydb Instead, I tried to put the Datasource in the GlobalNamingResources/ of the server.xml. In the context.xml I put: ResourceLink name=My Database global=jdbc/mydb type=javax.sql.Datasource / The error I get then is: 20:31:09,550 WARN [net.sf.hibernate.cfg.SettingsFactory] Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource .java:780) Instead of initializing the Hibernate SessionFactory in the Filter's init() method, I do it the first time the doFilter() is called. Then I get a similar error: 20:42:35,324 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] Cannot open connection org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource .java:780) ... Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource .java:780) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja va:540) at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(Datas ourceConnectionProvider.java:59) at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:289) ... 54 more Caused by: java.lang.NullPointerException at java.util.StringTokenizer.init(StringTokenizer.java:182) at org.postgresql.Driver.parseURL(Driver.java:251) at org.postgresql.Driver.acceptsURL(Driver.java:159) at java.sql.DriverManager.getDriver(DriverManager.java:232) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource .java:773) What I really want is the first solution with the JNDI datasource declaration in the webapp context.xml, and preferably initialization of Hibernate in the init() of the Filter. Is it possible that the reason
Re: order of creation of JNDI datasource from context.xml and Filter.init() using it
Hi Jeroen! Two weeks ago I (almost) exactly did what you want to do - make hibernate use a JNDI-DataSource defined as a GlobalNamingResource! The differences: My database is Oracle and I didn't configure hibernate directly because I use the spring-framework in between. I experienced problems similar than yours, but after cleaning out some old stuff it worked! Unfortunately, I do not know, what exactly the problem was, but I can give you some hints that may help you! Assuming you use Tomcat 5.5, do the following 1) Skip the factory-attribute in your Resource-definition! It is not required because tomcat has a built-in connection pool and automatically uses it for JNDI-DataSources. 2) Define your JNDI-DataSource in the GlobalNamingContext 3) The resourcelink-element in meta-inf/context.xml must specify the name of the global resource (attribute global) AND the name, the resource should have when linked into the lokal JNDI-context (attribute name). This (internal) name must match the name specified in your hibernate config! I guess that's what you got wrong! Your code: ResourceLink name=My Database global=jdbc/mydb type=javax.sql.Datasource / (You specified My Database as internal JNDI-name, but jdbc/mydb in hibernate.cfg.xml!!!) Better: ResourceLink name=jdbc/mydb global=jdbc/mydb type=javax.sql.Datasource / (That matches the name you used in your hibernate.cfg.xml: java:env/jdbc/mydb) 4) Remove the context-definition file in conf/Engine/host. At deployment time, tomcat copies the context.xml file from the meta-inf-directory of your web-application into the conf/Engine/host-directory (and renames it to avoid conflicts). 5) The PostgreSQL-driver must be in common/lib. Make sure it is NOT in WEB-INF/lib too! As I've said in top 3, I think the chief cause of your problem is the resourcelink-element! (Apart from that: I've seen you wrote your own HibernateSessionFilter. I also did that first, but then I decided to use the OpenSessionInViewFilter from the spring-framework instead. It works great! I'm sure your filter-implementation is not the cause of your problems, but maybe the spring-framework is interesting to you!) Best regards, Tex Jeroen Kransen schrieb: Hello, My problem is so basic that I have no doubt other people have experienced it. Still, I can't find any solutions on the web. I want Tomcat to provide my webapp with DataSources through JNDI. I want Hibernate to use these DataSources. Nothing exciting so far. I configured the BasicDataSourceFactory in the META-INF/context.xml like this: Resource name=jdbc/mydb auth=Container driverClassName=org.postgresql.Driver factory=org.apache.commons.dbcp.BasicDataSourceFactory username=* password=* type=javax.sql.Datasource url=jdbc:postgresql://localhost:5432/mywebapp scope=Shareable maxActive=10 maxIdle=100 maxWait=3000 / In the web.xml I put: filter filter-nameHibernateSessionFilter/filter-name filter-classnl.kransen.mywebapp.context.HibernateSessionFilter/filter-class /filter filter-mapping filter-nameHibernateSessionFilter/filter-name url-pattern/*/url-pattern /filter-mapping ... resource-ref descriptionMy database/description res-ref-namejdbc/mydb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref In the hibernate.cfg.xml I make a JNDI reference to the datasource: hibernate-configuration session-factory property name=connection.datasourcejava:comp/env/jdbc/mydb/property property name=dialectnet.sf.hibernate.dialect.PostgreSQLDialect/property property name=show_sqltrue/property mapping resource=hibernate-mappings/Aap.hbm.xml / mapping resource=hibernate-mappings/Noot.hbm.xml / mapping resource=hibernate-mappings/Mies.hbm.xml / /session-factory /hibernate-configuration Now I created a HibernateSessionFilter that will filter any request to the webapp and provide it with a Hibernate Session. In the init() the Hibernate SessionFactory is configured by doing a lookup on JNDI for a DataSource. My problem is that Hibernate can't find the JNDI datasource: 17:44:14,745 INFO [nl.kransen.mywebapp.context.HibernateSessionFilter] Failed to initialize Hibernate! net.sf.hibernate.HibernateException: Could not find datasource: java:comp/env/jdbc/mydb Instead, I tried to put the Datasource in the GlobalNamingResources/ of the server.xml. In the context.xml I put: ResourceLink name=My Database global=jdbc/mydb type=javax.sql.Datasource / The error I get then is: 20:31:09,550 WARN [net.sf.hibernate.cfg.SettingsFactory] Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) Instead of
Re: Finer Control than CATALINA_BASE
In tomcat 5 - look at conf/catalina.properties. You are allowed to add directories (or files) to the common, shared, and server classloaders. As for WEB-INF/classes - that cannot be changed. But in tomcat 5.5 - there is a concept called watched resources which will tell tomcat what resources to look for timestamp changes in to signify a webapp needs reloaded. -Tim Joseph Toth wrote: Is there a way to specify another $CATALINA_BASE/shared/lib ? I found the -config /path/to/server.xml opt which is nice. But I would like to have more fine grain control over where everything is, not just specifying a CATALINA_BASE. Another quick question, can you specify another classpath instead of WEB-INF/classes, that if it changes the app automatically gets reloaded? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Java.lang.ClassNotFoundException: listeners.ContextListener
Hello, When my Tomcat 5 server is started, it gets a SEVERE error in the output which states: SEVERE: Error configuring application listener of class listeners.ContextListener Java.lang.ClassNotFoundException: listeners.ContextListener SEVERE: Error configuring application listener of class listerners.SessionListener Java.lang.ClassNotFoundException: listeners.SessionListener SEVERE: Skipped installing application listeners due to previous error(s). Can anyone help with why this is occurring everytime I start the Tomcat 5 server. Thanks in advance, Harry
Servlet not displaying correctly HTML output.
Hello, I have installed Apache 2.0.51 and tomcat 4.1.31 in my Fedora 2 server. I'm using mod_jk2 to connect Apache and Tomcat. I have this web application that I have installed under the webapps directory called: store.war I've added the context descriptor in the server.xml and the application works fine if I use the 8080 port. ie. http://localhost:8080/store However when I try to run the application without specifying the 8080 port. ie. http://localhost/store, the servlets do not display the formatted HTML output, but rather the HTML output itself. I've modified the workers2.properties file to reflect the new application. Since I'm able to run the application under tomcat without any problems. I think my problem lies with the configuration of the workers2.properties file, but I can't find much documentation and I've tried to copy all the entries that I could find for the examples webapp, but it still doesn't work. If anyone knows what I'm missing, please let me know. These are the lines I appended to the end of the workers2.properties file: [uri:/store/*] info=Map the whole webapp The rest of the file is the same as the default. This is a copy of my output when I run the Cart servlet under tomcat ( port 8080 ) Current Cart Contents: Fish1.99 This is a copy of the output when I run the Cart servlet when I use Apache's port 80 h1Current Cart Contents:/h1 table tr tdFish/tdtd1.99/td tr /table Thanks in advance Arturo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DataSourceRealm says Name jdbc is not bound in this Context
Hi All, I'm trying to get container managed authentication going under Tomcat 5.5 using the org.apache.catalina.realm.DataSourceRealm class. I've configured a DataSource using the name jdbc/MindDB and I can access that from within my app, but when the configured DataSourceRealm tries to access it I get javax.naming.NameNotFoundException: Name jdbc is not bound in this Context. My context.xml looks like this: Context path=/mind docBase=D:/Development/Projects/mind/src/webapp debug=5 reloadable=true Resource name=jdbc/MindDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=mind password= driverClassName=org.postgresql.Driver url=jdbc:postgresql://localhost/mind/ Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MindDB userTable=mind_user userNameCol=alias userCredCol=password userRoleTable=mind_user_role roleNameCol=name/ /Context And the relevant section of my web.xml looks like this: ... resource-ref descriptionMind DB Connection/description res-ref-namejdbc/MindDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref ... I've also tried using the full name of java:/comp/env/jdbc/MindDB that works in my code but that just changes my error to javax.naming.NameNotFoundException: Name java: is not bound in this Context. Any help would be greatly appreciated... Cheers, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5 Listener class issue
Hello, When my Tomcat 5 server is started, it gets a SEVERE error in the output which states: SEVERE: Error configuring application listener of class listeners.ContextListener Java.lang.ClassNotFoundException: listeners.ContextListener SEVERE: Error configuring application listener of class listerners.SessionListener Java.lang.ClassNotFoundException: listeners.SessionListener SEVERE: Skipped installing application listeners due to previous error(s). Can anyone help with why this is occurring everytime I start the Tomcat 5 server. Thanks in advance, HD
Re: Restart-On-Failure for Tomcat?
I would suggest either a process monitor or using cron to run script every minute or so that would use wget to get a test page and if it fails, restart tomcat. I've been using the latter of the two with good success for a while. Of course, I'm assuming your using Linux or the like, but if you're on Win then you can set the recovery options under services. I'm not aware of anything inherent in Tomcat. Regards, -Paul Robert McIntosh wrote: Hi, I'm supporting a web application running on Apache (2.0x) /Tomcat(5.0.x) w/ mod-jk. The web application seems to cause Tomcat (5.0.28) to fail on average once a week. Restarting tomcat tends to do the trick, however this is in a production enviornment. I've been looking for a restart-on-failure script or inherent feature in Tomcat that can perform this. Please forward me information on how to monitor Tomcat for error conditions and restart the application. Thanks! Robert [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Support Information Regarding - C0000005
Thank you for emailing Blizzard Entertainments Technical Support Department. In order to provide you with greater assistance, we have developed an automated reply system which evaluates your message and generates a detailed response towards it. Please read through this message as our automated reply system has helped many of our customers. If the response given below does not assist you or it is not relevant towards your message, please reply back to this email and a live technician will respond to you as soon as possible. == Support Information Regarding - C005: == If you are getting the error Unhandled Exception: Access Violation C005: Uninstall and reinstall the game and download and install the latest patch from: (http://www.blizzard.com/patches) If this doesn't work, please try some of our other solutions: For Warcraft III Reign of Chaos: We recommend running in a selective startup to improve performance and stability. Firewall software, such as Zone Alarm, can cause lockups or prevent the game from starting. For instructions on how to run your computer in a selective startup, please visit our site at: (http://www.blizzard.com/support/?id=agn0558p). If the solution above does not help, please try the steps below. Download and install the latest DirectX from (http://www.microsoft.com/windows/directx/default.aspx?url=/windows/directx/downloads/default.htm) Make sure you have the latest drivers for your Video and Sound cards, next. A list of manufacturers with contact information can be found at (http://www.blizzard.com/support/?id=msi0369p). Download and install the latest chipset drivers for your motherboard. Check the motherboard manufacturer's website for updated chipset drivers, first. If you can't find updated drivers at the manufacturer's website, the next two most common locations for chipset drivers are (http://www.viaarena.com/?PageID=2) and (http://www.intel.com/support/chipsets/) If Warcraft III still has errors after updating drivers, download war3.reg from (http://ftp.blizzard.com/pub/war3/other/) and save it to your Windows Desktop. Once the file has been downloaded, double-click on it to import the registry info. This file will set Warcraft III to mute sound, run with the basic settings for video and set the refresh rate for the monitor to 60Hz. Once the game has started, you may select the options menu and adjust the video and sound settings as desired. For StarCraft users: Click on Start. Click on Run. Type regedit and click Ok. Click on the + icon beside the HKey_Local_Machine branch. Click on the + icon beside the Software branch. Select the Battle.net branch and press the delete key. Click on the + icon beside the HKey_Current_User branch. Click on the + icon beside the Software branch. Select the Battle.net branch and press the delete key. For Diablo II and Diablo II: Lord of Destruction: The first step in fixing this problem is to make sure you have the latest patch for the game. You can download the latest patch by going to (http://www.blizzard.com/patches). Next, download and install the latest chipset drivers for your motherboard. Check the motherboard manufacturer's website for updated chipset drivers, first. The two most common locations for chipset drivers are (http://www.viaarena.com/?PageID=2) and (http://www.intel.com/support/chipsets/). The next step if the patch does not work is to play the game in 2D mode if you are currently running in 3D. You can change this setting by re-running the Video Test. To run this test, click on Start, then Programs, then Diablo II and then Video Test. Also, try turning off the Automap as a troubleshooting step. Check your CD-ROM settings using the information provided at the following link: (http://www.blizzard.com/support/?id=mdb0404p) If this error persists, please send us any new D2#.txt and/or D2debug.txt files from the Diablo II folder on your hard drive. This will allow us to better troubleshoot your problem. Finally, you may have noticed that Diablo II causes the computer to work really hard. This is largely due to the many textures that are being used by the game at any given time, especially in 3D modes. Because of this, sometimes users who have this problem do not have trouble with any other programs. Sometimes this error will occur if your computer gets too hot, so anything you can do to lower the operating temperature of your computer might be useful. Lowering the clock speed will lower the operating temperature. You should also make sure that your processor is adequately cooled with a cooling fan and heatsink. Your processor manufacturer has specific recommendations for cooling fans for some of their chips. Please visit us on our Blizzard Entertainment Support site at (http://www.blizzard.com/support/?id=mdt0274p) for our latest solutions to