Seam IllegalStateException: Two components with the same name and precedence - seam

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.

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

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).

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.

make sure the folder WEB-INF/dev is not exported with WAR file.
Delete them if exists.
regards,
Marcus Vinícius Bastos de Andrade

try checking your exploded-archives and see if is updated. This usually occurs when you created a class and used #Name annotation having the same name as your other class, but then decided to delete the class. You think its deleted, but it is still in the exploded-archives.

Related

Qt: access the current settings file from anywhere in the code

Suppose I have a non-qt object. For example, the QT static-only log handler. How does one cause this file handler to know where to go to look for the current configuration file without, say, hard-coding the application name, organization etc. into the static log-handler function?
I have tried defining a global pointer to the configuration that gets initialized during a startup phase, but this turns out to be a hairy problem to solve during the linking phase. Is there some particular "only-way-is-the-best-way" solution?
(New to QT; if there is an "accepted" or "intended" approach, I would like to take that)
May be create global singleton class?
Or set QSettings::setDefaultFormat() to ini near your binary?

Symfony2: How to override a single service from the bundle, with my own class?

This seems like it should be the most basic thing to do, but I cannot find any info on it. If bundle defines multiple services, how can I override single service with my own?
For example if I have one bundle with defined service, which is being used by another services of that bundle, because it implements certain interface:
myapp_user.user.factory:
class: MyApp\UserBundle\User\UserFactory
arguments: ["#myapp_user.user.config_manager"]
I would like to override this service with my own, like that:
myapp_user.user.factory:
class: MyApp2\UserBundle\User\UserFactory
arguments: ["#myapp_user.user.config_manager"]
I thought that it should be very simple, isn't the whole container idea about - being able to easily switch services/dependencies? However I cannot find any information on it. There is information about creating "parent" bundle, and overriding "file with definition of services", but nothing about single services. Am I missing something? I really don't want to use "parent bundle" thing for replacing just one service with my own.
Thanks to Raphaël Malié I figured out the answer. The problem was indeed with the order of imports of files with declared services. Silly me :) .

Is the default constructor created if I provide another one?

I haven't found anything about this.
In PL/SQL, if I provide a constructor for an object, the default one will still be created, or it's like in C++ or Java?
Yes, the default constructor is still there. Incidently, if you create another constructor with the same name and arguments you'll get an error PLS-307: too many declarations of ... when you try to use it.

How do I call GetLocalResource in another class

So I have Test1.aspx, Test1.aspx.vb. The LocalResource files, in the App_LocalResources folder, Test1.aspx.resx and Test1.aspx.es.resx. I also have a class called TestTheData.vb in the App_Code folder.
Now what I want to do is call GetLocalResource("stringObjRes").ToString in the TestTheData.vb class. The method however is not showing up in Intellisense. When I try to type manually, I get the error lines in my code.
I've imported:
Globalization
Threading
Threading.Thread
Web
Web.UI.Page.
No luck. So how I am supposed to do this....?
Well it seems that Local Resources can't be accessed in files that are in the App_Code folder. So I used Global Resources instead.
I know it's 1 year old but I just added the comment if some others are also searching for this:
Your guess is right, you cannot access the Local Resource Object from another class. GetLocalResourceObject only exists within the code of the page, in your case Test1.aspx.vb. If you are calling the class function from your Test1.aspx.vb you could of course retrieve the Local resource from there and then supply it to your TestTheData.vb as a parameter. But if you need the 'stringObjRes' in several places (not only in Test1.aspx) then a global resource is of course preferred. Details here: http://msdn.microsoft.com/en-us/library/ms227982(v=vs.100).aspx

Force Flash Builder 4 to compile all source files

According to the answers to this question here, the reason why I'm not seeing errors as I work in Flash Builder is that FB is "optimizing" them out because they aren't referenced at any point in the code execution. Is there an option to force Flash Builder to compile all files regardless of whether they're used in the software? This would make my development process a lot more intuitive.
The only way to do this is to actually reference the class somewhere in code that you know actually is being compiled, such as the Document Class in a .fla, or your Main.as file in a pure AS3 project. It can be as simple as declaring a variable of the given type, even if no value is ever assigned to it.
private var complieMe:OtherwiseUnreferencedClass;
// ^ This will cause your class to be compiled.
You need to reference each class somewhere in your project. The easiest/shortest way I've found to do this is to add an import followed by the class name in some common place, such as a script block in Main.mxml, although it really doesn't matter where:
import some.package.MyClass; MyClass;
Hope that helps.

Resources