Eric:
In your scenario are you dealing with a single servlet, multiple-servlet, single web-app, or multiple web-apps? Multi servlet scenarios should be fine.
The objective of the merlin-in-a-servlet is rather simple - namely the deployment of merlin as a web-application. In this context the web-server is in control with respect to the setup of the parent classloader and the deployment of a servlet that embeds Merlin. Merlin then kicks in as part of the servlet initialization with its component deployment stuff.
In the setup of the system I just used the default behavior which is
for merlin to use the ${merlin.home}/system repository for internals and
${avalon.home}/repository for application content loading. I know
others are declaring classloader resources independently of the
repository by using local fileset declarations in the classloader
definition instead.I have not personally tried to fully package merlin in a web-app using only content in a web-inf/ directory. There is a crunch point concerning the loading of content from within a war file. Merlin uses plain vanilla URLClassLoaders - however - this imposes the restriction that the jar files included in the classloaders are actual files in the file system (as opposed to jar in a war). To bypass this problem one would need to write an new classloader (like what Tomcat provides). On the other hand - if you running in an environment where you know content is unpacked - then it should be possible to configure merlin to work off the unpacked files.
Just a final note - I'm currently experimenting with a merlin loading
and deploying components that provide direct support for http service requests which is looking promising.
Stephen.
Eric Pugh wrote:
I tried using this example and found it a bit too simple for me to actually use. It may be that my understanding of all the .something files is getting in the way, but I tried to model the Turbine MerlinComponentService on this example and got nowhere.
Has anyone actually used Merlin in a webapp in something more complex then the sample app?
Some of the questions I am hoping are answered in the real world are: 1) Did you store all your repository stuff in user.home etc where Merlin by default puts things? 2) Can you instead store everything in /web-inf/someplace? 3) Did the tomcat classloader interfere with the merlin classloaders?
I have definitly been thrashing a bit trying to get Merlin properly configured in a .WAR file. I can see how Merlin works as the entity starting everything else up, but if I just want a container, and I'm willing to include everything on my classpath (ie /WEB-INF/lib and /WEB-INF/classes), how do I use Merlin...
Eric
-----Original Message----- From: Farr, Aaron [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 10:25 PM To: 'Avalon framework users' Subject: RE: Webapp example
-----Original Message----- From: Vikas Phonsa [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 4:15 PM To: 'Avalon framework users' Subject: Webapp example
Hi Guys,
Thanks for your answers to my previous post.
Does any body has an example web application which has
Merlin embedded
into it, using tomcat or whatever.
Thanks
Vikas
There's an example of embedding merlin in a servlet and putting the kernel in the ServiceContext in CVS:
http://cvs.apache.org/viewcvs.cgi/avalon/merlin/kernel/servlet/
and
http://cvs.apache.org/viewcvs.cgi/*checkout*/avalon/merlin/ker
nel/servlet/sr c/java/org/apache/avalon/merlin/servlet/MerlinServlet.java
J. Aaron Farr SONY ELECTRONICS DDP-CIM (724) 696-7653
--------------------------------------------------------------------- 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]
--
|------------------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org/merlin | | http://dpml.net/merlin/distributions/latest | |------------------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
