File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Duplicate component Error in JSF 1.2 with Jboss AS 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Duplicate component Error in JSF 1.2 with Jboss AS 7" Watch "Duplicate component Error in JSF 1.2 with Jboss AS 7" New topic
Author

Duplicate component Error in JSF 1.2 with Jboss AS 7

Ifta Khirul
Greenhorn

Joined: Nov 27, 2012
Posts: 6
Hi,

We are currently migrating our application from Jboss 5 to Jboss 7.
Our application used JSF 1.2 . We are not going to change the JSF version now.

There was a piece of code that worked with jboss 5 but not with jboss 7. Check below for that code -

<x:selectManyListbox tabindex="5" title="Counter names and indexes" value="#{counterJob.jsfSelectedIndexedCounterNames}" id="indexed_counter_names" forceId="true" size="8">
<f:selectItems value="#{counterJob.jsfIndexedCounterNames}" id="indexed_counter_names" />
</x:selectManyListbox>

Here both selectManyListbox and selectItems holds a common id named-> indexed_counter_names .
But in Jboss 5 AS this was not a problem and we got no error.

When we shifted to Jboss 7 then it created a problem and showed a Duplicate Component Id error.
I have changed the id for selectedItems and then it worked perfectly in Jboss 7.


Here is my question - we have not changed the JSF version.
So why does it shows different behavior in Jboss Application Server (Jboss 5 and Jboss 7) ?

Any explanation regarding this matter will help me to understand the scene behind the behavior.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

Welcome to the JavaRanch, Ifta!

Actually, this should have always been a problem!

The "id" attribute is special. It's actually part of the core XML spec, and it carries a constraint: Each id value in an XML file MUST be unique. This is true whether the XML is JSF, SOAP, or any random XML format you may device.

So your original xhtml should have failed XML validation and that means that effectively JBoss has fixed a bug.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ifta Khirul
Greenhorn

Joined: Nov 27, 2012
Posts: 6
Hi Tim,

Thanks for the explanation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Duplicate component Error in JSF 1.2 with Jboss AS 7