You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Vic Cekvenich <ce...@baseBeans.com> on 2003/11/28 00:36:37 UTC
Re: [HiveMind] project layout - solved
I got it to work, here is my comments on the solution, maybe it helps
someone:
<?xml version="1.0"?>
// hivemodule.xml must be in META-INF; and best be called project name
<module id="asyncB" version="1.0.0">
<service-point id="MailSync" interface="bP.async.mailer.MailSync">
<create-instance class ="bP.async.mailer.MailSyncImpl"/>
</service-point>
<service-point
...
</service-point>
// The service name is module id + service point id; and then the
interface.
MailSync m = (MailSync) reg.getService("asyncB.MailSync",MailSync.class);
.V
Howard M. Lewis Ship wrote:
> My Eclipse layout:
>
> src/java
> Root of java packages
> src/conf/META-INF
> Contains hivemodule.xml
>
> I add src/java and src/conf as source folders and everything works fine. The Eclipse builder copies
> src/conf/META-INF/hivemodule.xml to bin/META-INF/hivemodule.xml, where it is visible at runtime to
> RegistryBuilder and all is well.
>
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com <http://javatapestry.blogspot.com/>
>
> -----Original Message-----
> From: Vic Cekvenich [mailto:cekvenich_vic@basebeans.com]
> Sent: Saturday, November 22, 2003 1:29 PM
> To: Howard M. Lewis Ship
> Subject: Re: [Fwd: Re: Multi Action servlet !]
>
>
> Ahh.
> What if I did not want to build a jar each time as I develop (I just say "run" in Eclipse IDE, or I
> just wanted one large jar?
> Let me see when I work on it again. I wish I was not forced to work in a certain way.
>
> thanks,
> V
>
> .
>
> Howard M. Lewis Ship wrote:
>
>
> A module is a container of services and configurations.
>
> A module has a single descriptor, META-INF/hivemodule.xml.
>
> A module is typically packaged as a JAR file.
>
> When you have problems, the likely culprit is that the hivemodule.xml is not visible to
> RegistryBuilder, because it is not in the right place (META-INF/hivemodule.xml).
>
> So what you want to do in your Ant build.xml is construct the JAR file, including packaging the
> hivemodule.xml properly, then execute your unit tests with the constructed JAR on the classpath.
>
> You can enable debugging (please check the RegistryBuilder code), to see exactly what HiveMind sees.
>
>
>
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com <http://javatapestry.blogspot.com/>
>
> -----Original Message-----
> From: Vic Cekvenich [mailto:cekvenich_vic@basebeans.com]
> Sent: Saturday, November 22, 2003 11:05 AM
> To: Howard M. Lewis Ship
> Subject: Re: [Fwd: Re: Multi Action servlet !]
>
>
> I know, sorry I used your thing as an example.... but I think it's an example of how to do things
> right.
> I have been able to predict good as to what is the Next thing.
>
> I am working on other things.... but still having a hard time writing my HiveMind. I got examples,
> and your examples work perfect.
> When I try a varation .... nothing.
>
> I will ask a few questions when I go back to it, like... where should the xml file go, and do you
> have one file per module or in xml define all modules.
> Anyways.. I will use it.... and it will be in my book on best practices.
>
> Thanks for the gift to the community!
>
> .V
>
> Howard M. Lewis Ship wrote:
>
>
> Craig McC is interested in using HiveMind too .. we talked at ApacheCon. I just need to get the IP
>
> issues resolved.
>
>
>
> --
>
> Howard M. Lewis Ship
>
> Creator, Tapestry: Java Web Components
>
> http://jakarta.apache.org/tapestry
>
> http://jakarta.apache.org/commons/sandbox/hivemind/
>
> http://javatapestry.blogspot.com
>
>
>
>
>
> -----Original Message-----
>
> From: Vic Cekvenich [mailto:cekvenich_vic@baseBeans.com]
>
> Sent: Friday, November 14, 2003 1:38 PM
>
> To: hlship@comcast.net
>
> Subject: [Fwd: Re: Multi Action servlet !]
>
>
>
>
>
> (Right now my name is mud )
>
>
>
> On Struts dev list, the need an IoC. Struts uses commons chain and
>
> commons resources, etc. I wish they would use "Commons" HiveMind.
>
> Ig Struts takes a "Services" aproach, it would be very
>
> competetive with
>
> WW2, Spring, etc.
>
>
>
> .V
>
>
>
>
>
>
>
> -------- Original Message --------
>
> Subject: Re: Multi Action servlet !
>
> Date: Fri, 14 Nov 2003 08:24:00 -1000 (HST)
>
> From: Don Brown <ma...@twdata.org> <mr...@twdata.org>
>
> Reply-To: Struts Developers List <ma...@jakarta.apache.org>
> <st...@jakarta.apache.org>
>
> Newsgroups: gmane.comp.jakarta.struts.devel
>
> References: <ma...@apache.org> <3F...@apache.org>
>
>
>
> What about using Inversion of Control (IoC) to replace the
>
> current global
>
> context map? The action servlet loads up the IoC factory,
>
> initializing
>
> all objects, then puts the factory in the request attributes for each
>
> request, allowing other components, like taglibs, to be able to access
>
> that servlet's objects? Not only would this make managing
>
> dependencies
>
> much cleaner, but make it easier to extend Struts once class
>
> references were changed into interfaces. Of course since any
>
> objects that
>
> aren't pre-initialized can pull objects from the bean factory in the
>
> request, we can ensure that the servlets won't overlap.
>
>
>
> The impact to existing Struts can be minimal - we could even put IoC
>
> configuration in the jar to prevent any user confusion. For an IoC
>
> implementation, I've found Spring
>
> (http://www.springframework.org) to be
>
> very easy to use and straightforward, not to mention light
>
> weight, however
>
> it would be pretty easy to provide a few Struts classes to
>
> wrap the IoC
>
> framework to prevent being tied to one implementation.
>
>
>
> I'm no Spring expert, but I volunteer to do any work
>
> necessary, assuming
>
> the idea is approved.
>
>
>
> Don
>
>
>
> On Fri, 14 Nov 2003, Ted Husted wrote:
>
>
>
>
>
> The underlying problem is that Struts stores things directly in the
>
> application and session contexts under static names. So,
>
>
>
> the resources
>
>
>
> (in the generic sense) for one application can overwrite
>
>
>
> the other. One
>
>
>
> reason for modules is to put multiple sets of resources in
>
>
>
> the shared
>
>
>
> contexts under different names.
>
>
>
> An alternate design for the Struts 2.x timeframe might be to gather
>
> everything the framework uses into single context objects,
>
>
>
> perhaps named
>
>
>
> after the servlet. So the "action" servlet would have an "action"
>
> context in the application and session scope, and the
>
>
>
> "differentAction"
>
>
>
> servlet would have it's own "differentAction" context
>
>
>
> object. Inside of
>
>
>
> each context (a Map) would be things like the message resources and
>
> Locale the servlet and client are using.
>
>
>
> Then, when a request is being serviced, a default gateway
>
>
>
> context can be
>
>
>
> placed in the request that would link to the appropriate session and
>
> application contexts for a given controller instance. This is
>
> essentially what the module code does now, but with all the
>
> complications that backward compatibility brings.
>
>
>
> Of course, complications still arise. Such as if the
>
>
>
> "action" servlet
>
>
>
> changes the Locale for a client, is the "differentAction" servlet
>
> suppose to see that change? So, there might still be a
>
>
>
> global framework
>
>
>
> context at the top of the chain, which a controller instance could
>
> update and the other controllers could see.
>
>
>
> Another advantage here is that it would be easier for Struts
>
> applications to pass along its context to a business layer without
>
> binding that layer to HTTP. An Action could pass up the
>
>
>
> Context chain
>
>
>
> without passing the HTTP request itself, or pulling things
>
>
>
> out piecemeal.
>
>
>
> -Ted.
>
>
>
> alvin@sparkgap.cc wrote:
>
>
>
> I'm with Edgar on this one - should it not be possible?
>
>
>
> Of course, I tried the
>
>
>
> following:
>
>
>
> <servlet-mapping>
>
> <servlet-name>action</servlet-name>
>
> <url-pattern>*.do</url-pattern>
>
> </servlet-mapping>
>
>
>
> <servlet-mapping>
>
> <servlet-name>differentAction</servlet-name>
>
> <url-pattern>*.dont</url-pattern>
>
> </servlet-mapping>
>
>
>
> with each mapping to different action servlets with
>
>
>
> different config files and
>
>
>
> everything got bunged up. It seems like it should have
>
>
>
> worked but alas.
>
>
>
> Perhaps it is a bit of a green question, but why would it
>
>
>
> not work?
>
>
>
> Best,
>
>
>
> Alvin
>
>
>
> Quoting Edgar P Dollin <ma...@blue-moose.net> <ed...@blue-moose.net>:
>
>
>
>
>
>
>
> Why wouldn't changing the servlet mapping from *.do -->
>
>
>
> action servlet to
>
>
>
> *.[actiontype] --> [associated action servlet] work? As
>
>
>
> long as you are
>
>
>
> consistent would struts care?
>
>
>
> Edgar
>
>
>
>
>
>
>
> -----Original Message-----
>
> From: Ted Husted [mailto:husted@apache.org]
>
> Sent: Friday, November 14, 2003 7:10 AM
>
> To: Struts Developers List
>
> Subject: Re: Multi Action servlet !
>
>
>
>
>
> People have done it, but it's a delicate thing to try. The
>
> recommended
>
> approach is to use Struts 1.1 modules. To customize the front
>
> controller
>
> logic for each module, you can plug in alternate Request
>
> Processors if
>
> needed. This gives you all the benefits of having
>
>
>
> multiple servlets,
>
>
>
> without the extra overhead. (There is *no* performance
>
> benefit in having
>
> multiple servlets that do the same thing.)
>
>
>
> A better place to ask questions like this would be the Struts
>
> USER list.
>
> This is where you'd ask if we were going to support
>
> multiple servlets
>
> in the future. (Answer to that one: not any time soon.)
>
>
>
> -Ted.
>
>
>
> Karikalan Kumaresan wrote:
>
>
>
>
>
> Hi,
>
>
>
> Does anyone know, is it possible to have 2 action servlet
>
>
>
> configured
>
>
>
>
>
> in struts for different project in a same JVM/in same webserver.
>
>
>
> Cheers,
>
> Kari...
>
>
>
> -----Original Message-----
>
> From: Steve Raeburn [mailto:sraeburn@apache.org]
>
> Sent: 14 November 2003 07:15
>
> To: Struts Developers List
>
> Subject: RE: Parsing Error in struts
>
>
>
>
>
> Most likely you haven't closed a JSP tag correctly. Try
>
>
>
> commenting out
>
>
>
>
>
> sections of your JSP to narrow down where the error is.
>
>
>
> But you should be asking on the struts-user list not here.
>
>
>
> Steve
>
>
>
>
>
>
>
>
>
> -----Original Message-----
>
> From: Abhijeet Mahalkar
>
>
>
> [mailto:Abhijeet.Mahalkar@indussoft.com]
>
>
>
> Sent: November 13, 2003 9:21 PM
>
> To: Struts Developers List
>
> Subject: Parsing Error in struts
>
>
>
>
>
> I am getting following error is there anybody who can guide
>
>
>
> me for he
>
>
>
>
>
> same....
>
>
>
> [11/14/03 10:38:12:954 GMT+05:30] 11d6d752 WebGroup E
>
>
>
> SRVE0026E:
>
>
>
>
>
> [Servlet Error]-[End of content reached while more parsing
>
> required: tag
>
> nesting error?]: org.apache.jasper.compiler.ParseException:
>
> End of content
>
> reached while more parsing required: tag nesting error?
>
> at
>
>
>
> org.apache.jasper.compiler.JspReader.popFile(JspReader.java:293)
>
>
>
> at
>
>
>
> org.apache.jasper.compiler.JspReader.hasMoreInput(JspReader.ja
>
>
>
> va(Compiled
>
> Code))
>
> at
>
>
>
> org.apache.jasper.compiler.Parser.parse(Parser.java(Compi
>
>
>
> led Code))
>
>
>
> at
>
>
>
> org.apache.jasper.compiler.Parser.parse(Parser.java(Inlin
>
>
>
> ed Compiled
>
>
>
> Code))
>
> at
>
> org.apache.jasper.compiler.Parser$Tag.accept(Parser.java(Compi
>
> led Code))
>
> at
>
>
>
> org.apache.jasper.compiler.Parser.parse(Parser.java(Compi
>
>
>
> led Code))
>
>
>
> at
>
>
>
> org.apache.jasper.compiler.Parser.parse(Parser.java(Inlin
>
>
>
> ed Compiled
>
>
>
> Code))
>
> at
>
> org.apache.jasper.compiler.Parser$Tag.accept(Parser.java(Compi
>
> led Code))
>
> at
>
>
>
> org.apache.jasper.compiler.Parser.parse(Parser.java(Compi
>
>
>
> led Code))
>
>
>
> at
>
>
>
> org.apache.jasper.compiler.Parser.parse(Parser.java(Inlin
>
>
>
> ed Compiled
>
>
>
> Code))
>
> at
>
> org.apache.jasper.compiler.Parser$Tag.accept(Parser.java(Compi
>
> led Code))
>
> at
>
>
>
> org.apache.jasper.compiler.Parser.parse(Parser.java(Compi
>
>
>
> led Code))
>
>
>
> at org.apache.jasper.compiler.Parser.parse(Parser.java:1110)
>
> at org.apache.jasper.compiler.Parser.parse(Parser.java:1106)
>
> at
>
> org.apache.jasper.compiler.ParserController.parse(ParserContro
>
> ller.java:309)
>
> at
>
>
>
> org.apache.jasper.compiler.Compiler.compile(Compiler.java(Compiled
>
>
>
> Code))
>
> at
>
> com.ibm.ws.webcontainer.jsp.servlet.JspServlet.loadJSP(JspServ
>
> let.java(Compi
>
> led Code))
>
> at
>
> com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapp
>
> er.loadIfNeces
>
> sary(JspServlet.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapp
>
> er.service(Jsp
>
> Servlet.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(
>
> JspServlet.jav
>
> a(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServ
>
> let.java(Compi
>
> led Code))
>
> at
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java(Compil
>
> ed Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.StrictServletInstance.doServic
>
> e(StrictServle
>
> tInstance.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._servic
>
> e(StrictLifecy
>
> cleServlet.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.IdleServletState.service(Stric
>
> tLifecycleServ
>
> let.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service
>
> (StrictLifecyc
>
> leServlet.java(Inlined Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.ServletInstance.service(Servle
>
> tInstance.java
>
> (Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dis
>
> patch(ValidSer
>
> vletReferenceState.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispa
>
> tch(ServletIns
>
> tanceReference.java(Inlined Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleW
>
> ebAppDispatch(
>
> WebAppRequestDispatcher.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatc
>
> h(WebAppReques
>
> tDispatcher.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward
>
> (WebAppRequest
>
> Dispatcher.java(Compiled Code))
>
> at
>
> org.apache.struts.action.RequestProcessor.doForward(RequestPro
>
> cessor.java:10
>
> 69)
>
> at
>
> org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesR
>
> equestProcesso
>
> r.java:274)
>
> at
>
> org.apache.struts.action.RequestProcessor.processForwardConfig
>
> (RequestProces
>
> sor.java:455)
>
> at
>
> org.apache.struts.tiles.TilesRequestProcessor.processForwardCo
>
> nfig(TilesRequ
>
> estProcessor.java:320)
>
> at
>
> org.apache.struts.action.RequestProcessor.process(RequestProce
>
> ssor.java:279)
>
> at
>
> org.apache.struts.action.ActionServlet.process(ActionServlet.j
>
> ava:1480)
>
> at
>
>
>
> org.apache.struts.action.ActionServlet.doGet(ActionServle
>
>
>
> t.java:506)
>
>
>
> at
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java(Compil
>
> ed Code))
>
> at
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java(Compil
>
> ed Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.StrictServletInstance.doServic
>
> e(StrictServle
>
> tInstance.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._servic
>
> e(StrictLifecy
>
> cleServlet.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.IdleServletState.service(Stric
>
> tLifecycleServ
>
> let.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service
>
> (StrictLifecyc
>
> leServlet.java(Inlined Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.ServletInstance.service(Servle
>
> tInstance.java
>
> (Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dis
>
> patch(ValidSer
>
> vletReferenceState.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispa
>
> tch(ServletIns
>
> tanceReference.java(Inlined Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleW
>
> ebAppDispatch(
>
> WebAppRequestDispatcher.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatc
>
> h(WebAppReques
>
> tDispatcher.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward
>
> (WebAppRequest
>
> Dispatcher.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvo
>
> ker.java(Compi
>
> led Code))
>
> at
>
> com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook
>
> (WebAppInvoker
>
> .java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.hand
>
> leInvocation(C
>
> achedInvocation.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchBy
>
> URI(ServletReq
>
> uestProcessor.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.serv
>
> ice(OSEListene
>
> r.java(Compiled Code))
>
> at
>
> com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(Http
>
> Connection.jav
>
> a(Compiled Code))
>
> at
>
> com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnec
>
> tion.java(Comp
>
> iled Code))
>
> at
>
> com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compi
>
>
>
> led Code))
>
>
>
>
>
> at
>
> com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compil
>
>
>
> ed Code))
>
>
>
>
>
> thankx in advace...
>
>
>
> abhijeet
>
>
>
>
>
>
>
> ------------------------------------------------------------
>
>
>
> ---------
>
>
>
>
>
> To unsubscribe, e-mail:
>
>
>
> struts-dev-unsubscribe@jakarta.apache.org
>
>
>
> For additional commands, e-mail:
>
>
>
> struts-dev-help@jakarta.apache.org
>
>
>
>
>
>
>
>
>
> -----------------------------------------------------------
>
>
>
> ----------
>
>
>
> To unsubscribe, e-mail:
>
>
>
> struts-dev-unsubscribe@jakarta.apache.org
>
>
>
> For additional commands, e-mail:
>
>
>
> struts-dev-help@jakarta.apache.org
>
>
>
>
>
> -----------------------------------------------------------
>
>
>
> ----------
>
>
>
> To unsubscribe, e-mail:
>
>
>
> struts-dev-unsubscribe@jakarta.apache.org
>
>
>
> For additional commands, e-mail:
>
>
>
> struts-dev-help@jakarta.apache.org
>
>
>
>
>
> --
>
> Ted Husted,
>
> Junit in Action - <http://www.manning.com/massol/> <http://www.manning.com/massol/>,
>
> Struts in Action - <http://husted.com/struts/book.html> <http://husted.com/struts/book.html>,
>
> JSP Site Design -
>
> <http://www.amazon.com/exec/obidos/ISBN=> <http://www.amazon.com/exec/obidos/ISBN=> 1861005512>.
>
>
>
>
>
>
>
>
>
>
>
>
>
> -----------------------------------------------------------
>
>
>
> ----------
>
>
>
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
>
> For additional commands, e-mail:
>
>
>
> struts-dev-help@jakarta.apache.org
>
>
>
> ------------------------------------------------------------
>
>
>
> ---------
>
>
>
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
>
> For additional commands, e-mail:
>
>
>
> struts-dev-help@jakarta.apache.org
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
>
>
>
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
>
> For additional commands, e-mail:
>
>
>
> struts-dev-help@jakarta.apache.org
>
>
>
>
>
> --
>
> Ted Husted,
>
> Junit in Action - <http://www.manning.com/massol/> <http://www.manning.com/massol/>,
>
> Struts in Action - <http://husted.com/struts/book.html> <http://husted.com/struts/book.html>,
>
> JSP Site Design -
>
>
>
> <http://www.amazon.com/exec/obidos/ISBN=> <http://www.amazon.com/exec/obidos/ISBN=> 1861005512>.
>
>
>
>
>
> ---------------------------------------------------------------------
>
>
>
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
>
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>
>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org