You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Auke Noppe <au...@gmail.com> on 2007/10/17 15:37:57 UTC

custom web.xml digester call

Hi,

 

Is it possible to call the digester of the web.xml by hand?

Like you can override the createstartdigester method in catalina.java?

 

Regards,

 

Auke Noppe


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 16-10-2007
14:14
 

Re: custom web.xml digester call

Posted by Bill Barker <wb...@wilshire.com>.
"Auke Noppe" <au...@gmail.com> wrote in message 
news:000001c810c2$eebb20c0$cc316240$@com...
> Hi,
>
>
>
> Is it possible to call the digester of the web.xml by hand?
>
> Like you can override the createstartdigester method in catalina.java?
>

As the other posters have said, it is difficult to see a use case for this. 
But that isn't a good enough reason to not give you enough rope to hang 
yourself with :).

On the <Host /> element in server.xml you can specify the attribute: 
configClass="com.myfirm.mypackage.MyContextConfig" (if you are running 
Embedded, just call the setConfigClass(String) method on the Host object, or 
set the "configClass" attribute via JMX if you are using JMX embedding). 
For any context under that Host, Tomcat will use an instance of this class 
in place of it's normal ContextConfig class.  It only is required to 
implement LifecycleListener, but if you extend TC's ContextConfig class, 
then you would need to override the method:
  protected static Digester createWebDigester()


>
>
> Regards,
>
>
>
> Auke Noppe
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 
> 16-10-2007
> 14:14
>
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: custom web.xml digester call

Posted by Auke Noppe <au...@gmail.com>.
Hi,

I posted another thread a few days ago, and that was about  an exception
thrown by tomcat. For the record, I am using embedded tomcat.
My company has an web-application which runs best on TC 5.5.xx. they asked
me to develop a framework for testing the compiler speed of tomcat in
relation with their own app. So the result you get is actually the beauty of
the written code. And it is possible to make optimalisations more to the
point.
The idea is to make a instance of tomcat without connector so you don't have
de overhead from sockets etc. and this makes it possible to run multiple
instances concurrently.

The error I get is this one:
SEVERE: Allocate exception for servlet null
javax.servlet.ServletException: No servlet class has been specified for
servlet null
and the rest of the stacktrace.

I found out (I think) that the problem is, that the wrapper isn't
initialized for the servlet asking for.
So TC isn't able to allocate the serlet(of jsp)class requested.

I want to solve this problem to initialize the web.xml by hand, so I can
check whether the servlet classes are found and set.

I hope I made things clear this way. And I sure hope you can give me some
advice/help.

Regards, 

Auke


-----Oorspronkelijk bericht-----
Van: Johnny Kewl [mailto:john@kewlstuff.co.za] 
Verzonden: donderdag 18 oktober 2007 6:50
Aan: Tomcat Users List
Onderwerp: Re: custom web.xml digester call


---------------------------------------------------------------------------
HARBOR: http://coolharbor.100free.com/index.htm
Now Tomcat is also a cool application server
---------------------------------------------------------------------------
----- Original Message ----- 
From: "Auke Noppe" <au...@gmail.com>
To: <us...@tomcat.apache.org>
Sent: Wednesday, October 17, 2007 3:37 PM
Subject: custom web.xml digester call


> Hi,
>
>
>
> Is it possible to call the digester of the web.xml by hand?
>
> Like you can override the createstartdigester method in catalina.java?
> Regards,

It sounds like you doing embedded, and yes I thought very much the same way 
because all the examples call into the embedded routine, and that leaves one

wondering how to do things like set up realms, SSL ... and all the good 
stuff that just happens from config files.

What you can do, its what I did and just forget about embedded and call 
Catalina from your own program based on bootstrap....

Whats cool is that your embedded program then does exactly what TC does, and

you test in TC and then just move the config files to the embedded program.

That works.... so I'm saying instead of trying to jam values in... move up 
even more and just use the same config files... makes life very easy.
Your embedded program will do exactly what TC does... log files are the only

exception.

>
>
>
> Auke Noppe
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 
> 16-10-2007
> 14:14
>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 16-10-2007
14:14
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 16-10-2007
14:14
 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: custom web.xml digester call

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
---------------------------------------------------------------------------
HARBOR: http://coolharbor.100free.com/index.htm
Now Tomcat is also a cool application server
---------------------------------------------------------------------------
----- Original Message ----- 
From: "Auke Noppe" <au...@gmail.com>
To: <us...@tomcat.apache.org>
Sent: Wednesday, October 17, 2007 3:37 PM
Subject: custom web.xml digester call


> Hi,
>
>
>
> Is it possible to call the digester of the web.xml by hand?
>
> Like you can override the createstartdigester method in catalina.java?
> Regards,

It sounds like you doing embedded, and yes I thought very much the same way 
because all the examples call into the embedded routine, and that leaves one 
wondering how to do things like set up realms, SSL ... and all the good 
stuff that just happens from config files.

What you can do, its what I did and just forget about embedded and call 
Catalina from your own program based on bootstrap....

Whats cool is that your embedded program then does exactly what TC does, and 
you test in TC and then just move the config files to the embedded program.

That works.... so I'm saying instead of trying to jam values in... move up 
even more and just use the same config files... makes life very easy.
Your embedded program will do exactly what TC does... log files are the only 
exception.

>
>
>
> Auke Noppe
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 
> 16-10-2007
> 14:14
>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: custom web.xml digester call

Posted by Konstantin Kolinko <kn...@gmail.com>.
> Is it possible to call the digester of the web.xml by hand?

Hmm, I can imagine a couple of ways how I am able to call it, thus it
is theoretically possible.

Why do you need it? Do you need to go that way?

See, that
1. You have not said about your reasons.

2. You have not said about your constraints, environment.

Thus said, to call internal Tomcat classes, you need either to be a
part of Tomcat, or to make them accessible to the webapp classloader.
You should know, how to achieve that.

But beware that:
1) that may conflict with the SecurityManager configuration, if you
are using it. You may need to adjust the policy.
2) your webapp will be Tomcat specific, or even bound to specific
Tomcat release / version.

These are internal classes, not a public API.


Best regards,


2007/10/17, Auke Noppe <au...@gmail.com>:
> Hi,
>
>
>
> Is it possible to call the digester of the web.xml by hand?
>
> Like you can override the createstartdigester method in catalina.java?
>
>
>
> Regards,
>
>
>
> Auke Noppe
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 16-10-2007
> 14:14
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: custom web.xml digester call

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Auke,

Auke Noppe wrote:
> Is it possible to call the digester of the web.xml by hand?
> 
> Like you can override the createstartdigester method in catalina.java?

If you need information from web.xml, you could always parse it yourself
by hand or using commons-digester.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHFos09CaO5/Lv0PARAv0vAKCYjUAsAk8g7YZcAPgam/iIuDPLngCdGI5z
G1gtRR8xNanxbGhTVXTEyQU=
=DLsQ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org