[Microcontainer] - Deploying a self contianed JBossMC Bean in a JAR
by kevglass
Hi, I'm just getting started with JBoss MC. I've got the most recent source and everything builds locally. From reading these forums and bits of documentation I created a bootstrap that uses the basic bootstrap and then deploys a bootstrap-beans.xml (as is deployed with JBoss AS).
I'm using a cut down version of the bootstrap-beans.xml from JBossAS to bring up my JBossMC, essentially removing anything that is specific to JBossAS.
Now I want to deploy my bean (or even one of the examples) and have it instanced. So I've created a JAR that contains a single simple POJO and a jboss-beans.xml to go in the META-INF directory. The descriptor specifies one bean and points to the simple POJO class in my JAR.
Using my cobbled together bootstrap code I deploy the JAR and observe the following (most of which is expected):
1) The JAR is picked up by the JARStructure and split into it's constituent parts, which are pushed back through the deployment chain.
2) The VFSTopLevelClassLoaderDeployer I have configured reacts to the JAR deployment by created a class loader for the deployed JAR and adding it the deployment context.
3) The jboss-beans.xml gets picked up by the BeanMetaDataDeployer and it creates the bean meta info in and attaches it to the unit
4) The find deployment phase kicks in and attempts to install the bean. At this point I get a ClassNotFoundException for my bean class which fails the deployment.
I'm a bit stuck at this point. Is there an example of a correct configuration for running just the pure JBossMC bean hosting. I assume I'm missing a deployer or something, but I just can't seem to work it out alone. I've checked through the docs/examples but each of those adds the deployed archive containing the beans to the boot classpath, so the classes arn't actually loaded from the deployed artefact at all. Is it not possible to load beans from the archive they're deployed in?
I've spent some time looking through the code. The class loader deployed is creating a basic class loader and storing it in the deployment context. However, I can't find anywhere this context class loader is actually picked up (*the bean deployer seems to use either the bean meta info classloader or the thread context class loader). I've produced a small patch for the DeployersImpl that sets up the context class loader during install - but I'm not sure this is the right approach.
The only other approach I could think of was to deploy a classloader with the bean and have the bean use this - but I haven't been able to determine the correct XML configuration to support this.
Any thoughts or help appreciated,
Kev
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082131#4082131
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082131
18 years, 7 months
[JBoss Seam] - Re: problem using entityqueries
by jamesjmp
Thank you, but the same error keeps on happenning
14:31:45,765 ERROR [DebugPageHandler] redirecting to debug page
org.jboss.seam.RequiredException: In attribute requires non-null value: rstReportHome.repTemp
The code is now:
| @Name("rstReportHome")
| public class RstReportHome extends EntityHome<RstReport> {
| ...
| @In(create = true)
| RstReportTemplate repTemp;
| ...
| public void wire() {
| ..
| repTemp.processTemplate(rep);
| ...
This behaviour, with create=true, doesn´t seem to conform to what is said in the seam reference anonymous wrote :
| @In
| Specifies that a component attribute is to be injected from a context variable at the beginning of each component
| invocation. If the context variable is null, an exception will be thrown
| @In(create=true)
| Specifies that a component attribute is to be injected from a context variable at the beginning of each component
| invocation. If the context variable is null, an instance of the component is instantiated by Seam.
I guess I´m still doing something wrong, but I´ve no idea what it is. ;-(
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082129#4082129
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082129
18 years, 7 months
[JBoss jBPM] - Solved
by Jean-LucT
It was the correct way (the transition Non was followed only once in fact). I've made a coding error later that made my trace be triggered twice.
So the correct way of doing a Decision in Java code is to code directly in the Source tab of your processdefinition.xml the following code :
<decision name="Client actif ?">
| <handler class="fr.jl2tho.tutorialjbpm.action.IsCustomer" />
| <transition name="Oui" to="Enregistrer la Question"></transition>
| <transition name="Non" to="Prevenir le commercial"></transition>
| </decision>
|
|
Where IsCustomer implements org.jbpm.graph.node.DecisionHandler.
It seems to me impossible to do it through the GUI ProcessDesigner.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082117#4082117
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082117
18 years, 7 months