Skip to content

Spring Controller annotated with @JsonView and hibernate4 #73

Open
@bademux

Description

@bademux

Hello,
It isn't a bug, bug nasty behavior.
I configure my MappingJackson2HttpMessageConverter for using ObjectMapper and Hibernate4Module with SessionFactory

Spring along @JsonView-aware Controller has been used
see for more info: "Jackson’s @JsonView is supported directly on @ResponseBody"

I supposed that all Lazy fields will be initiated and serialized, but got "could not initialize proxy - no Session" on

@ManyToOne(fetch = FetchType.LAZY, optional = false) 
private Test test;

exception goes from
com.fasterxml.jackson.datatype.hibernate4.HibernateProxySerializer#findProxied

return init.getImplementation(); 

Is it expected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions