• Post Reply Bookmark Topic Watch Topic
  • New Topic

[JSF] Duplicate component id  RSS feed

 
Marco Tulio Borges
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 ]
 
Varun Khanna
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 ]
 
Shawn Xie
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)...


 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to our brand new JSF Forum...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!