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

  • SEARCH
  • Home
  • 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 8986283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:30:48+00:00 2026-06-15T21:30:48+00:00

I have problem with JSF beans using Spring managed services. I got an error

  • 0

I have problem with JSF beans using Spring managed services. I got an error telling, that spring bean used in JSF bean is not serializable.

@ManagedProperty("#{customerService}")
private CustomerService customerService;

I can’t make the service serializable, because it is using JdbcTemplate which itself isn’t serializable. Moreover, serializing Spring beans which have application scope makes no sense at all, so I don’t understand, why someone’s code is attempting to serialize them.

I have worked with JSF project using Spring services, and there were no such issues, so such cooperation must be possible. But this project is made from scratch based on example projects, so there must be something wrong with the configuration of spring-JSF cooperation, but I don’t know where to search.

The configuration of Spring for JSF is:

<!-- JSF and Spring are integrated -->
<application>
    <el-resolver>
        org.springframework.web.jsf.el.SpringBeanFacesELResolver
    </el-resolver>
</application>

How to solve this issue?

  • 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-06-15T21:30:49+00:00Added an answer on June 15, 2026 at 9:30 pm

    There is no way to avoid JSF serialization mist. Even ApplicationScoped beans are serialized (when they are injected into other beans).

    But the solution was made on the Spring side. You have to use scoped proxy.

    To wrap the bean into serializable proxy you have to add to bean body:

    <aop:scoped-proxy proxy-target-class="true"/>
    

    The spring aop namespace and spring-aop dependency must be added.

    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
    

    And this is it! In the bean will be the serializable element, the proxy that will re-load bean from Spring context on deserialization.

    The only mist here is that I have to create cglib class-level-proxy. JRE proxy was not working because the interface was not available during deserialization… I don’t understand fully why but I have working solution at least.

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

Sidebar

Related Questions

Problem Description: My injected Spring bean defined as a Managed-Property to a JSF backing
I m creating an app using JSF. The problem I have is that every
I have a project using JSF primefaces and EJB managed Beans with hibernate storage.
First of all, my beans are managed by spring not by JSF and I
Suppose that I have Spring service classes or JSF beans. I wire these classes
I have an Entity/JSF Managed Bean Ticket that represents a helpdesk ticket. It has
I'm using JSF 2.0 with GlassFish 3.0. I have the following Managed Bean: @ManagedBean
I have the following problem with the timeouts in Spring Security with JSF: I've
I have some JSF-trouble using h:selectOneMenu with a list from my backend bean: My
I'm using JSF/ICEFaces. I have a table that have many rows with values and

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.