java - Invalid property 'profileManager' of bean class. Bean property 'profileManager' is not writable or has an invalid setter method -


i've been going through code , making sure didn't miss type still don't understand i've done wrong. below code "profilehome" class , "profilemanager"

package com.aperturepriorityautoweb.domain;  import java.util.list;  import javax.naming.initialcontext;  import org.apache.commons.logging.log; import org.apache.commons.logging.logfactory; import org.hibernate.hibernateexception; import org.hibernate.lockmode; import org.hibernate.session; import org.hibernate.sessionfactory; import org.hibernate.criterion.example;  import com.aperturepriorityautoweb.util.hibernateutil;  /**  * home object domain model class profile.  *   * @see .profile  * @author hibernate tools  */ public class profilehome {      private static final log log = logfactory.getlog(profilehome.class);      protected sessionfactory getsessionfactory() {         try {             return hibernateutil.getsessionfactory();         } catch (exception e) {             log.error("could not locate sessionfactory in jndi", e);             throw new illegalstateexception(                     "could not locate sessionfactory in jndi");         }     }      public void persist(profile transientinstance) {         log.debug("persisting profile instance");         try {             getsessionfactory().getcurrentsession().persist(transientinstance);             log.debug("persist successful");         } catch (runtimeexception re) {             log.error("persist failed", re);             throw re;         }     }      public void attachdirty(profile instance) {         log.debug("attaching dirty profile instance");         try {             getsessionfactory().getcurrentsession().saveorupdate(instance);             log.debug("attach successful");         } catch (runtimeexception re) {             log.error("attach failed", re);             throw re;         }     }      public void attachclean(profile instance) {         log.debug("attaching clean profile instance");         try {             getsessionfactory().getcurrentsession().lock(instance, lockmode.none);             log.debug("attach successful");         } catch (runtimeexception re) {             log.error("attach failed", re);             throw re;         }     }      public void delete(profile persistentinstance) {         log.debug("deleting profile instance");         try {             getsessionfactory().getcurrentsession().delete(persistentinstance);             log.debug("delete successful");         } catch (runtimeexception re) {             log.error("delete failed", re);             throw re;         }     }      public profile merge(profile detachedinstance) {         log.debug("merging profile instance");         try {             profile result = (profile) getsessionfactory().getcurrentsession()                     .merge(detachedinstance);             log.debug("merge successful");             return result;         } catch (runtimeexception re) {             log.error("merge failed", re);             throw re;         }     }      public profile findbyid(java.lang.integer id) {         log.debug("getting profile instance id: " + id);         try {             profile instance = (profile) getsessionfactory().getcurrentsession()                     .get("profile", id);             if (instance == null) {                 log.debug("get successful, no instance found");             } else {                 log.debug("get successful, instance found");             }             return instance;         } catch (runtimeexception re) {             log.error("get failed", re);             throw re;         }     }      public list findbyexample(profile instance) {         log.debug("finding profile instance example");         try {             list results = getsessionfactory().getcurrentsession()                     .createcriteria(profile.class).add(example.create(instance))                     .list();             log.debug("find example successful, result size: "                     + results.size());             return results;         } catch (runtimeexception re) {             log.error("find example failed", re);             throw re;         }     }      /**      * returns list of profiles matching userid.      */     @suppresswarnings("unchecked")     public list<profile> getprofiles(int user) {         list<profile> profilelist = null;         session session = hibernateutil.getsessionfactory().getcurrentsession();         session.begintransaction();         try {             profilelist = session                     .createquery(                             "from profile user_id = ? , statuscode <> '"                                     + profile.uploaded + "'")                     .setinteger(0, user).list();             session.gettransaction().commit();         } catch (hibernateexception e) {             session.gettransaction().rollback();             throw e;         }         return profilelist;     } } 

below controller containing "profilemanager"

package com.aperturepriorityautoweb.controllers;  import java.util.list;  import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse;  import org.apache.log4j.logger; import org.springframework.web.servlet.modelandview; import org.springframework.web.servlet.mvc.controller;  import com.aperturepriorityautoweb.domain.user; import com.aperturepriorityautoweb.domain.profile; import com.aperturepriorityautoweb.domain.profilehome;  /**  * controller profile list screen.  */ public class profilelistcontroller implements controller {      public static final string map_key = "profilesjspvar";     public static final string emp_key = "user";      private profilehome profilemanager;     private string successview;      private static final logger logger = logger             .getlogger(profilelistcontroller.class);      /**      * returns list of profiles database objects in modelandview.      */     public modelandview handlerequest(httpservletrequest request,             httpservletresponse response) throws exception {         // profiles not paid employee id = 1         list<profile> profiles = profilemanager.getprofiles(1);         logger.debug("showing profiles user id = " + 1);         return new modelandview(getsuccessview(), map_key, profiles);     }      public profilehome getprofilemanager() {         return profilemanager;     }      public void setprofilemanager(profilehome profilemanager) {         this.profilemanager = profilemanager;     }      public string getsuccessview() {         return successview;     }      public void setsuccessview(string successview) {         this.successview = successview;     }  } 

error getting:

2014-03-10 10:24:15,226 error [org.springframework.web.servlet.dispatcherservlet] - context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'profilelistcontroller' defined in servletcontext resource [/web-inf/aperturepriority-servlet.xml]: error setting property values; nested exception org.springframework.beans.notwritablepropertyexception: invalid property 'profilemanager' of bean class [com.aperturepriority.controllers.profilelistcontroller]: bean property 'profilemanager' not writable or has invalid setter method. parameter type of setter match return type of getter? org.springframework.beans.notwritablepropertyexception: invalid property 'profilemanager' of bean class [com.aperturepriority.controllers.profilelistcontroller]: bean property 'profilemanager' not writable or has invalid setter method. parameter type of setter match return type of getter?     @ org.springframework.beans.beanwrapperimpl.setpropertyvalue(beanwrapperimpl.java:683)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalue(beanwrapperimpl.java:584)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalue(beanwrapperimpl.java:752)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalues(beanwrapperimpl.java:779)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalues(beanwrapperimpl.java:768)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applypropertyvalues(abstractautowirecapablebeanfactory.java:774)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:575)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:405)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:235)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:144)     @ org.springframework.context.support.abstractapplicationcontext.getbean(abstractapplicationcontext.java:614)     @ org.springframework.web.servlet.handler.abstracturlhandlermapping.registerhandler(abstracturlhandlermapping.java:186)     @ org.springframework.web.servlet.handler.simpleurlhandlermapping.initapplicationcontext(simpleurlhandlermapping.java:96)     @ org.springframework.context.support.applicationobjectsupport.setapplicationcontext(applicationobjectsupport.java:79)     @ org.springframework.context.support.applicationcontextawareprocessor.postprocessbeforeinitialization(applicationcontextawareprocessor.java:86)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applybeanpostprocessorsbeforeinitialization(abstractautowirecapablebeanfactory.java:287)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:825)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:409)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:235)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:144)     @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:270)     @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:331)     @ org.springframework.web.context.support.abstractrefreshablewebapplicationcontext.refresh(abstractrefreshablewebapplicationcontext.java:155)     @ org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:308)     @ org.springframework.web.servlet.frameworkservlet.initwebapplicationcontext(frameworkservlet.java:252)     @ org.springframework.web.servlet.frameworkservlet.initservletbean(frameworkservlet.java:221)     @ org.springframework.web.servlet.httpservletbean.init(httpservletbean.java:112)     @ javax.servlet.genericservlet.init(genericservlet.java:160)     @ org.apache.catalina.core.standardwrapper.initservlet(standardwrapper.java:1280)     @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1193)     @ org.apache.catalina.core.standardwrapper.load(standardwrapper.java:1088)     @ org.apache.catalina.core.standardcontext.loadonstartup(standardcontext.java:5198)     @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5481)     @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150)     @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1559)     @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1549)     @ java.util.concurrent.futuretask.run(futuretask.java:262)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)     @ java.lang.thread.run(thread.java:744) mar 10, 2014 10:24:15 org.apache.catalina.core.applicationcontext log severe: standardwrapper.throwable org.springframework.beans.factory.beancreationexception: error creating bean name 'profilelistcontroller' defined in servletcontext resource [/web-inf/aperturepriority-servlet.xml]: error setting property values; nested exception org.springframework.beans.notwritablepropertyexception: invalid property 'profilemanager' of bean class [com.aperturepriority.controllers.profilelistcontroller]: bean property 'profilemanager' not writable or has invalid setter method. parameter type of setter match return type of getter? org.springframework.beans.notwritablepropertyexception: invalid property 'profilemanager' of bean class [com.aperturepriority.controllers.profilelistcontroller]: bean property 'profilemanager' not writable or has invalid setter method. parameter type of setter match return type of getter?     @ org.springframework.beans.beanwrapperimpl.setpropertyvalue(beanwrapperimpl.java:683)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalue(beanwrapperimpl.java:584)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalue(beanwrapperimpl.java:752)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalues(beanwrapperimpl.java:779)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalues(beanwrapperimpl.java:768)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applypropertyvalues(abstractautowirecapablebeanfactory.java:774)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:575)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:405)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:235)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:144)     @ org.springframework.context.support.abstractapplicationcontext.getbean(abstractapplicationcontext.java:614)     @ org.springframework.web.servlet.handler.abstracturlhandlermapping.registerhandler(abstracturlhandlermapping.java:186)     @ org.springframework.web.servlet.handler.simpleurlhandlermapping.initapplicationcontext(simpleurlhandlermapping.java:96)     @ org.springframework.context.support.applicationobjectsupport.setapplicationcontext(applicationobjectsupport.java:79)     @ org.springframework.context.support.applicationcontextawareprocessor.postprocessbeforeinitialization(applicationcontextawareprocessor.java:86)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applybeanpostprocessorsbeforeinitialization(abstractautowirecapablebeanfactory.java:287)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:825)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:409)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:235)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:144)     @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:270)     @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:331)     @ org.springframework.web.context.support.abstractrefreshablewebapplicationcontext.refresh(abstractrefreshablewebapplicationcontext.java:155)     @ org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:308)     @ org.springframework.web.servlet.frameworkservlet.initwebapplicationcontext(frameworkservlet.java:252)     @ org.springframework.web.servlet.frameworkservlet.initservletbean(frameworkservlet.java:221)     @ org.springframework.web.servlet.httpservletbean.init(httpservletbean.java:112)     @ javax.servlet.genericservlet.init(genericservlet.java:160)     @ org.apache.catalina.core.standardwrapper.initservlet(standardwrapper.java:1280)     @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1193)     @ org.apache.catalina.core.standardwrapper.load(standardwrapper.java:1088)     @ org.apache.catalina.core.standardcontext.loadonstartup(standardcontext.java:5198)     @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5481)     @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150)     @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1559)     @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1549)     @ java.util.concurrent.futuretask.run(futuretask.java:262)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)     @ java.lang.thread.run(thread.java:744)  mar 10, 2014 10:24:15 org.apache.catalina.core.standardcontext loadonstartup severe: servlet /aperturepriority threw load() exception org.springframework.beans.notwritablepropertyexception: invalid property 'profilemanager' of bean class [com.aperturepriority.controllers.profilelistcontroller]: bean property 'profilemanager' not writable or has invalid setter method. parameter type of setter match return type of getter?     @ org.springframework.beans.beanwrapperimpl.setpropertyvalue(beanwrapperimpl.java:683)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalue(beanwrapperimpl.java:584)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalue(beanwrapperimpl.java:752)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalues(beanwrapperimpl.java:779)     @ org.springframework.beans.beanwrapperimpl.setpropertyvalues(beanwrapperimpl.java:768)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applypropertyvalues(abstractautowirecapablebeanfactory.java:774)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:575)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:405)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:235)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:144)     @ org.springframework.context.support.abstractapplicationcontext.getbean(abstractapplicationcontext.java:614)     @ org.springframework.web.servlet.handler.abstracturlhandlermapping.registerhandler(abstracturlhandlermapping.java:186)     @ org.springframework.web.servlet.handler.simpleurlhandlermapping.initapplicationcontext(simpleurlhandlermapping.java:96)     @ org.springframework.context.support.applicationobjectsupport.setapplicationcontext(applicationobjectsupport.java:79)     @ org.springframework.context.support.applicationcontextawareprocessor.postprocessbeforeinitialization(applicationcontextawareprocessor.java:86)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applybeanpostprocessorsbeforeinitialization(abstractautowirecapablebeanfactory.java:287)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:825)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:409)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:235)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:144)     @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:270)     @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:331)     @ org.springframework.web.context.support.abstractrefreshablewebapplicationcontext.refresh(abstractrefreshablewebapplicationcontext.java:155)     @ org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:308)     @ org.springframework.web.servlet.frameworkservlet.initwebapplicationcontext(frameworkservlet.java:252)     @ org.springframework.web.servlet.frameworkservlet.initservletbean(frameworkservlet.java:221)     @ org.springframework.web.servlet.httpservletbean.init(httpservletbean.java:112)     @ javax.servlet.genericservlet.init(genericservlet.java:160)     @ org.apache.catalina.core.standardwrapper.initservlet(standardwrapper.java:1280)     @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1193)     @ org.apache.catalina.core.standardwrapper.load(standardwrapper.java:1088)     @ org.apache.catalina.core.standardcontext.loadonstartup(standardcontext.java:5198)     @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5481)     @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150)     @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1559)     @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1549)     @ java.util.concurrent.futuretask.run(futuretask.java:262)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)     @ java.lang.thread.run(thread.java:744)  mar 10, 2014 10:24:15 org.apache.coyote.abstractprotocol start info: starting protocolhandler ["http-bio-8080"] mar 10, 2014 10:24:15 org.apache.coyote.abstractprotocol start info: starting protocolhandler ["ajp-bio-8009"] mar 10, 2014 10:24:15 org.apache.catalina.startup.catalina start info: server startup in 3241 ms 

