Monday, January 16, 2006

JSF 1.2 doesn't work on Glassfish b31 ?

It seems to me true. I've tried hard to make it work and accomplish my presentation showing JSF 1.2 but it just doesn't work. Any attempt to call or ahow anything from JSF fails with uknown exception. Even supplied examples fail the same way.
So I decided to create rich servlet accompanying servlet 2.5 features with some JAXB and on client side uses OpenRico AJAX framework. Perhaps it sounds as tough task, but actually it isn't. Integrations will be very easy as JAXB uses annotations as well as servlet, so everything I will need to do is to annotate my entity classes and add annotation to servlet. And of course, publish several AJAX methods ...
Anyway, this weekend I even had to deal with camplex EJB3 entity mapping. Project Dali is really buggy (unable to create entity classes) so used JDeveloper 10.1.3. It created entities but ManyToMany mapping is invalid and ManyToOne dosn't conform specification. I didn't solve the first problem but the second one can be easily fixed by editing field annotations to contain only OneToMany (delete the JoinColumn annotation) pointing to referenced class and counterpart class should use JoinColumn annotation together with bare ManyToOne.

@ManyToOne()
//targetEntity=org.defectus.ejb3.ic2.entity.Departments.class)
@JoinColumn(name = "EMPLOYEES.DEPARTMENT_ID", referencedColumnName = "DEPARTMENTS.DEPARTMENT_ID")


@OneToMany(targetEntity=org.defectus.ejb3.ic2.entity.Employees.class)
//@JoinColumn(name="EMPLOYEES.DEPARTMENT_ID", referencedColumnName="DEPARTMENTS.DEPARTMENT_ID")
Hope that is clear - commented parts are these which were generated by JDeveloper but were not valid.

No comments: