JSF - ICE FACES - Target Unreachable

1 resposta
rafaelgaldino

Ae pessoal tou fazendo uma aplicação com JSF e ICE Faces, mais toda vez que eu vou carregar um

<h:outputText value="Nivel Restricao:"/>
                                    <ice:selectOneMenu id="nivelRestricao" value="#{segmentoMercado.nivelRestricaoCollection.nivelRestricao.id}" title="NivelRestricao">
                                        <s:selectItems  value="#{segmentoMercadoController.nivelRestricao}" 
                                                        var="nivel" 
                                                        label="#{nivel}"
                                                        noSelectionLabel="Selecione um nivel de restricao..."/>
                                        <s:convertEntity /> 
                                    </ice:selectOneMenu><br/>

Dá sempre esse Erro:

sourceId=j_id69:nivelRestricao[severity=(ERROR 2), summary=(/prospeccao/segmentoMercado/edit.xhtml @183,167 value="#{segmentoMercado.nivelRestricaoCollection.nivelRestricao.id}": Target Unreachable, 'nivelRestricaoCollection' returned null on 'br.com.det.facz.entity.SegmentoMercado'), detail=(/prospeccao/segmentoMercado/edit.xhtml @183,167 value="#{segmentoMercado.nivelRestricaoCollection.nivelRestricao.id}": Target Unreachable, 'nivelRestricaoCollection' returned null on 'br.com.det.facz.entity.SegmentoMercado')]

O meu Back-Bean tá assim...

public class SegmentoMercado extends EntityBase implements Serializable {
@Id
    @Column(name = "SGM_ID", nullable = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "SGM_Nome", nullable = false)
    private String nome;

    @Column(name = "SGM_Desc")
    private String descricao;

    @Column(name = "SGM_Hierarquia", nullable = false)
    private String hierarquia;
    
    @OneToMany(mappedBy = "segMercado")
    private Collection<Cedente> cedenteCollection;    

    @OneToMany(mappedBy = "segmentoSegPai")
    private Collection<SegmentoMercado> segmentoMercadoCollection;

    @JoinColumn(name = "SGM_SGM_SegPai", referencedColumnName = "SGM_ID")
    @ManyToOne
    private SegmentoMercado segmentoSegPai;
    
    @OneToMany(cascade = {CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE}, mappedBy = "segmentoMercado")
    private Collection<SegmentoMercadoCnae> cnaeCollection;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "segmentoMercado", fetch=FetchType.EAGER)
    private Collection<SegmentoMercadoNivelRestricao> nivelRestricaoCollection;

Algéum sabe como resolver o problema? Valeu!

1 Resposta

Ferryman

Eae cara,

Seu problema é fácil de resolver… olha a mensagem…

Target Unreachable, ‘nivelRestricaoCollection’ returned null on ‘br.com.det.facz.entity.SegmentoMercado’)

Isso significa que vc esqueceu de instanciar nivelRestricaoCollection que ta na classe SegmentoMercado.

[]s
Ferry

Criado 25 de janeiro de 2008
Ultima resposta 25 de jan. de 2008
Respostas 1
Participantes 2