Results 1 to 3 of 3

Thread: NoSuchFieldError Exception throwed when running in Websphere

  1. #1
    Join Date
    May 2006
    Posts
    16

    Default NoSuchFieldError Exception throwed when running in Websphere

    Hi
    I use spring portlet framework in my portlet dev,It's ok running on tomat,but when runing on websphere 5,the NoSuchFieldError throwed,Following is the error message:

    Nested Exception is java.lang.NoSuchFieldError: org.springframework.validation.AbstractBindingResu lt: field MODEL_KEY_PREFIX not found
    at org.springframework.validation.AbstractBindingResu lt.getModel(AbstractBindingResult.java:345)
    at org.springframework.validation.BindException.getMo del(BindException.java:206)
    at org.springframework.web.portlet.mvc.AbstractFormCo ntroller.showForm(AbstractFormController.java:818)
    at org.springframework.web.portlet.mvc.SimpleFormCont roller.showForm(SimpleFormController.java:226)

    ....


    I use spring.jar and spring-portlet.jar released in 2.0M4.

    please give me advice,Thinks.

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Make sure you don't have any old spring.jar inside websphere (maybe at server level). This error usually occurs, when some different version is found on the parent classpath and used instead of yours.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    May 2006
    Posts
    16

    Default Thanks for your reply

    First,Thanks for your reply,but I has searched all the classpath(include those of parent classloader),there are no any older version,I doubt the jdk version lead this issue(Websphere 5 use jdk1.3 ).

    I modify the code(at 345 line) in AbstractBindingResult.java

    model.put(MODEL_KEY_PREFIX + getObjectName(), this);

    to

    model.put(BindingResult.MODEL_KEY_PREFIX + getObjectName(), this);

    and rebuild the spring code and get the spring.jar,and the issue solved.

    But I need official solution however,so any advice is appreciated!

    Thank u for your reply again.

    Best Rgds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •