>
> Magnús Ţór Torfason wrote:
> > If I init Turbine, and then hit the Turbine servlet,
> > BEFORE initialization is finished I get a response
> > containing error 503.
>
> > and get the following error:
> > Error: 503
> > Location: /myapp/servlet/Turbine/redirected/true
> > -1 < 0
>
> We also have experienced internal errors from Tomcat
> occuring on Turbine startup. Usually restarting Tomcat
> another time fixed the problem. I don't know how to
> reliably reproduce this condition.
>
> I suspect that those errors are not related to the
> recent changes, because we have been encoutering
> them for a long time. Any inforomation on the
> reasons of this errors would be precious.
>
> Rafal
>
As I said, I could reproduce this error reliably. The code I
use to fire up my installation is the following:
private MyAppMain() throws Throwable{
// Create a visual console for server configuration
initConsoleWindow();
// Init Turbine
TurbineConfig config = new TurbineConfig(
"../webapps/myapp","/WEB-INF/conf/TurbineResources.properties"
);
Turbine turbine = new Turbine();
turbine.init(config);
// Were ready, let's tell the user
System.out.println( "\n"
+
"------------------------------------------------------------\n"
+ "--- MyApp successfully initialized\n"
+
"------------------------------------------------------------\n"
);
}
This will initialize all the turbine services, one of which may or may not
start tomcat.
If the server is hit AFTER tomcat has started accepting requests,
but BEFORE I get the signal that MyApp is initialized (that
is before Turbine has finished initializing services),
this error will occur, on that request and any subsequent requests.
This is fixable in Turbine by encapsulating all the init() code in
a block that is synchronized(Turbine.class).
This is not a neat solution, but this does bring me to what I said about
services earlier. My first instinct about the init() functions was that
each function was run exactly once, not that each function
may be called at arbitrary times, and that it is my responsibility
to set instance variables.
Further, it seems now clear that the init() calls are not synchronized,
which means that each service needs to implement synchronization,
in a function called init(). It does not seem intuitive to me.
I will not propose the modifications to the Turbine servlet, but
I believe that the only reason I am the only one suffering from this
bug is that I am the only one calling initialization more than once.
I believe that these problems are best solved in the core code for
services, instead of requiring each service to worry about such
matters.
Me rambling. Me stop now.
Magnus
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]