-
1. Re: Deploying separate jar with seam components
gav_on_rails Mar 27, 2008 5:49 PM (in response to gav_on_rails)Having looked at the code it would seem that this is not supported. Seam can be reinitialises, as done in the seam servlet context listener, but this causes the seam contexts to be reset. It would be nice to be able to specify a new url to be scanned for seam components and for these to be added to the current set of components.
-
2. Re: Deploying separate jar with seam components
gav_on_rails Mar 27, 2008 7:14 PM (in response to gav_on_rails)Manually adding components to the application context also works:
component = new Component(this.getClass().forName("com.company.MyComponent"), "myComponent"); Contexts.getApplicationContext().set("myComponent.component", component);
but could circumvent important initialisation, which I don't have time to check...
-
3. Re: Deploying separate jar with seam components
pmuir Mar 28, 2008 8:05 PM (in response to gav_on_rails)Not supported.
-
4. Re: Deploying separate jar with seam components
gav_on_rails Mar 28, 2008 8:30 PM (in response to gav_on_rails)Any plans to in the future?
-
5. Re: Deploying separate jar with seam components
pmuir Mar 29, 2008 11:42 AM (in response to gav_on_rails)Actually, maybe if you add the external EJB jar to the classpath of the EAR it might get picked up as Seam - give it a go.
It's not on the roadmap, but add an issue to JIRA and we can see if it gets many votes.
-
6. Re: Deploying separate jar with seam components
gav_on_rails Mar 29, 2008 12:48 PM (in response to gav_on_rails)An external EJB jar is picked up if the jar is already on the classpath at the time when seam is being initialised, but won't be if you deploy a jar after initialisation is complete.
I shall add this issue to JIRA.
Thanks.
-
7. Re: Deploying separate jar with seam components
pmuir Mar 29, 2008 12:53 PM (in response to gav_on_rails)Ok. I think then it's even further down the list of priorities, as it would require a big change to the way seam boots.
Maybe Web Beans will support this...
-
8. Re: Deploying separate jar with seam components
deanhiller2000 Jun 3, 2009 5:01 PM (in response to gav_on_rails)hmmmm, you keep saying have it on the classpath which is confusing....do you mean have it in the same classloader really? and if so, on jboss, how do I make sure an external jar is in the same classloader as my jar with my EJB's.....my app already gets the EntityManagerFactory through JNDI, but it can't seem to load the beans in that same external jar..it can only use them as EJBs just fine...just doesn't load the seam components in the external jar. Is there a way to do this as we are sharing this one jar between 10 different applications and it is a jar of lots of classes....we can't deploy that jar 10 times or the memory is ridiculous.
thanks,
Dean -
9. Re: Deploying separate jar with seam components
gav_on_rails Jun 3, 2009 5:44 PM (in response to gav_on_rails)Maybe we need something along the lines of:
Component.addComponent(newComponent.getClass());
then components could perhaps be added programmatically.
Or some way of rescanning the classpath for new components again using the seam.properties identifier.
-
10. Re: Deploying separate jar with seam components
deanhiller2000 Jun 3, 2009 6:43 PM (in response to gav_on_rails)What do you mean classpath? I am in an AppServer...not much classpath to deal with but plenty of classloaders to deal with.
I could have sworn I was involved with a post that had this solved. I have a war and jar(not an ear) and just want the war and jar to be in same classloader but I thought they would be if I didn't specify a unified classloader, but it doesn't pick up the seam components :(.
We have this jar being successfully used by many JBoss applications(MBeans deployed inside jars), and our seam webapp is loading the beans as EJB's just fine, but is just not loading the seam stuff...why would the EntityManager stuff work but not the seam components :(.
-
11. Re: Deploying separate jar with seam components
deanhiller2000 Jun 3, 2009 10:37 PM (in response to gav_on_rails)I DEBUGGED it and found out something very interesting. Seam picks up all my annotated classes just fine but then fails on this check...
if ( scannedClass.isAnnotationPresent(Name.class) )
{That seems a bit bizarre. It is like seam has a classloadeer problem and my name annotation is not being picked up BUT the ones with Name annotation showed up in the classes list while other entities where skipped so at one point scanning for these annotations in seam startup succeeded!!!!
Dean