tags:

views:

205

answers:

4

Hi,

When I run my seam application I get the following error

Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
java.lang.IllegalStateException: Two components with the same name and precedence - component name: wizardController, component classes: package.WizardController, package.WizardController
    at org.jboss.seam.init.Initialization.addComponentDescriptor(Initialization.java:543)
    at org.jboss.seam.init.Initialization.installScannedComponentAndRoles(Initialization.java:809)
    at org.jboss.seam.init.Initialization.scanForComponents(Initialization.java:756)
    at org.jboss.seam.init.Initialization.init(Initialization.java:629)
    at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:35)

I am not able to resolve this problem.

+1  A: 

Seems like you have two components with the name wizardController. Try searching for wizardController and see if you find any duplicates somewhere.

Shervin
+1  A: 

You define the same component twice. Look if you have forgotten a @Name("componentName") inside your code and the same component definition in components.xml.

Or the same @Name("componentName") in two or more classes (copy-pasted and forgot to change the component name).

Markos Fragkakis
A: 

Assuming you don't have two classes with the same component name:

This sometimes happens if you have renamed a component and didn't clean out your build/deploy directories. The old .class and the new .class with the same component names will still get deployed.

Clean and re-deploy. That should fix it.

Ashish Tonse
A: 

make sure the folder WEB-INF/dev is not exported with WAR file. Delete them if exists.

regards, Marcus Vinícius Bastos de Andrade

Marcus Vinícius Bastos