[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-3623) TestNG for Seam 2.1.0 SP1 war project.
Dan Allen (JIRA)
jira-events at lists.jboss.org
Fri Mar 6 18:23:23 EST 2009
[ https://jira.jboss.org/jira/browse/JBIDE-3623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12455994#action_12455994 ]
Dan Allen commented on JBIDE-3623:
----------------------------------
Great news! I have a solution and an explanation. Let me start with the explanation.
The reason we are seeing two components with the same name, even though there is only one class file, is because the path WEB-INF/dev is being used as both a regular classpath entry and the hot deployment classpath entry. The first one comes from the classpath of the main project.
<classpathentry kind="src" output="view/WEB-INF/dev" path="src/action"/>
That classpath entry is inherited by the test project. Then, the test project defines the following additional classpath entry
<classpathentry kind="lib" path="/testngtest/view"/>
Because of this second entry, Seam finds the WEB-INF/dev folder and activates the hot deployment strategy. So the same component is found by two different deployment strategies (it is loaded twice).
Okay, so that begs the question, why is the hot deployment strategy being used at all. Well, that is what changed between Seam 2.0 and Seam 2.1. We changed how the hot deployment strategy is activated. It used to be that if the jboss-seam-debug.jar was on the classpath (and the hot deployment filter enabled), the hot deployment would be activated. Now, it's controlled by the debug property on the org.jboss.seam.core.init component, which makes more sense. In Seam projects created by JBDS, the default setting for this property is true.
The simplest possible way to correct this problem is to add the following property to test-src/seam.properties in the test project.
org.jboss.seam.core.init.debug=false
Which is exactly what you want. You want debug disabled in the test project. This restores the previous behavior.
Truth be told, we still need to do some work to more clearly define what debug mode means, but this works with today's definition.
> TestNG for Seam 2.1.0 SP1 war project.
> --------------------------------------
>
> Key: JBIDE-3623
> URL: https://jira.jboss.org/jira/browse/JBIDE-3623
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: Seam
> Affects Versions: 3.0.0.CR2
> Environment: WindowsXP SP2
> JBoss Developer Studio
> Version: 2.0.0.CR2
> Build id: jbdevstudio-eap-win32-2.0.0.CR2-N200901221952
> JRE 1.5_08
> Reporter: Aliaksey Nis
> Assignee: Dan Allen
> Priority: Blocker
> Fix For: 3.0.0.GA, 3.0.1.GA, 3.1.0
>
>
> EXECUTE: Create Seam 2.1.0 SP1 war project.
> EXECUTE: Create action for this project.
> EXECUTE: Run test NG for this action.
> FAILURE: Tests failed. Exception appears in console view .
> AILED CONFIGURATION: @BeforeSuite startSeam
> java.lang.IllegalStateException: Two components with the same name and precedence - component name: authenticator, component classes: org.domain.seam21war.session.Authenticator, org.domain.seam21war.session.Authenticator
> at org.jboss.seam.init.Initialization.addComponentDescriptor(Initialization.java:586)
> at org.jboss.seam.init.Initialization.installScannedComponentAndRoles(Initialization.java:927)
> at org.jboss.seam.init.Initialization.installHotDeployableComponents(Initialization.java:797)
> at org.jboss.seam.init.Initialization.init(Initialization.java:716)
> at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:920)
> at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
> ... Removed 15 stack frames
> SKIPPED CONFIGURATION: @BeforeClass setupClass
> SKIPPED CONFIGURATION: @BeforeMethod begin
> SKIPPED CONFIGURATION: @AfterMethod end
> SKIPPED CONFIGURATION: @AfterClass cleanupClass
> SKIPPED: test_action1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list