[EJB 3.0 Development] New message: "Source Location for EJB3 Components"
by Andrew Rubinger
JBoss development,
A new message was posted in the thread "Source Location for EJB3 Components":
http://community.jboss.org/message/520181#520181
Author : Andrew Rubinger
Profile : http://community.jboss.org/people/ALRubinger
Message:
--------------------------------------------------------------
Persuant to discussions Carlo, Jaikiran and I have been having lately, I've extracted the component charged with bringing @Asynchronous support to EJB into its own space:
http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/components/
Under this alignment "org.jboss.ejb3.async" is a component with "spi", "build", and "impl" *modules*. Each module shares a release cycle with the component as a whole.
Criteria:
1) Each component has an SPI upon which other components can depend
2) In compile scope, no component may depend on anything aside from the designated SPI. In runtime/test scope the doors are open to use impl classes (I *really* wish Maven provided a scope for "test runtime only, but not test compilation".
How do we feel about using this setup as a template for further breaking apart EJB3 pieces under trunk?
S,
ALR
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520181#520181
16 years, 2 months
[JBoss Microcontainer Development] New message: "Re: Activating OnDemand beans from child controller"
by Kabir Khan
JBoss development,
A new message was posted in the thread "Activating OnDemand beans from child controller":
http://community.jboss.org/message/520168#520168
Author : Kabir Khan
Profile : http://community.jboss.org/people/kabir.khan@jboss.com
Message:
--------------------------------------------------------------
The messages you added to avoid the errors shown in the dev list post now get triggered for contexts that have been uninstalled. As you can see I modified them a bit. If I have an OnDemand bean called Bean1 and Bean2 and Bean3 depend on it, then if I
-uninstall Bean2
-when uninstalling Bean3 I get an error message when checking Bean3's dependencies. It finds Bean1 and then checks Bean1's DependsOnMe. The message I get is "Could not find reverse dependency 'Name2' while uninstalling on demand contexts for AbstractDependencyItem@6c3c9c31{name=Name3 dependsOn=Name1 whenRequired=Configured resolved=true}"
protected void uninstallUnusedOnDemandContexts(ControllerContext context, boolean trace)
{
lockWrite();
try
{
DependencyInfo dependencies = context.getDependencyInfo();
if (dependencies != null)
{
Set<DependencyItem> iDependOn = dependencies.getIDependOn(null);
if (iDependOn.isEmpty() == false)
{
for (DependencyItem item : iDependOn)
{
if (item.isResolved()) //TODO Is this check necessary
{
Object name = item.getIDependOn();
if (name == null)
continue;
ControllerContext other = getContext(name, null);
if (other == null)
{
log.warn("Could not find dependency '" + name + "' while uninstalling on demand contexts for " + item);
continue;
}
if (other.getMode() != ControllerMode.ON_DEMAND)
continue;
DependencyInfo otherDependencies = other.getDependencyInfo();
if (otherDependencies == null)
continue;
Set<DependencyItem> dependsOnOther = otherDependencies.getDependsOnMe(null);
boolean isRequired = false;
for (DependencyItem dependsOnOtherItem : dependsOnOther)
{
ControllerContext dependsContext = getContext(dependsOnOtherItem.getName(), null);
if (dependsContext == null)
{
log.warn("Could not find reverse dependency '" + dependsOnOtherItem.getName() + "' while uninstalling on demand contexts for " + item);
continue;
}
ControllerState requiredState = item.getWhenRequired();
ControllerState actualState = dependsContext.getState();
if (requiredState.equals(actualState) || stateModel.isBeforeState(requiredState, actualState))
{
isRequired = true;
break;
}
}
if (!isRequired)
{
//For some reason uninstallContext() uninstalls to the state below the passed in one, add one
ControllerState state = stateModel.getNextState(ControllerMode.ON_DEMAND.getRequiredState());
uninstallContext(other, state, trace);
}
}
}
}
}
}
finally
{
unlockWrite();
}
}
This simple test shows that DependsOnMe never gets cleared:
public class DependsOnMeTestCase extends AbstractDependencyTest
{
public DependsOnMeTestCase(String name)
{
super(name);
}
public void testDependsOnMeCorrectOrder() throws Throwable
{
ControllerContext context1 = assertInstall(getDelegate1());
assertEmpty(context1.getDependencyInfo().getIDependOn(null));
assertEmpty(context1.getDependencyInfo().getDependsOnMe(null));
ControllerContext context2 = assertInstall(getDelegate2());
assertEmpty(context2.getDependencyInfo().getDependsOnMe(null));
assertEquals(1, context2.getDependencyInfo().getIDependOn(null).size());
assertEquals("Name1", context2.getDependencyInfo().getIDependOn(null).iterator().next().getIDependOn());
assertEmpty(context1.getDependencyInfo().getIDependOn(null));
assertEquals(1, context1.getDependencyInfo().getDependsOnMe(null).size());
assertEquals("Name1", context1.getDependencyInfo().getDependsOnMe(null).iterator().next().getIDependOn());
}
public void testDependsOnMeWrongOrder() throws Throwable
{
ControllerContext context2 = assertInstall(getDelegate2(), ControllerState.PRE_INSTALL);
assertEmpty(context2.getDependencyInfo().getDependsOnMe(null));
assertEquals(1, context2.getDependencyInfo().getIDependOn(null).size());
assertEquals("Name1", context2.getDependencyInfo().getIDependOn(null).iterator().next().getIDependOn());
ControllerContext context1 = assertInstall(getDelegate1());
assertEmpty(context1.getDependencyInfo().getIDependOn(null));
assertEquals(1, context1.getDependencyInfo().getDependsOnMe(null).size());
assertEquals("Name1", context1.getDependencyInfo().getDependsOnMe(null).iterator().next().getIDependOn());
assertEmpty(context2.getDependencyInfo().getDependsOnMe(null));
assertEquals(1, context2.getDependencyInfo().getIDependOn(null).size());
assertEquals("Name1", context2.getDependencyInfo().getIDependOn(null).iterator().next().getIDependOn());
}
public void testDependsOnMeUninstallRightOrder() throws Throwable
{
ControllerContext context1 = assertInstall(getDelegate1());
assertEmpty(context1.getDependencyInfo().getIDependOn(null));
assertEmpty(context1.getDependencyInfo().getDependsOnMe(null));
ControllerContext context2 = assertInstall(getDelegate2());
assertEmpty(context2.getDependencyInfo().getDependsOnMe(null));
assertEquals(1, context2.getDependencyInfo().getIDependOn(null).size());
assertEquals("Name1", context2.getDependencyInfo().getIDependOn(null).iterator().next().getIDependOn());
assertEmpty(context1.getDependencyInfo().getIDependOn(null));
assertEquals(1, context1.getDependencyInfo().getDependsOnMe(null).size());
assertEquals("Name1", context1.getDependencyInfo().getDependsOnMe(null).iterator().next().getIDependOn());
assertUninstall(context2);
assertEmpty(context2.getDependencyInfo().getDependsOnMe(null));
assertEquals(1, context2.getDependencyInfo().getIDependOn(null).size());
assertEquals("Name1", context2.getDependencyInfo().getIDependOn(null).iterator().next().getIDependOn());
context1 = assertContext("Name1", ControllerState.INSTALLED);
assertEmpty(context1.getDependencyInfo().getIDependOn(null));
assertEmpty(context1.getDependencyInfo().getDependsOnMe(null)); // FAILS - dependsOnMe still contains Name2
}
protected TestDelegate getDelegate1()
{
return new TestDelegate("Name1");
}
protected TestDelegate getDelegate2()
{
TestDelegate result = new TestDelegate("Name2");
result.addDependency(new AbstractDependencyItem("Name2", "Name1", ControllerState.DESCRIBED, ControllerState.INSTALLED));
return result;
}
}
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520168#520168
16 years, 2 months
[EJB 3.0 Development] New message: "Re: EJB3 Version Targets for AS 6.0 M3"
by John Bailey
JBoss development,
A new message was posted in the thread "EJB3 Version Targets for AS 6.0 M3":
http://community.jboss.org/message/520090#520090
Author : John Bailey
Profile : http://community.jboss.org/people/johnbailey
Message:
--------------------------------------------------------------
What I should have said is, whichever component versions are going to be included in AS 6.0 M3 will need to be integrated with VFS3 prior to the M3 release.
Below are all the files with references to VFS in ejb3 components:
./aop-deployers/src/main/java/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java
./concurrency/src/test/java/org/jboss/ejb3/concurrency/test/common/AbstractBootstrapTestCase.java
./core/src/main/java/org/jboss/ejb3/ClassFileFilter.java
./core/src/main/java/org/jboss/ejb3/ClientDescriptorFileFilter.java
./core/src/main/java/org/jboss/ejb3/DeploymentUnit.java
./core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java
./core/src/main/java/org/jboss/ejb3/EJBContainer.java
./core/src/main/java/org/jboss/injection/InjectionContainer.java
./core/src/test/java/org/jboss/ejb3/test/cachepassivation/MockDeploymentUnit.java
./core/src/test/java/org/jboss/injection/test/common/DummyInjectionContainer.java
./deployers/src/main/java/org/jboss/ejb3/deployers/EjbAnnotationMetaDataDeployer.java
./embedded/src/main/java/org/jboss/ejb3/embedded/deployment/EmbeddedEjb3DeploymentUnit.java
./embedded/src/main/java/org/jboss/ejb3/embedded/dsl/DeploymentBuilder.java
./embedded/src/main/java/org/jboss/ejb3/embedded/JBossEJBContainer.java
./endpoint-deployer/src/test/java/org/jboss/ejb3/endpoint/deployers/test/simple/unit/DeployEndpointTestCase.java
./endpoint-deployer/src/test/resources/conf/bootstrap/deployers.xml
./jta-profile/src/test/java/org/jboss/ejb3/jta/profile/test/lookup/unit/LookupTransactionManagerTestCase.java
./profile3_1/src/it/common/src/main/java/org/jboss/ejb3/profile3_1/test/common/AbstractProfile3_1_TestCase.java
./profile3_1/src/it/common/src/main/java/org/jboss/ejb3/profile3_1/test/common/AbstractProfile3_1_TestCase.java
./singleton/src/test/java/org/jboss/ejb3/singleton/test/common/MockDeploymentUnit.java
./timerservice-mk2/src/test/java/org/jboss/ejb3/timerservice/mk2/test/common/AbstractTimerTestCase.java
./timerservice-quartz/src/test/java/org/jboss/ejb3/timerservice/quartz/test/simple/unit/SimpleUnitTestCase.java
./transactions/eclipse-target/tests-classes/instance/deployers.xml
./transactions/src/test/java/org/jboss/ejb3/test/tx/common/AspectDeployment.java
./transactions/src/test/resources/instance/deployers.xml+ +
I will take a look at all the references from tests and see if there is a way to remove the VFS reference all together. Otherwise I will ignore any project that has a test only dependency. I realize all the ejb3/trunk components are standalone, but as long as they are going to be integrated into AS, they will need to be updated. There may be ways we can isolate the change by reducing the number of code paths into VFS and then providing some kind of plugable adapter. I will look into this and let you know what I see.
Below is a list of ejb3 components included by AS (the bold entries are known to reference VFS):
org.jboss.ejb3:jboss-ejb3-api:jar:3.1.0:compile
org.jboss.ejb3:jboss-ejb3-cache:jar:1.0.0:compile
org.jboss.ejb3:jboss-ejb3-common:jar:1.0.1:compile
*org.jboss.ejb3:jboss-ejb3-core:jar:client:1.1.22:compile*
*org.jboss.ejb3:jboss-ejb3-core:jar:1.1.22:compile*
*org.jboss.ejb3:jboss-ejb3-deployers:jar:1.0.0:compile*
org.jboss.ejb3:jboss-ejb3-endpoint:jar:0.1.0:compile
org.jboss.ejb3:jboss-ejb3-ext-api:jar:1.0.0:compile
org.jboss.ejb3:jboss-ejb3-ext-api-impl:jar:1.0.0:compile
org.jboss.ejb3:jboss-ejb3-interceptors:jar:1.0.6:compile
org.jboss.ejb3:jboss-ejb3-jpa-int:jar:2.0.0-alpha-1:compile
org.jboss.ejb3:jboss-ejb3-metadata:jar:1.0.0:compile
org.jboss.ejb3:jboss-ejb3-proxy-clustered:jar:1.0.3:compile
org.jboss.ejb3:jboss-ejb3-proxy-impl:jar:1.0.6:compile
org.jboss.ejb3:jboss-ejb3-proxy-spi:jar:1.0.0:compile
org.jboss.ejb3:jboss-ejb3-security:jar:1.0.1:compile
org.jboss.ejb3:jboss-ejb3-timerservice-spi:jar:1.0.0:compile
*org.jboss.ejb3:jboss-ejb3-transactions:jar:1.0.2:compile* (VFS reference in test only)
org.jboss.ejb3:jboss-ejb3_1:pom:1.0.0:compile
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520090#520090
16 years, 2 months
[JBoss Microcontainer Development] New message: "Activating OnDemand beans from child controller"
by Kabir Khan
JBoss development,
A new message was posted in the thread "Activating OnDemand beans from child controller":
http://community.jboss.org/message/520083#520083
Author : Kabir Khan
Profile : http://community.jboss.org/people/kabir.khan@jboss.com
Message:
--------------------------------------------------------------
Fixing http://lists.jboss.org/pipermail/jboss-development/2010-January/015434.html I am adding a ScopedOnDemandDependencyTestCase (extends OnDemandDependencyTestCase similar to (Scoped)DuplicateAliasTestCase), but have found a deeper problem. If an OnDemand bean is installed in the main controller and is depended on by a bean in a child controller the OnDemand bean never gets activated and the child controller bean's dependency never resolved.
I install Bean1 with OnDemand, goes to Describe state
I install scoped Bean2 with Automatic and a dependency on Bean1, goes to Instantiated state fine
When trying to move Bean2 to Configured state it does not resolve for the following reasons:
When enabling ondemand beans in AbstractDependencyItem.resolve(), it was looking at the wrong controller, I changed:
if (unresolvedContext != null && ControllerMode.ON_DEMAND.equals(unresolvedContext.getMode()))
{
try
{
controller.enableOnDemand(unresolvedContext);
to
if (unresolvedContext != null && ControllerMode.ON_DEMAND.equals(unresolvedContext.getMode()))
{
try
{
unresolvedContext.getController().enableOnDemand(unresolvedContext);
Now Bean1 correctly gets its requiredState set to INSTALLED. Unfortunately this is not enough.
In the normal/unscoped mode the mechanism is that AbstractDI.resolve() returns false, and we end up back in the resolveContexts() loop which finds Bean1 is not in its requiredState (INSTALLED).
In the scoped test, it does not get picked up since Bean2 was installed in the scoped controller whose resolveContexts() does not involve the main controller so Bean1 is never found.
I'll see if I can fix this
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520083#520083
16 years, 2 months
[JBoss ESB Development] New message: "Re: Smooks problem"
by Gilles Dupont Tagne Tagne
JBoss development,
A new message was posted in the thread "Smooks problem":
http://community.jboss.org/message/520047#520047
Author : Gilles Dupont Tagne Tagne
Profile : http://community.jboss.org/people/tagnegilles
Message:
--------------------------------------------------------------
Thanks Maurice for the answer. I try to do what you said. But It doesn't work, may be i am doing something wrong
I wrote this class
package de.gilles.projects.splitteresb;
import java.io.IOException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.persistence.EntityManager;
import javax.persistence.Persistence;
import javax.persistence.PersistenceUnit;
import org.milyn.SmooksException;
import org.milyn.container.ExecutionContext;
import org.milyn.delivery.sax.SAXElement;
import org.milyn.delivery.sax.SAXVisitBefore;
import org.milyn.persistence.util.PersistenceUtil;
import org.milyn.scribe.adapter.jpa.EntityManagerRegister;
@PersistenceUnit(name="persistence/personDB",unitName="persondb")
public class DBSaxVisitor implements SAXVisitBefore {
@Override
public void visitBefore(SAXElement arg0, ExecutionContext arg1)
throws SmooksException, IOException {
try {
InitialContext jndiContext = new InitialContext();
EntityManager entityManager = (EntityManager) jndiContext.lookup("persistence/PersonDB");
EntityManagerRegister entityManagerRegister = new EntityManagerRegister(entityManager);
PersistenceUtil.setDAORegister(arg1, entityManagerRegister);
System.out.println("HI GUYS");
} catch (NamingException e) {
// TODO: handle exception
}
}
}
But i don't know whether this wil work
@PersistenceUnit(name="persistence/personDB",unitName="persondb")
public class DBSaxVisitor implements SAXVisitBefore {
I registered the visitor in the dbSmooksConf.xml
<?xml version="1.0" encoding="UTF-8"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
xmlns:ds="http://www.milyn.org/xsd/smooks/datasource-1.1.xsd"
xmlns:db="http://www.milyn.org/xsd/smooks/db-routing-1.1.xsd"
xmlns:dao="http://www.milyn.org/xsd/smooks/persistence-1.2.xsd">
<resource-config selector="#document">
<resource>de.gilles.projects.splitteresb.DBSaxVisitor</resource>
</resource-config>
<jb:bean beanId="personage" class="de.gilles.projects.splitteresb.PersonAge" createOnElement="person">
<jb:value property="id" data="person/id" decoder="Integer"/>
<jb:value property="age" data="person/age" decoder="Integer"/>
</jb:bean>
<dao:inserter beanId="personage" insertOnElement="person"/>
</smooks-resource-list>
I started again. I don't see the output "*HI GUYS*" on the console. I still have this
14:52:21,122 INFO [STDOUT] [Splitter] Message Split complete:
14:52:21,122 INFO [STDOUT] [/Users/gilles/Desktop/ESB/Input/bien.csv.work].
14:52:21,236 INFO [STDOUT] **********************************************************
14:52:21,236 INFO [STDOUT] ** Message Receive from ESB **
14:52:21,237 INFO [STDOUT] **********************************************************
14:52:21,237 INFO [STDOUT]
PersonID: 1
Age: 31
14:52:21,259 INFO [STDOUT] Message:
14:52:21,259 INFO [STDOUT] [1,31].
14:52:21,271 INFO [STDOUT] Message:
14:52:21,271 INFO [STDOUT] [<personliste><person><id>1</id><age>31</age></person></personliste>].
14:52:21,280 INFO [STDOUT] **********************************************************
14:52:21,280 INFO [STDOUT] ** Message Receive from ESB **
14:52:21,280 INFO [STDOUT] **********************************************************
14:52:21,280 INFO [STDOUT]
PersonID: 2
Age: 28
14:52:21,302 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: InVMEpr [ PortReference < <wsa:Address invm://73706c697474657254657374242424242424242424242424646250657273697374/false?false#10000/>, <wsa:ReferenceProperties jbossesb:passByValue : false/> > ] MessageID: 4b427c32-e4a1-432d-a14b-73624bc86a7d
14:52:21,309 INFO [STDOUT] **********************************************************
14:52:21,309 INFO [STDOUT] ** Message Receive from ESB **
14:52:21,309 INFO [STDOUT] **********************************************************
14:52:21,309 INFO [STDOUT]
PersonID: 3
Age: 15
14:52:21,321 INFO [STDOUT] **********************************************************
14:52:21,321 INFO [STDOUT] ** Message Receive from ESB **
14:52:21,321 INFO [STDOUT] **********************************************************
14:52:21,321 INFO [STDOUT]
PersonID: 4
Age: 20
14:52:21,433 INFO [STDOUT] Message:
14:52:21,433 INFO [STDOUT] [2,28].
14:52:21,435 INFO [STDOUT] Message:
14:52:21,435 INFO [STDOUT] [<personliste><person><id>2</id><age>28</age></person></personliste>].
14:52:21,437 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: InVMEpr [ PortReference < <wsa:Address invm://73706c697474657254657374242424242424242424242424646250657273697374/false?false#10000/>, <wsa:ReferenceProperties jbossesb:passByValue : false/> > ] MessageID: b8836712-2aa0-46e3-8bb8-727eff97a792
14:52:21,517 INFO [STDOUT] Message:
14:52:21,517 INFO [STDOUT] [3,15].
14:52:23,222 INFO [STDOUT] **********************************************************
14:52:23,222 INFO [STDOUT] ** Message Receive from ESB **
14:52:23,222 INFO [STDOUT] **********************************************************
14:52:23,223 INFO [STDOUT]
PersonID: 1
Firstame: Max
Lastname: Mustermann
14:52:23,230 INFO [STDOUT] Message:
14:52:23,231 INFO [STDOUT] [<personliste><person><id>3</id><age>15</age></person></personliste>].
14:52:23,233 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: InVMEpr [ PortReference < <wsa:Address invm://73706c697474657254657374242424242424242424242424646250657273697374/false?false#10000/>, <wsa:ReferenceProperties jbossesb:passByValue : false/> > ] MessageID: 414c3e4f-c58a-43f7-a0ec-02254044240c
14:52:23,384 INFO [STDOUT] Message:
14:52:23,384 INFO [STDOUT] [4,20].
14:52:23,390 INFO [STDOUT] Message:
14:52:23,390 INFO [STDOUT] [<personliste><person><id>4</id><age>20</age></person></personliste>].
14:52:23,392 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: InVMEpr [ PortReference < <wsa:Address invm://73706c697474657254657374242424242424242424242424646250657273697374/false?false#10000/>, <wsa:ReferenceProperties jbossesb:passByValue : false/> > ] MessageID: be7026f0-2d0d-4a96-bf3d-4700408538e4
14:52:25,532 INFO [STDOUT] **********************************************************
14:52:25,532 INFO [STDOUT] ** Message Receive from ESB **
14:52:25,532 INFO [STDOUT] **********************************************************
14:52:25,532 INFO [STDOUT]
PersonID: 2
Firstame: Ingrid
Lastname: Duck
14:52:27,591 INFO [STDOUT] **********************************************************
14:52:27,591 INFO [STDOUT] ** Message Receive from ESB **
14:52:27,591 INFO [STDOUT] **********************************************************
14:52:27,591 INFO [STDOUT]
PersonID: 3
Firstame: Bernd
Lastname: Schneider
14:52:28,595 INFO [STDOUT] **********************************************************
14:52:28,595 INFO [STDOUT] ** Message Receive from ESB **
14:52:28,595 INFO [STDOUT] **********************************************************
14:52:28,596 INFO [STDOUT]
PersonID: 4
Firstame: Bettina
Lastname: Klaus
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520047#520047
16 years, 2 months