geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan David <jpere...@hotmail.com>
Subject Re: I need a Servlet to be started when the web container is starting
Date Mon, 13 Oct 2008 18:11:47 GMT

Hi David

I think what I need is descrived for you “If you need some code to execute
before your actual apps start you could write a gbean to execute the code
and deploy it in a plugin that depends on the tomcat plugin.  If your apps
depend on this service plugin it is sure to get started before the apps.” I
would just get the code out of the servlet and put on a gbean , what I would
need is a example of the gbean implementation and deployment if there is one
available.

Thank you very much


djencks wrote:
> 
> 
> On Oct 13, 2008, at 9:50 AM, Juan David wrote:
> 
>>
>> Hi All
>>
>> I have a problem to set up a framework application on Geronimo. I  
>> need a
>> Servlet to be started when the web container is starting.
>>
>> As I previously did this configuration on Tomcat y try to add the  
>> Servlet
>> definition on installDir\var\catalina\conf\web.xml and it loads the  
>> Servlet
>> the problem is that the servlet has dependency classes and does not  
>> found
>> them on runtime. I try to add the jar containing the classes to
>> installDir\var\shared\lib and did not work.
>>
>> What is the right way to accomplish this?
>>
>> Is there a default application like in OAS or Tomcat?
>> Do I have to add my own module to Geronimo (If so can you give me some
>> directions?)
>> The stack trace says that the class can not be found on  
>> Tomcat6/2.0.1/car do
>> I have to add the dependence on that module for the dependent jars?  
>> (how can
>> I do that?)
>>
>> Module 14/37 org.apache.geronimo.configs/tomcat6/2.0.1/car
>> 13:59:43,750 ERROR [Digester] End event threw exception
>> java.lang.reflect.InvocationTargetException
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>> ….
>> Caused by:
>> java.lang.RuntimeException:
>> suramericana.swb.environment.InitContainerProperties in classloader
>> org.apache.geronimo.configs/tomcat6/2.0.1/car
>> 	at
>> org 
>> .apache 
>> .geronimo 
>> .tomcat 
>> .GeronimoStandardContext.addChild(GeronimoStandardContext.java:267)
>> 	... 71 more
>> Caused by:
>> java.lang.ClassNotFoundException:
>> suramericana.swb.environment.InitContainerProperties in classloader
>> org.apache.geronimo.configs/tomcat6/2.0.1/car
> 
> What exactly are you trying to accomplish with this servlet?  There  
> may be a better way to do this in geronimo.
> 
> I can't keep track of how tomcat starts.  There might be a default  
> application with a configuration under var/tomcat.
> 
> If this default application actually exists and you decide adding your  
> servlet to it is the best way to proceed then the most controllable  
> way to proceed is to build a replacement tomcat plugin that includes  
> your jar as an additional dependency.  You should upgrade to g. 2.1.3  
> and copy the source plugins/tomcat/tomcat6 module, alter the  
> artifactId, include your jar as a maven dependency, and add an  
> artifact-alias so your tomcat assembly will replace the normal one.
> 
> If you need some code to execute before your actual apps start you  
> could write a gbean to execute the code and deploy it in a plugin that  
> depends on the tomcat plugin.  If your apps depend on this service  
> plugin it is sure to get started before the apps.
> 
> If you need this code to execute before any connectors start you might  
> be able to include it in one of the apps and use the techniques shown  
> in the app-per-port sample to start the connectors after your app.
> 
> thanks
> david jencks
> 
>>
>>
>> Thanks in advance
>>
>> JuanDa
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/I-need-a-Servlet-to-be-started-when-the-web-container-is-starting-tp19958545s134p19958545.html
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/I-need-a-Servlet-to-be-started-when-the-web-container-is-starting-tp19958545s134p19959908.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message