Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7167921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:40:30+00:00 2026-05-28T14:40:30+00:00

When I access a JPA managed date value from JSF, it comes back with

  • 0

When I access a JPA managed date value from JSF, it comes back with an javax.faces.component.UdateModelException saying

'Cannot convert 01.01.10 00:00 of type class java.util.Date to class org.apache.openjpa.util.java$util$Date$proxy 

Using a JPA-managed date value (which means it is proxied) works fine when it is used directly from the EL likes this:

'<h:outputLabel value="MyDateValue" for="input"/> 
'<h:inputText id="inputDate" value="#{bean.myDate}"/> 

However, it causes trouble when trying to use it with composite components
and gives back the following converter exception and thus can’t update the model…

The (simplified) JSF composite component inputDate.xhtml

    <head> 
            <title>A date input field</title> 
    </head> 

    <composite:interface> 
            <composite:attribute name="dateValue"/> 
    </composite:interface> 

    <composite:implementation> 
            <h:outputLabel value="MyDateValue" for="input"/> 
            <h:inputText id="input" value="#{cc.attrs.dateValue}"/> 
    </composite:implementation> 

Assumption:
It seems the proxy replacement in OpenJPA is handled differently when the value is being accessed from inside a composite. My guess is the EL-resolver handles calls to object values differently when it is passed to composites. Passing it to composites means it is first accessed within the composite, which is too late and the required replacement of the proxy is not accomplished (thus the converter exception)

So I tried to change the Expression Language for MyFaces, but it didn’t work in Websphere, even though I changed the class loading to parent last and provided el-impl and el-api from glassfish in the lib folder and inserted the necessary context-param for MyFaces

How do you guys use JPA-managed dates (or other proxied entities) in composite components???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:40:31+00:00Added an answer on May 28, 2026 at 2:40 pm

    If you are using the sun EL implementation you might use the following ELResolver which works around this issue:

    public class BugfixELResolver extends ELResolver {
    //...
    @Override
    public Class<?> getType(ELContext anElContext, Object aBase, Object aProperty) {
        if (aBase.getClass().getCanonicalName().equals("com.sun.faces.el.CompositeComponentAttributesELResolver.ExpressionEvalMap")){
            Object tempProperty=((Map)aBase).get(aProperty);
            if (tempProperty!=null&&tempProperty.getClass().getCanonicalName().equals("org.apache.openjpa.util.java.util.Date.proxy")) {
                anElContext.setPropertyResolved(true);
                return java.util.Date.class;
            }
        }
        return null;
    }
    
    
    }
    

    Add it to the faces-config this way:

    <el-resolver>
        xxx.BugfixELResolver
    </el-resolver>
    

    This workaround can also be used in environments where you can not change the EL implementation (like websphere etc.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been building a JSF application using JPA to access the DB. There
In a Java application stack with Spring & Hibernate (JPA) in the Data Access
I am using a JEE6 stack including JPA 2.0, JSF 2.0, EJB 3.1 etc.
I am using JPA to access an Oracle database which has its encoding set
My application uses JPA to access the backend database. I have a Java class
I developed a Spring JPA project in eclipse wich access to the data stored
I have working app1.ear , containing: JPA entity, MyObjectImpl , implementing interface MyObject from
We're currently developing a J2EE web app using JPA as our data access layer.
I have a JPA query of the form: SELECT category, count(*) AS c FROM
I am investigating using JPA for my Data Access code. I am trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.