Skip to main content

Problems accessing embbeded ejb from JSF

5 replies [Last post]
hpollak
Offline
Joined: 2010-01-14
Points: 0

Hi!!!!

Im using Netbeans 6.8 and writing a little web-app.

I have a embeddable class Address:

@Embeddable
public class Address implements Serializable {
private String address;
private String city;
private String zip;
private String country;
private String county;
...

and a class Person:

@Entity
public class Person implements Serializable {

/**
*
*/
private static final long serialVersionUID = -8780664586755077196L;

@Id
@GeneratedValue
@Column(name = "PERSON_ID")
private Long id;

private String title;
private String firstname;
private String midname;
private String surename;

@Embedded
private Address address;
...

when the classes i deploy the classes and take a look at the log, it looks ok:

CREATE TABLE PERSON (PERSON_ID BIGINT NOT NULL, DTYPE VARCHAR(31), TITLE VARCHAR(255), PHONE VARCHAR(255), SURENAME VARCHAR(255), EMAIL VARCHAR(255), FIRSTNAME VARCHAR(255), MIDNAME VARCHAR(255), MOBILE VARCHAR(255), ZIP VARCHAR(255), ADDRESS VARCHAR(255), COUNTY VARCHAR(255), CITY VARCHAR(255), COUNTRY VARCHAR(255), VERSION INTEGER, GROUP_ID BIGINT, PRIMARY KEY (PERSON_ID))"

but I cannot access the fields of Address from JSF.

but

works.

Have I done any thing wrong?

best regards
Harry

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hpollak
Offline
Joined: 2010-01-14
Points: 0

Sorry!

There was a misstake by the JSF-Tags.
The correct code is:


The error messages in the log:

WARNUNG: /common/person/Create.xhtml @31,138 value="#{personController.selected.address.city}": Target Unreachable, 'null' returned null
javax.el.PropertyNotFoundException: /common/person/Create.xhtml @31,138 value="#{personController.selected.address.city}": Target Unreachable, 'null' returned null
at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:93)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95)
at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1008)

skl
Offline
Joined: 2010-01-07
Points: 0

I am running into the exact problem. Has anyone figured this one out?

hpollak
Offline
Joined: 2010-01-14
Points: 0

Does nobody has an idea for the problem I and skl run into? I have no solution found until yet.

Celinio Fernandes

hi,
does the new tag have to be inside The API doc says that "this must be a child of the ."

https://javaserverfaces.dev.java.net/nonav/docs/2.0/pdldocs/facelets/ind...

However if i put if before the tag, it still works.

Is that normal behaviour ?

Thanks.

[att1.html]

hpollak
Offline
Joined: 2010-01-14
Points: 0

Sorry!

Can not understand, unfortunately that has to do with the replay of my question

Harry