Is there a clean way to add Custom protocol endpoint to tomcat 5.5
Hi all, I need to have my tomcat servers to broadcast their state (custom information) in order to collaborate. I look into the cluster code, org.apache.catalina.cluster.mcast.* it a good example of what I need : send a multicast message each X seconds and keep a member list with their public info. My problem is to fin a way to starts MY protocol endpoint when Tomcat boots. I don't want to put the code in my webApp, since I can have several webapps on the same server. I looked into server.xml to find a way to starts it... I tought Connector would be suitable for my needs but it seems strictly related to HTTP request handling. I hope to find a way without changing the tomcat code base. Thanks for your help. Best Regards /David P.S.: tought the dev list is the place for this kind of question. Sorry if this mail should have been posted on the user list. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Creating a context and deploying a new application on the fly. I tried but haven`t succeed please help :-)
Hi, I want my tomcat have war unpacked on the disk. The application will only be deployed when it receives a message... I tried with the following code without success. My biggest problem for now is how to specify info for the jdbc connection. StandardContext context = new StandardContext(); context.setDocBase("F:\\projects\\applicationServer\\var\\deploy\\base"); context.setPath("/as2"); context.setCrossContext(true); context.setReloadable(false); ContextResource resource = new ContextResource(); resource.setName("jdbc/reference"); resource.setAuth("Container"); resource.setType("javax.sql.DataSource"); resource.setProperty("driverClassName", "org.postgresql.Driver"); resource.setProperty("url", "jdbc:postgresql://127.0.0.1:5432/unikommerce"); resource.setProperty("username", "admin"); resource.setProperty("password", "admin"); resource.setProperty("maxActive", "25"); resource.setProperty("maxIdle", "10"); resource.setProperty("maxWait", "-1"); //context.getApplicationLifecycleListeners().get //resource.set; /* type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://127.0.0.1:5432/unikommerce" username="admin" password="admin" maxActive="25" maxIdle="10" maxWait="-1"/> */ ContextConfig contextConfig = new ContextConfig(); context.addLifecycleListener(contextConfig); //NamingContextListener l = new NamingContextListener(); //l.addResource(resource); //contextConfig.setDefaultContextXml(); //container.setManager(); container.addChild(context); So far the application get deployed but fail because the JDBC resource is not available. Any help on how to do this will be greatly appreciated ! Thanks best regards /David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating a context and deploying a new application on the fly. I tried but haven`t succeed please help :-)
Hi! :-) My problem it that I don`t know at boot time how much applications I will need. I want a sample web app and deploy it on X different context (/as1, /as2). So I would like to have a simple application (exploded war directory) and deploy it X time usinng each time a different Resource (to connect to a different database). So I cannot write (or think I cannot) a context.xml file neither I can specify a context in server.xml. ... I will look again into JMX, HTML or ant interface to see if I cannot find any Idea. Best Regards /David Shapira wrote: Hola, Why not just set autoDeploy="false" on your Host in server.xml, put your webapp in the appBase directory like you normally would, and use the manager interface (JMX, HTML, ant, your choice) to send the deploy command? That way you don't have to write any code... Yoav On 5/18/06, David Gagnon <[EMAIL PROTECTED]> wrote: Hi, I want my tomcat have war unpacked on the disk. The application will only be deployed when it receives a message... I tried with the following code without success. My biggest problem for now is how to specify info for the jdbc connection. StandardContext context = new StandardContext(); context.setDocBase("F:\\projects\\applicationServer\\var\\deploy\\base"); context.setPath("/as2"); context.setCrossContext(true); context.setReloadable(false); ContextResource resource = new ContextResource(); resource.setName("jdbc/reference"); resource.setAuth("Container"); resource.setType("javax.sql.DataSource"); resource.setProperty("driverClassName", "org.postgresql.Driver"); resource.setProperty("url", "jdbc:postgresql://127.0.0.1:5432/unikommerce"); resource.setProperty("username", "admin"); resource.setProperty("password", "admin"); resource.setProperty("maxActive", "25"); resource.setProperty("maxIdle", "10"); resource.setProperty("maxWait", "-1"); //context.getApplicationLifecycleListeners().get //resource.set; /* */ ContextConfig contextConfig = new ContextConfig(); context.addLifecycleListener(contextConfig); //NamingContextListener l = new NamingContextListener(); //l.addResource(resource); //contextConfig.setDefaultContextXml(); //container.setManager(); container.addChild(context); So far the application get deployed but fail because the JDBC resource is not available. Any help on how to do this will be greatly appreciated ! Thanks best regards /David - 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]
Bug + Patch on StandardPipeline.removeValve(Valve valve) for T5.5.16+
Hi all, I run into this problem with T5 when tring to add/remove/add a valve to the standard engine. -For what I understand an empty pipeline has: basic = StandardEngineValve (For example); first = null; -If you add a valve you will get basic = StandardEngineValve first = myValve (with myValve.next = StandardEngineValve) -If you remove the valve you will get basic =StandardEngineValve first = StandardEngineValve Note that StandardEngineValve is in first too here. -If I try to add a new valve given the actual code in addValve the valve will not be added because (see the **) current = basic and current.getNext() = null; addValve(Valve valve) { // Add this Valve to the set associated with this Pipeline if (first == null) { first = valve; valve.setNext(basic); } else { Valve current = first; while (current != null) { **if (current.getNext() == basic) { current.setNext(valve); valve.setNext(basic); break; } current = current.getNext(); } } } PATCH: For what I understand the right patch will be in the removeValve method. We need to remove the basic valve when that the only one in the pipeline: public void removeValve(Valve valve) { Valve current; if(first == valve) { first = first.getNext(); current = null; } else { current = first; } while (current != null) { if (current.getNext() == valve) { current.setNext(valve.getNext()); break; } current = current.getNext(); } // PATCH: Empty the pipeline if only the basic valve is there if (first == basic) first == null; if (valve instanceof Contained) ((Contained) valve).setContainer(null); // Stop this valve if necessary if (started) { if (valve instanceof Lifecycle) { try { ((Lifecycle) valve).stop(); } catch (LifecycleException e) { log.error("StandardPipeline.removeValve: stop: ", e); } } // Unregister the removed valave unregisterValve(valve); } } Hope that oki. I look the 5.5.17 code and the problem is still there. Is that the right way to submit a Patch. If I need to open a bug directly, let me know Best Regard /David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [VOTE] Time for 4.1.32?: I think Bug 39769 applies to T4 4.1.31 too..
Hi, I just opened Bug 39769 yesterday agains T5.5 but I looked into the code this morning and it's in T4.1.31 too. It's quite simple to fix but maybe it should be in 4.1.32 too? Best Regards /David Mark Thomas wrote: All, Having just closed the last open bug for 4.1.x (only enhancement requests left) now seems like a good time for a 4.1.32 release. I am volunteering to be the release manager and given the discussions on voting at the time of the last 5.5.x release, I am proposing the following: - vote to release the current 4.1.x trunk as 4.1.32-beta - 2 weeks for testing - stability vote As usual, only committer votes are binding but everyone's input is welcome. Given that it is the weekend, I intend letting this vote run a little longer than usual until close of play Wednesday 14 June 2006. [ ] +1 I am in favour of a 4.1.32-beta release [ ] +0 I don't mind [ ] -1 I am against a 4.1.32-beta release because ... Mark - 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]