[jboss-dev-forums] [Design of JBoss internal QA (Test Suite)] - TestNG throws exception if @PersistenceContext is used in a

rizqureshi2 do-not-reply at jboss.com
Tue Oct 9 14:17:41 EDT 2007


I get the following error when I have a bean with @PersistenceContext declaration:
("register" is the name of bean used)

FAILED CONFIGURATION: @BeforeClass init
java.lang.RuntimeException: Could not create Component: register
	at org.jboss.seam.init.Initialization.addComponent(Initialization.java:833)
	at org.jboss.seam.init.Initialization.addComponents(Initialization.java:715)
	at org.jboss.seam.init.Initialization.init(Initialization.java:478)
	at org.jboss.seam.mock.SeamTest.init(SeamTest.java:701)
Caused by: java.lang.IllegalArgumentException: @PersistenceContext may only be used on session bean or message driven bean components: register
	at org.jboss.seam.Component.initMembers(Component.java:541)
	at org.jboss.seam.Component.(Component.java:250)
	at org.jboss.seam.Component.(Component.java:200)
	at org.jboss.seam.init.Initialization.addComponent(Initialization.java:823)
	... 25 more
... Removed 22 stack frames

-----------------------------------------------------------------------------
I have been working on this problem for days and no success yet. Am I missing out something? Also note that the project deploys & runs fine on JBoss-As without any problem, so why should the TestNG case throw the above exception??


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093162#4093162

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093162



More information about the jboss-dev-forums mailing list