[Design the new POJO MicroContainer] - AOP proxies and field injection
by alesj
I've added org.jboss.test.microcontainer.beans.test.FieldAccessTestCase test.
It checks how beans and field injection play when beans are aspectized.
What I've already mentioned
"alesj" wrote : "kabir.khan(a)jboss.com" wrote :
| | | if (o instanceof org.jboss.aop.proxy.container.AspectManaged)
| | | {
| | | //It is a proxy
| | | }
| | | else if (o instanceof org.jboss.aop.Advised)
| | | {
| | | //It is woven
| | | }
| | | else
| | | {
| | | //Plain class
| | | }
| | |
|
| Do we need such a check?
| e.g. JoinpointFactory
|
| | // perhaps name param is too much
| | boolean isFieldAccesible(Object target, String name);
| |
| Where AOPJpF would do the above mentioned check, and BasicJpF just returned true.
|
but got no response,
is what this test also exposes.
e.g. this is my simple bean
| public class AccessBean
| {
| public String pubString;
|
| public String getPubString()
| {
| return pubString;
| }
| }
|
and I do field injection
| <bean name="public" class="org.jboss.test.microcontainer.beans.support.AccessBean" access-mode="ALL">
| <property name="pubString">foobar</property>
| </bean>
|
but this is what could happen
| AccessBean pb = getBean("public", AccessBean.class);
| assertEquals("foobar", pb.pubString);
| AbstractTypeTestDelegate.Type type = getType("public");
| assertTrue(pb.getPubString() == null || type != AbstractTypeTestDelegate.Type.PROXY);
|
pb.pubString != pb.getPubString() if pb ~ proxy
Perhaps not knowing that my bean is gonna be matched by some pointcut, hence being aspectized, I'm using a mixture of direct public field access and getter. Expecting that using either is the same. Which is not the case here, as the example shows.
Leave it as it is, or hack something to fail or at least produce a loud warning?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137928#4137928
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137928
18 years
[Design of POJO Server] - Re: JBAS-5259, JMS Destination Names is showing as QueueServ
by scott.stark@jboss.org
How are you running the tests? Based on the error it seems the profileservice config has not been created. There is profileservice-config target in the testsuite/build.xml that creates the config and runs the tests. Currently I do see new failures:
| [junit] Running org.jboss.test.profileservice.test.JmsDestinationUnitTestCase
| [junit] Tests run: 5, Failures: 1, Errors: 2, Time elapsed: 2.086 sec
| [junit] Test org.jboss.test.profileservice.test.JmsDestinationUnitTestCase FAILED
| [junit] Running org.jboss.test.profileservice.test.ProfileServiceUnitTestCase
| [junit] Tests run: 22, Failures: 2, Errors: 3, Time elapsed: 4.793 sec
| [junit] Test org.jboss.test.profileservice.test.ProfileServiceUnitTestCase FAILED
|
| Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.jboss.jms.server.destination.QueueServiceMO
| at org.jboss.annotation.factory.AnnotationCreator.visit(AnnotationCreator.java:228)
| at org.jboss.annotation.factory.ast.ASTIdentifier.jjtAccept(ASTIdentifier.java:37)
| at org.jboss.annotation.factory.AnnotationCreator.visit(AnnotationCreator.java:102)
| at org.jboss.annotation.factory.ast.ASTMemberValuePair.jjtAccept(ASTMemberValuePair.java:37)
| at org.jboss.annotation.factory.AnnotationCreator.createAnnotation(AnnotationCreator.java:364)
| at org.jboss.annotation.factory.AnnotationCreator.createAnnotation(AnnotationCreator.java:386)
| at org.jboss.system.metadata.ServiceAnnotationMetaData.getAnnotationInstance(ServiceAnnotationMetaData.java:105)
|
Looking into it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137927#4137927
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137927
18 years
[Design of Messaging on JBoss (Messaging/JBoss)] - Channel.AUTO_RECONNECT
by bstansberry@jboss.com
I noticed that GroupMember does not make these calls on its channels:
| controlChannel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
| dataChannel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
|
This means if these channels detect they've been shunned (kicked out of the group) they won't automatically disconnect() themselves and then connect() themselves to rejoin the group. Is this intentional?
One reason I ask is http://jira.jboss.com/jira/browse/JGRP-651 changed the default behavior of a channel to auto_reconnect=true from false. For 2.4.2 and 2.6.2. So if you didn't want channels to autoreconnect, they now will. In that case, better to set channel.setOpt(Channel.AUTO_RECONNECT, Boolean.FALSE); Either way, probably better to explicitly set the option rather than relying on a default.
That same JIRA inadvertently changed the default for auto_getstate to true as well for 2.4.2 (not for 2.6.2). Having that true will cause the channel to not only reconnect, but also attempt a state transfer. Don't think you want that for your channel that doesn' use STATE_TRANSFER. Don't know about the other one. JIRA to revert the changed 2.4.2 default is http://jira.jboss.com/jira/browse/JGRP-720.
To explicitly set auto_getstate you call channel.setOpt(Channel.AUTO_GET_STATE, Boolean.XXX); Also a good idea to do this explicitly.
Because of these issues I'm recommending that a requested upgrade to JGroups 2.4.2 not be made for EAP 4.3.0.GA_CP01.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137912#4137912
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137912
18 years
[Design of POJO Server] - Re: JBAS-5259, JMS Destination Names is showing as QueueServ
by mark.spritzler
Testsuite for JMS is also failing to run
I get this with both a build downloaded from Hudson, and also the one in the build/output directory
Testsuite: org.jboss.test.profileservice.test.JmsDestinationUnitTestCase
Tests run: 5, Failures: 0, Errors: 5, Time elapsed: 1.375 sec
Testcase: testDLQ took 1.093 sec
Caused an ERROR
Profile root does not exists: C:\JBossServers\jboss-5.0.0.CR1\server\profileservice
org.jboss.profileservice.spi.NoSuchProfileException: Profile root does not exists: C:\JBossServers\jboss-5.0.0.CR1\server\profileservice
at org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository.load(SerializableDeploymentRepository.java:479)
at org.jboss.system.server.profileservice.repository.FileProfileRepository.getProfileDeploymentRepository(FileProfileRepository.java:135)
at org.jboss.system.server.profileservice.repository.ProfileServiceImpl.getProfile(ProfileServiceImpl.java:155)
at org.jboss.profileservice.management.ManagementViewImpl.loadProfile(ManagementViewImpl.java:169)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:56)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:847)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:682)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:635)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:459)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:197)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:203)
at org.jboss.remoting.Client.invoke(Client.java:1685)
at org.jboss.remoting.Client.invoke(Client.java:589)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at AOPProxy$1.loadProfile(AOPProxy$1.java)
at org.jboss.test.profileservice.test.AbstractProfileServiceTest.getManagementView(AbstractProfileServiceTest.java:147)
at org.jboss.test.profileservice.test.JmsDestinationUnitTestCase.testDLQ(JmsDestinationUnitTestCase.java:66)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at AOPProxy$1.loadProfile(AOPProxy$1.java)
at org.jboss.test.profileservice.test.AbstractProfileServiceTest.getManagementView(AbstractProfileServiceTest.java:147)
at org.jboss.test.profileservice.test.JmsDestinationUnitTestCase.testDLQ(JmsDestinationUnitTestCase.java:66)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137908#4137908
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137908
18 years