[JBoss AOP] - Re: How to have test-aop.xml.I dont want to write the test
by system.out
"flavia.rainone(a)jboss.com" wrote : Hi!
|
| I can think of two alternatives for your problem.
|
| One of them is to write your xml file with whatever name you want (like test-aop.xml) and configure the property jboss.aop.path. This property should point to a classpath where this file is present. That way, JBoss AOP will detect and load your test-aop.xml file only when this property is enabled.
|
| Another approach would be more elegant, however, if you have aspects that are exclusive to your test mode. This second approach consists of putting those aspects in a directory or jar file, and adding a META-INF/jboss-aop.xml file to this dir or jar file. In this xml file, you put all the bindings and other configuration that must be enabled for test mode. To make JBoss AOP detect your jar (or directory) and its xml file, you just need to add it to classpath. When you want to run your application in normal mode, run it without this jar/directory in the classpath.
In the second alternative: I have my ear in deploy dirctory (with embeded *.aop). To extend it with testing interceptors, I can add a jar including all new interceptors + new jboss-aop.xml under /deploy (or /lib - is it the same as adding to classpath you are refering to ?!) directory and upon deployment of my ear it should be instrumented with all old and testing aspects. Is that correct?
If yes, what is the best way to add dependency of testing jar to my ear before start of instrumentation?
Thanks,
Mike
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074544#4074544
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074544
18Â years, 11Â months
[JBoss Messaging] - ListAllMessages return no messages using RMI, but no problem
by hendra_netm
Hi guys,
Previously, I test JBM mbean features using jmx-console from jboss.
Using HTTP adaptor, all features work fine.
However, when I am trying to use rmi, programmatically call listAllMessage, the returned list is empty, eventhough there are messages in the queue.
Other JMX method can be called without problem, and give expected result.
I have tried both JBM 1.3.0.G.A and 1.4.0.CR1, with the same result.
Is it bug, or is there any configuration that I should set beforehand?
Have anyone met the same problem?
Thank you in advance.
Best Regards,
Hendra
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074542#4074542
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074542
18Â years, 11Â months
[JBoss Seam] - Re: TransactionalSeamPhaseListener + Spring @Transactional
by youngm
Sorry my quotes got alittle messed up. :)
anonymous wrote : Hi,
|
| thank you for your helpful answer. I plan to have a seam independent persistence and service layer using spring + JPA and only use seam in the web layer because of its powerful JSF enhancements.
|
| Do I understand it right:
| 1. It is possible to use spring manged the local transaction instead of JTA, but I need the RC1 or the SNAPSHOT of Seam. It is not possible with the Beta1. It is important for me, because the application must run both on JBoss and Tomcat. I want to know whether it is necessary to install the embedded-jboss in Tomcat, so that I can use JTA.
|
You only need RC1 or snapshot if you wish to use spring managed local transactions that are automatically created and committed by seam in a faces request. Of if you want to use Seam's @Transactional annotation.
anonymous wrote :
| 2. Can I use JpaTransactionManager together with RESOURCE_LOCAL tx in persistence.xml. I managed to have a working version with embedded-jboss and JTA. I would like to see it also working with local tx.
|
Yes you can use JpaTransactionManager and do transaction management in spring and not have to use the embedded-jboss and jta.
anonymous wrote :
| 3. Do I have to use seamEntityManagerFactory,or can I also use Spring LocalContainerEntityManagerFactoryBean? What is the main job of seamEntityManagerFactory?
|
If you configure it the way I described above you will be using the Spring LocalContainerEntityManagerFactoryBean. It will be configured such that spring provides the EntityManagerFactory. Seam provides it's conversation scoped EntityManager and then SeamManagedEntityManagerFactoryBean takes the Seam conversation scoped EntityManager and exposes it as another EntityManagerFactoryBean that can then be used by JpaTransactionManager to start and stop transactions and used by PersistenceAnnotationBeanPostProcessor to inject the Seam conversation scoped EntityManager into your spring beans. Which reminds me you will also need to update your PersistenceAnnotationBeanPostProcessor to:
<bean id="org.springframework.context.annotation.internalPersistenceAnnotationProcessor" class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
| <property name="defaultPersistenceUnitName" value="seamEntityManagerFactory"/>
| </bean>
|
So that Spring will know that @PersistenceContext should inject the seam entitymanager instance instead of creating a new spring managed one.
anonymous wrote :
| 4. The same question applies to persistence context. Does it need to be managed by seam or can it also be managed by Spring?
|
Configured the way I told you the PersistenceContext will be managed by Seam. If you want to take advantage of Seam's Conversation scoped PersistenceContexts then that is the way it will need to be. This in no way limits your ability to execute code asynchronously or outside of a Seam request though. Take a look at the spring-seam example. In there I was actually executing a spring configured timer task on a bean that used a Seam managed persistenceContext.
There is nothing that says you cannot use a Spring managed Entitymanager it just means you won't be able to take advantage of a Conversation scoped EntityManager.
Is there a particular reason why you would want to use a Spring managed EntityManager?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074533#4074533
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074533
18Â years, 11Â months
[JBoss Seam] - Re: TransactionalSeamPhaseListener + Spring @Transactional
by youngm
anonymous wrote : Hi,
|
| thank you for your helpful answer. I plan to have a seam independent persistence and service layer using spring + JPA and only use seam in the web layer because of its powerful JSF enhancements.
|
| Do I understand it right:
| 1. It is possible to use spring manged the local transaction instead of JTA, but I need the RC1 or the SNAPSHOT of Seam. It is not possible with the Beta1. It is important for me, because the application must run both on JBoss and Tomcat. I want to know whether it is necessary to install the embedded-jboss in Tomcat, so that I can use JTA.
|
You only need RC1 or snapshot if you wish to use spring managed local transactions that are automatically created and committed by seam in a faces request. Of if you want to use Seam's @Transactional annotation.
anonymous wrote :
| 2. Can I use JpaTransactionManager together with RESOURCE_LOCAL tx in persistence.xml. I managed to have a working version with embedded-jboss and JTA. I would like to see it also working with local tx.
| anonymous wrote :
| | Yes you can use JpaTransactionManager and do transaction management in spring and not have to use the embedded-jboss and jta.
| |
| anonymous wrote :
| | 3. Do I have to use seamEntityManagerFactory,or can I also use Spring LocalContainerEntityManagerFactoryBean? What is the main job of seamEntityManagerFactory?
| |
| If you configure it the way I described above you will be using the Spring LocalContainerEntityManagerFactoryBean. It will be configured such that spring provides the EntityManagerFactory. Seam provides it's conversation scoped EntityManager and then SeamManagedEntityManagerFactoryBean takes the Seam conversation scoped EntityManager and exposes it as another EntityManagerFactoryBean that can then be used by JpaTransactionManager to start and stop transactions and used by PersistenceAnnotationBeanPostProcessor to inject the Seam conversation scoped EntityManager into your spring beans. Which reminds me you will also need to update your PersistenceAnnotationBeanPostProcessor to:
|
| <bean id="org.springframework.context.annotation.internalPersistenceAnnotationProcessor" class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
| | <property name="defaultPersistenceUnitName" value="seamEntityManagerFactory"/>
| | </bean>
| |
|
| So that Spring will know that @PersistenceContext should inject the seam entitymanager instance instead of creating a new spring managed one.
| anonymous wrote :
| | 4. The same question applies to persistence context. Does it need to be managed by seam or can it also be managed by Spring?
| |
|
| Configured the way I told you the PersistenceContext will be managed by Seam. If you want to take advantage of Seam's Conversation scoped PersistenceContexts then that is the way it will need to be. This in no way limits your ability to execute code asynchronously or outside of a Seam request though. Take a look at the spring-seam example. In there I was actually executing a spring configured timer task on a bean that used a Seam managed persistenceContext.
|
| There is nothing that says you cannot use a Spring managed Entitymanager it just means you won't be able to take advantage of a Conversation scoped EntityManager.
|
| Is there a particular reason why you would want to use a Spring managed EntityManager?
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074532#4074532
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074532
18Â years, 11Â months
[JBoss Seam] - Re: TransactionalSeamPhaseListener + Spring @Transactional
by dapeng
Hi,
thank you for your helpful answer. I plan to have a seam independent persistence and service layer using spring + JPA and only use seam in the web layer because of its powerful JSF enhancements.
Do I understand it right:
1. It is possible to use spring manged the local transaction instead of JTA, but I need the RC1 or the SNAPSHOT of Seam. It is not possible with the Beta1. It is important for me, because the application must run both on JBoss and Tomcat. I want to know whether it is necessary to install the embedded-jboss in Tomcat, so that I can use JTA.
2. Can I use JpaTransactionManager together with RESOURCE_LOCAL tx in persistence.xml. I managed to have a working version with embedded-jboss and JTA. I would like to see it also working with local tx.
3. Do I have to use seamEntityManagerFactory,or can I also use Spring LocalContainerEntityManagerFactoryBean? What is the main job of seamEntityManagerFactory?
4. The same question applies to persistence context. Does it need to be managed by seam or can it also be managed by Spring?
Thanx a lot.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074528#4074528
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074528
18Â years, 11Â months