Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

[JSF] Duplicate component id

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having lots of trouble trying to make a JSF page work properly. The thing is: I keep getting the exception "java.lang.IllegalStateException: Duplicate component id: 'form1:aLabel'" even when I comment all the code in the JSF page. I'm using JBoss 4.0.0 (and I've cleaned the tmp dir, restarted the server and everything).

Any ideas? The exception is:

Originally written in JBoss window:
java.lang.IllegalStateException: Duplicate component id: 'form1:aLabel', first used in tag: 'com.sun.faces.taglib.html_basic.OutputLabelTag'
javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:434)
com.sun.faces.taglib.html_basic.OutputLabelTag.doStartTag(OutputLabelTag.java:356)
org.apache.jsp.cadastroDeAluno_jsp._jspx_meth_h_outputLabel_38(cadastroDeAluno_jsp.java:3416)
org.apache.jsp.cadastroDeAluno_jsp._jspx_meth_h_form_0(cadastroDeAluno_jsp.java:754)
org.apache.jsp.cadastroDeAluno_jsp._jspx_meth_hx_scriptCollector_0(cadastroDeAluno_jsp.java:196)
org.apache.jsp.cadastroDeAluno_jsp._jspx_meth_f_view_0(cadastroDeAluno_jsp.java:167)
org.apache.jsp.cadastroDeAluno_jsp._jspService(cadastroDeAluno_jsp.java:133)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

.
.
.
(and then it goes)



Using: JBoss 4.0.0, IBM implementationf for JSF
Edited to add the versions of products used
[ January 04, 2005: Message edited by: M. Tulio Borges ]
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try if any of the solution mentioned in this thread works for you.

For me, restarting the server works
 
Marco Tulio Borges
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by K Varun:
Try if any of the solution mentioned in this thread works for you.



Well... The error, as I said, happens even when I comment all the code... And, sorry, I should have mentined it before, it also happens at the first time I open the page, right after JBoss starts. So, I can't see where can I put the

Originally posted by magicval in Java Forums:



to make it work... Any ideas?
 
Marco Tulio Borges
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, and I already read the Topic "JSF - Duplicate Component Id Exception" in this forum... Still, couldn't get it to work...

- Bad JSF! Bad JSF!
 
Marco Tulio Borges
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, ok... It's was a strange error, but it gets a lot more strange now: I just deleted the component with the "Duplicated id". Just removed the label from my page, saved, deployed, opened it and... The error is still there... I searched my code for anything with that String (the "Duplicated id") and... THERE'S NOTHING LIKE IT!! More: I looked into JBoss dir and my code is up-to-date there (I believe then that the deploy was successfuly made)... I'm shocked! Do I have anything to do here or do I have to start going to church on Sunday?
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by M. Tulio Borges:
<hr></blockquote>

to make it work... Any ideas?[/QB]



Try putting it in any init method inside the page, which is executed prior to page getting loaded.
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by M. Tulio Borges:
Just removed the label from my page, saved, deployed, opened it and... The error is still there...


Did you restarted the server ?
 
Marco Tulio Borges
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by K Varun:


Try putting it in any init method inside the page, which is executed prior to page getting loaded.



Yes, I tried.

Originally posted by K Varun:

Did you restarted the server ?



Yes...


Still, the same problem...

Editted to correct a problem with QUOTE tag
[ January 05, 2005: Message edited by: M. Tulio Borges ]
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same problem also bothers me a lot and even made me think is JSF friendly to developers. Later on, I found a workaround: make up a unique id for every component. This is not a clean solution, e.g. why I have to care about id for a simple lable? But it seems work.
 
Marco Tulio Borges
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Shawn Xie:
I found a workaround: make up a unique id for every component. This is not a clean solution, e.g. why I have to care about id for a simple lable? But it seems work.




Ok, I'll try, but I don't think it will work, because the label that is "duplicate" doesn't exist anymore, and searching my entire app, I coudn't find anything with that name (id)...


 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to our brand new JSF Forum...
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!