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 7077971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:29:21+00:00 2026-05-28T06:29:21+00:00

Different between our WAS in dev and our local was Our application is using

  • 0

Different between our WAS in dev and our local was

Our application is using Spring-Security with Spring version 3.1.0-release.

It starts in a JSP file, we are trying to show the connected username:

On WAS in DEV, we have a NotReadablePropertyException :
“Bean property ‘principal’ is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?”

This is because the AuthenticationTag is using a BeanWrapper (BeanWrapperImpl)

At line 729 (Spring 3.1.0-RELEASE) of file BeanWrapperImpl the error is throw,

727:PropertyDescriptor pd = getCachedIntrospectionResults().getPropertyDescriptor(actualName);
728:if (pd == null || pd.getReadMethod() == null) {
729:                throw new NotReadablePropertyException(getRootClass(), this.nestedPath + propertyName);
730:}

So pd is null or pd.getReadMethod() is null.
In normal cases getReadMethod return this :
Object Method[public java.lang.Object org.springframework.security.authentication.UsernamePasswordAuthenticationToken.getPrincipal()]

update
after debugging and adding some logs in the class, it seems that “pd” is null

I wrote this code in pure java to identify the error

    logger.info(session.getAttribute("SPRING_SECURITY_CONTEXT").getClass().toString());
    final SecurityContextImpl sci = ((SecurityContextImpl) session.getAttribute("SPRING_SECURITY_CONTEXT"));
    logger.info(sci.getAuthentication().getClass().toString());
    final Authentication auth = sci.getAuthentication();
    logger.info(auth.getPrincipal().getClass().toString());
    final User u = (User) auth.getPrincipal();
    logger.info(u.getUsername());
    logger.info(SecurityContextHolder.getContext().getAuthentication().getName());

    logger.info("use beanWrapper :");
    final BeanWrapperImpl wrapper = new BeanWrapperImpl(auth);
    String property = "principal";
    Object result = wrapper.getPropertyValue(property);
    logger.info("property : " + property + " value :[" + result.toString() + "]");
    property = "principal.username";
    result = wrapper.getPropertyValue(property);
    logger.info("property : " + property + " value :[" + result.toString() + "]");

log on our WAS in dev :

[2012-01-12 12:23:19,843] INFO  [WebContainer : 8] [c.b.e.e.w.c.IndexController] class org.springframework.security.core.context.SecurityContextImpl
[2012-01-12 12:23:19,843] INFO  [WebContainer : 8] [c.b.e.e.w.c.IndexController] class org.springframework.security.authentication.UsernamePasswordAuthenticationToken
[2012-01-12 12:23:19,843] INFO  [WebContainer : 8] [c.b.e.e.w.c.IndexController] class org.springframework.security.core.userdetails.User
[2012-01-12 12:23:19,843] INFO  [WebContainer : 8] [c.b.e.e.w.c.IndexController] superadmin
[2012-01-12 12:23:19,843] INFO  [WebContainer : 8] [c.b.e.e.w.c.IndexController] superadmin
[2012-01-12 12:23:19,843] INFO  [WebContainer : 8] [c.b.e.e.w.c.IndexController] use beanWrapper :

<500 error>

logs on our local was :

[2012-01-13 08:51:10,062] INFO  [WebContainer : 4] [c.b.e.e.w.c.IndexController] class org.springframework.security.core.context.SecurityContextImpl
[2012-01-13 08:51:10,062] INFO  [WebContainer : 4] [c.b.e.e.w.c.IndexController] class org.springframework.security.authentication.UsernamePasswordAuthenticationToken
[2012-01-13 08:51:10,062] INFO  [WebContainer : 4] [c.b.e.e.w.c.IndexController] class org.springframework.security.core.userdetails.User
[2012-01-13 08:51:10,062] INFO  [WebContainer : 4] [c.b.e.e.w.c.IndexController] superadmin
[2012-01-13 08:51:10,073] INFO  [WebContainer : 4] [c.b.e.e.w.c.IndexController] superadmin
[2012-01-13 08:51:10,073] INFO  [WebContainer : 4] [c.b.e.e.w.c.IndexController] use beanWrapper :
[2012-01-13 08:51:10,095] INFO  [WebContainer : 4] [c.b.e.e.w.c.IndexController] property : principal value :[org.springframework.security.core.userdetails.User@99ac08b4: Username: superadmin; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: SuperAdmin]
[2012-01-13 08:51:10,095] INFO  [WebContainer : 4] [c.b.e.e.w.c.IndexController] property : principal.username value :[superadmin]

Our WAS in dev is a full version,

Our local WAS is a light,free developper version

UPDATE

After coding a workaround to get the userName the problem happen further down the road, still with the BeenWrapperImpl

org.springframework.beans.NotReadablePropertyException: Invalid property 'codeAndName' of bean class [com.data.model.Country]: Bean property 'codeAndName' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
    at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729)
    at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:721)
    at org.springframework.web.servlet.tags.form.OptionWriter.doRenderFromCollection(OptionWriter.java:216)
    at org.springframework.web.servlet.tags.form.OptionWriter.renderFromCollection(OptionWriter.java:186)
    at org.springframework.web.servlet.tags.form.OptionWriter.writeOptions(OptionWriter.java:139)
    at org.springframework.web.servlet.tags.form.OptionsTag.writeTagContent(OptionsTag.java:169)

UPDATE 2 :

problem is more isolated :
without any depenency to spring security, only springmvc,

when a been putted in beanWrapper has no setter corresponding to the getter, it throws a NotReadablePropertyException only on the was in dev.

when there is a setter, then there is no issue.
assuming that the class UsernamePasswordAuthenticationToken is a class from spring security.class.

  • 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-28T06:29:21+00:00Added an answer on May 28, 2026 at 6:29 am

    one solution found :

    probleme is due to the Introduction of ExtendedBeanInfo inf spring3.1

    …

    cf : https://github.com/SpringSource/spring-framework/commit/2f5085aef1e9ac3655a1b1250b6ceca9d0ca3398#diff-0

    so the solution, is to take the previous version of CachedIntrospectionResults
    and put it in the package “org.springframework.beans” so that it will be overwritten,

    but you have to be sure that application classpath is take first.

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

Sidebar

Related Questions

Greetings, Is there a different between using Ajax and jquery to do input valuation
We have replicated our base Ektron site over 100 times (different clients) and between
We have 2500 products on our site, ranked between 60 different categories. Our DB
Is there any performance different between hosting your asp.net in mono on linux and
What is the different between clearfix hack and overflow:hidden vs overflow:auto ? Are all
What's the different between var myObject : Sprite = new Sprite(); and var myObject
Can someone tell me the different between LinkButton.PostBackUrl and HyperLink.NavigateUrl? I've got a asp.net
I realise that the view/controller stuff will be different between Mac and IPhone apps
In javascript, is there any different between these two: // call MyFunction normal way
Could you please explain me, what is the different between API functions AllocConsole 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.