title: java.lang.NoSuchMethodException: Unknown property 'language' on class 'class java.lang.Class'
body: <p>Im a getting the follwoing error:</p>
  
  <pre><code>java.lang.NoSuchMethodException: Unknown property 'language' on class 'class java.lang.Class'
  </code></pre>
  
  <p>Rest call used : /Test/rest/Languages/insertobj/Japanese/Swedish%206</p>
  
  <p>I am using : org.apache.commons.beanutils.PropertyUtils;</p>
  
  <p>I do had the specified property 'language' in my Languages class  so Im not sure why it is throwing the error. It works when I declare  its as such :</p>
  
  <p>Languages lanobj = new Lanaguages();</p>
  
  <p>//Languages class</p>
  
  <pre><code>public class Languages implements java.io.Serializable {
      private String language;
      private String displayName;
  
  public Languages() {
          this.language = null;
          this.displayName = null;
      }
  
  
  public Languages(String language, String displayName) {
      this.language = language;
      this.displayName = displayName;
  }
  
  public void setLanguageId(Long languageId) {
      this.languageId = languageId;
  }
  
  @Column(name = "language", nullable = false, length = 50)
  public String getLanguage() {
      return this.language;
  }
  
  public void setLanguage(String language) {
      this.language = language;
  }
  
  @Column(name = "displayName", nullable = false, length = 50)
  public String getDisplayName() {
      return this.displayName;
  }
  
  public void setDisplayName(String displayName) {
      this.displayName = displayName;
  }
  
  }
  </code></pre>
  
  <p>///Resource manager code</p>
  
  <pre><code>@Path("{subResources}/insertobj/{language-id}/{displayname-id}")
  //@POST 
  @GET // Using get for the sake of making rest call with browser
  @Produces(MediaType.TEXT_HTML)
  public String getLanguageById(@PathParam("subResources") String id,
                              @PathParam("language-id") String language_id,
                              @PathParam("displayname-id") String displayname_id) 
  {
      try{
          Class&lt;?&gt; c = Class.forName("com.test."+id);
          PropertyUtils.setProperty(c, "language",language_id);
          PropertyUtils.setProperty(c, "displayName",displayname_id);
          TransactionManager.createObject(c);     
  
      }catch (Exception exc){
          exc.printStackTrace();      
      }
  
  }
  </code></pre>
  
  <p>//TransactionManager snippet:</p>
  
  <pre><code>public static void createObject(Object entityObject) {
      Transaction tx = null;
      //SessionFactoryUtil.getInstance().openSession();
      Session session =  SessionFactoryUtil.openSession();
      try {
        tx = session.beginTransaction();        
        session.save(entityObject);         
        tx.commit();
      } 
      catch (RuntimeException e)
      {
        if (tx != null &amp;&amp; tx.isActive())
        {
          try 
          {
              // Second try catch as the rollback could fail as well
              tx.rollback();
          } 
          catch (HibernateException e1) {
              //logger.debug(“Error rolling back transaction”);
          }
          // throw again the first exception
          throw e;
        }
      }
      finally
      {
          session.close();
      }
    }
  </code></pre>