4 Replies Latest reply on Apr 26, 2011 10:51 AM by Ranganathan Kaliyur Mannar

    Dynamic Mail Configuration for gmail - issue

    Ranganathan Kaliyur Mannar Newbie

      Hi,
      I am developing an application where I need to dynamically setup the email configuration - there are many users and each have their own gmail id. So, I write my own configuraion and set the user name and password dynamically:



      @Name("org.jboss.seam.mail.mailSession")
      @Install(value = true, precedence = Install.APPLICATION)
      @Scope(ScopeType.APPLICATION)
      @BypassInterceptors
      class EmailConfiguration extends org.jboss.seam.mail.MailSession implements Serializable
      {
      



      and render each time as


      EmailConfiguration myMailSession = new EmailConfiguration(is, passwd);
      Contexts.getEventContext().set("session", myMailSession);
      renderer.render("/Mail.xhtml");
      



      But, I get the following exception:


      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.mail.mailSession



      Underlying exception is:



      Caused by: java.lang.IllegalAccessException: Class org.jboss.seam.Component can not access a member of class com.appspace.hrms.action.EmailConfiguration with modifiers "public"
      16:16:14,129 ERROR [STDERR]      at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
      16:16:14,129 ERROR [STDERR]      at java.lang.Class.newInstance0(Class.java:349)
      16:16:14,129 ERROR [STDERR]      at java.lang.Class.newInstance(Class.java:308)
      16:16:14,129 ERROR [STDERR]      at org.jboss.seam.Component.instantiateJavaBean(Component.java:1438)
      16:16:14,129 ERROR [STDERR]      at org.jboss.seam.Component.instantiate(Component.java:1359)
      16:16:14,129 ERROR [STDERR]      at org.jboss.seam.Component.newInstance(Component.java:2122)
      



      What am I doing wrong?