bean xml:

    <?xml version="1.0" encoding="utf-8"?>  <beans xmlns="http://www.springframework.org/schema/beans"     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"     xsi:schemalocation="http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-beans.xsd">      <!-- url mapping -->      <bean id="urlmap"         class="org.springframework.web.servlet.handler.simpleurlhandlermapping">         <property name="urlmap">             <props>                 <prop key="/profilelist.htm">profilelistcontroller</prop>             </props>         </property>     </bean>      <!-- controllers -->      <bean name="profilelistcontroller"         class="com.aperturepriorityautoweb.controllers.profilelistcontroller">         <property name="profilemanager">             <ref bean="profilemanager" />         </property>         <property name="successview">             <value>profilelist</value>         </property>     </bean>      <!-- validators -->      <!-- model classes -->     <bean id="usermanager" class="com.aperturepriorityautoweb.domain.userhome" />     <bean id="profilemanager" class="com.aperturepriorityautoweb.domain.profilehome" />     <bean id="sectormanager" class="com.aperturepriorityautoweb.domain.sectorhome" />      <!-- utility classes -->       <bean id="viewresolver"         class="org.springframework.web.servlet.view.internalresourceviewresolver">         <property name="viewclass">             <value>org.springframework.web.servlet.view.jstlview</value>         </property>         <property name="prefix">             <value>/web-inf/jsp/</value>         </property>         <property name="suffix">             <value>.jsp</value>         </property>     </bean>      <!-- spring mail support -->     <!-- spring job scheduling -->     <!-- spring jmx support -->     <!-- resource bundle -->  </beans> 

sorry kind of disappeared few days. sotirios , mark pretty pointed me in right direction. sotirios wrote:

can update package names? error doesn't match class package.

and mark stated:

i stripped them of implementations , removed spring classes bean file, , loads correctly, 100% sure using bean file have here, , not other copy of it?

to sum issue, odd reason project referencing bean xml of earlier version of project. resolve closed other projects had open (which should have done begin with) , changed projects configuration paths in eclipse (java ee - indigo; should have stated compiler using too.) @ rate, first post here on site , quite impressed , thankful responses got. take easy guys, hope valuable member here time goes on , again.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -