8 Replies Latest reply on Feb 16, 2011 10:30 PM by Feri Lauw

    Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component:..."

    Feri Lauw Newbie

      *Hello All,

      Iam newbie and i need some help, iam using :
      JBoss5.1.0GA
      JBoss Seam2.2.0GA
      Eclipse GalileoSR1
      jdk1.6.0_22
      Windows 7

      i need value of variable can be use in another entity bean.
      so, iam using injection. but when i run the program it's seem have a few problem :

      Exception during request processing:
      Caused by org.jboss.seam.InstantiationException with message: 'Could not instantiate Seam component: saHome'
      org.jboss.seam.Component.newInstance(Component.java:2144)
      org.jboss.seam.Component.getInstance(Component.java:2021)
      org.jboss.seam.Component.getInstance(Component.java:1983)
      org.jboss.seam.Component.getInstance(Component.java:1977)
      org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
      org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
      org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
      org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
      javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
      com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
      org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
      org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
      org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
      org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
      org.jboss.seam.navigation.Page.preRender(Page.java:311)
      org.jboss.seam.navigation.Pages.preRender(Pages.java:350)
      org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
      org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
      org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
      org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
      com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:510)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
      org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
      org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      java.lang.Thread.run(Unknown Source)

      Caused by java.lang.NullPointerException with message: ""

      org.fla.eStock.session.SaHome.setSaId(SaHome.java:17)
      org.fla.eStock.session.SaHome.<init>(SaHome.java:30)
      sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      java.lang.reflect.Constructor.newInstance(Unknown Source)
      java.lang.Class.newInstance0(Unknown Source)
      java.lang.Class.newInstance(Unknown Source)
      org.jboss.seam.Component.instantiateJavaBean(Component.java:1438)
      org.jboss.seam.Component.instantiate(Component.java:1359)
      org.jboss.seam.Component.newInstance(Component.java:2122)
      org.jboss.seam.Component.getInstance(Component.java:2021)
      org.jboss.seam.Component.getInstance(Component.java:1983)
      org.jboss.seam.Component.getInstance(Component.java:1977)
      org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
      org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
      org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
      org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
      javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
      com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
      org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
      org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
      org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
      org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
      org.jboss.seam.navigation.Page.preRender(Page.java:311)
      org.jboss.seam.navigation.Pages.preRender(Pages.java:350)
      org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
      org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
      org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
      org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
      com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:510)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
      org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
      org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      java.lang.Thread.run(Unknown Source)

      and class saHome is :
      @Name("saHome")
      public class SaHome extends EntityHome<Sa>
      {
         @In(required = false) protected Cabang cabang;
        
         public void setSaId(SaId id)
         {     
            id.setCabang(cabang.getKota());      
            setId(id);
         }

         public SaId getSaId()
         {
            return (SaId) getId();
         }

         public SaHome()
         {    
            setSaId(new SaId());
         }

         @Override
         public boolean isIdDefined()
         {
            if (getSaId().getCabang() == null
      "".equals(getSaId().getCabang()))
               return false;
            if (getSaId().getTahun() == null
      "".equals(getSaId().getTahun()))
               return false;
            if (getSaId().getBulan() == null
      "".equals(getSaId().getBulan()))
               return false;
            if (getSaId().getKode() == null
      "".equals(getSaId().getKode()))
               return false;
            return true;
         }

         @Override
         protected Sa createInstance()
         {
            Sa sa = new Sa();
            sa.setId(new SaId());
            return sa;
         }

         public void load()
         {
            if (isIdDefined())
            {
               wire();
            }
         }

         public void wire()
         {
            getInstance();
         }

         public boolean isWired()
         {
            return true;
         }

         public Sa getDefinedInstance()
         {
            return isIdDefined() ? getInstance() : null;
         }

      }

      class Sa is :
      @Entity
      @Name("sa")
      @Scope(SESSION)
      @Table(name = "sa", catalog = "eStock2011", uniqueConstraints = @UniqueConstraint(columnNames = "id"))
      public class Sa implements java.io.Serializable
      {

         private SaId id;
         private int id_1;
         private String nama;
         private BigDecimal oa;
         private BigDecimal od;
         private BigDecimal ok;
         private BigDecimal awal;
         private BigDecimal jual;
         private BigDecimal retur;
         private String singkat;
         private BigDecimal komcash;
         private BigDecimal kom45;
         private BigDecimal kom75;
         private BigDecimal kom90;
         private Date tgl;
         private BigDecimal piutang;
         private BigDecimal piujt;
         private BigDecimal tagih;
         private BigDecimal tlbt0;
         private BigDecimal tlbt30;
         private BigDecimal tlbt60;
         private BigDecimal tlbt90;
         private BigDecimal tlbt99;
         private short lbr;
         private short lbrtjp;
         private short lbrjt;
         private int lbr30;
         private int lbr3060;
         private int lbr6090;
         private int lbr90;
         private long tagihlbt;

         public Sa()
         {
         }

         public Sa(SaId id, int id_1, String nama, BigDecimal oa, BigDecimal od, BigDecimal ok, BigDecimal awal, BigDecimal jual, BigDecimal retur, String singkat, BigDecimal komcash, BigDecimal kom45, BigDecimal kom75, BigDecimal kom90, Date tgl, BigDecimal piutang, BigDecimal piujt, BigDecimal tagih, BigDecimal tlbt0, BigDecimal tlbt30, BigDecimal tlbt60, BigDecimal tlbt90, BigDecimal tlbt99, short lbr, short lbrtjp, short lbrjt, int lbr30, int lbr3060, int lbr6090, int lbr90, long tagihlbt)
         {
            this.id = id;
            this.id_1 = id_1;
            this.nama = nama;
            this.oa = oa;
            this.od = od;
            this.ok = ok;
            this.awal = awal;
            this.jual = jual;
            this.retur = retur;
            this.singkat = singkat;
            this.komcash = komcash;
            this.kom45 = kom45;
            this.kom75 = kom75;
            this.kom90 = kom90;
            this.tgl = tgl;
            this.piutang = piutang;
            this.piujt = piujt;
            this.tagih = tagih;
            this.tlbt0 = tlbt0;
            this.tlbt30 = tlbt30;
            this.tlbt60 = tlbt60;
            this.tlbt90 = tlbt90;
            this.tlbt99 = tlbt99;
            this.lbr = lbr;
            this.lbrtjp = lbrtjp;
            this.lbrjt = lbrjt;
            this.lbr30 = lbr30;
            this.lbr3060 = lbr3060;
            this.lbr6090 = lbr6090;
            this.lbr90 = lbr90;
            this.tagihlbt = tagihlbt;
         }

         @EmbeddedId
         @AttributeOverrides( { @AttributeOverride(name = "cabang", column = @Column(name = "cabang", nullable = false, length = 3)), @AttributeOverride(name = "tahun", column = @Column(name = "tahun", nullable = false, length = 4)), @AttributeOverride(name = "bulan", column = @Column(name = "bulan", nullable = false, length = 2)), @AttributeOverride(name = "kode", column = @Column(name = "kode", nullable = false, length = 5)) })
         @NotNull
         public SaId getId()
         {
            return this.id;
         }

         public void setId(SaId id)
         {
            this.id = id;
         }

         @Column(name = "id", unique = true, nullable = false)
         public int getId_1()
         {
            return this.id_1;
         }

         public void setId_1(int id_1)
         {
            this.id_1 = id_1;
         }

         @Column(name = "nama", nullable = false, length = 20)
         @NotNull
         @Length(max = 20)
         public String getNama()
         {
            return this.nama;
         }

         public void setNama(String nama)
         {
            this.nama = nama;
         }

         @Column(name = "oa", nullable = true, precision = 18)
         public BigDecimal getOa()
         {
            return this.oa;
         }

         public void setOa(BigDecimal oa)
         {
            this.oa = oa;
         }

         @Column(name = "od", nullable = true, precision = 18) 
         public BigDecimal getOd()
         {
            return this.od;
         }

         public void setOd(BigDecimal od)
         {
            this.od = od;
         }

         @Column(name = "ok", nullable = true, precision = 18) 
         public BigDecimal getOk()
         {
            return this.ok;
         }

         public void setOk(BigDecimal ok)
         {
            this.ok = ok;
         }

         @Column(name = "awal", nullable = true, precision = 18)
         public BigDecimal getAwal()
         {
            return this.awal;
         }

         public void setAwal(BigDecimal awal)
         {
            this.awal = awal;
         }

         @Column(name = "jual", nullable = true, precision = 18) 
         public BigDecimal getJual()
         {
            return this.jual;
         }

         public void setJual(BigDecimal jual)
         {
            this.jual = jual;
         }

         @Column(name = "retur", nullable = true, precision = 18)
         public BigDecimal getRetur()
         {
            return this.retur;
         }

         public void setRetur(BigDecimal retur)
         {
            this.retur = retur;
         }

         @Column(name = "singkat", nullable = true, length = 3) 
         @Length(max = 3)
         public String getSingkat()
         {
            return this.singkat;
         }

         public void setSingkat(String singkat)
         {
            this.singkat = singkat;
         }

         @Column(name = "komcash", nullable = true, precision = 12) 
         public BigDecimal getKomcash()
         {
            return this.komcash;
         }

         public void setKomcash(BigDecimal komcash)
         {
            this.komcash = komcash;
         }

         @Column(name = "kom45", nullable = true, precision = 12) 
         public BigDecimal getKom45()
         {
            return this.kom45;
         }

         public void setKom45(BigDecimal kom45)
         {
            this.kom45 = kom45;
         }

         @Column(name = "kom75", nullable = true, precision = 12)  
         public BigDecimal getKom75()
         {
            return this.kom75;
         }

         public void setKom75(BigDecimal kom75)
         {
            this.kom75 = kom75;
         }

         @Column(name = "kom90", nullable = true, precision = 12) 
         public BigDecimal getKom90()
         {
            return this.kom90;
         }

         public void setKom90(BigDecimal kom90)
         {
            this.kom90 = kom90;
         }

         @Temporal(TemporalType.DATE)
         @Column(name = "tgl", nullable = true, length = 10)  
         public Date getTgl()
         {
            return this.tgl;
         }

         public void setTgl(Date tgl)
         {
            this.tgl = tgl;
         }

         @Column(name = "piutang", nullable = true, precision = 18)  
         public BigDecimal getPiutang()
         {
            return this.piutang;
         }

         public void setPiutang(BigDecimal piutang)
         {
            this.piutang = piutang;
         }

         @Column(name = "piujt", nullable = true, precision = 18)  
         public BigDecimal getPiujt()
         {
            return this.piujt;
         }

         public void setPiujt(BigDecimal piujt)
         {
            this.piujt = piujt;
         }

         @Column(name = "tagih", nullable = true, precision = 18)  
         public BigDecimal getTagih()
         {
            return this.tagih;
         }

         public void setTagih(BigDecimal tagih)
         {
            this.tagih = tagih;
         }

         @Column(name = "tlbt0", nullable = true, precision = 18) 
         public BigDecimal getTlbt0()
         {
            return this.tlbt0;
         }

         public void setTlbt0(BigDecimal tlbt0)
         {
            this.tlbt0 = tlbt0;
         }

         @Column(name = "tlbt30", nullable = true, precision = 18)  
         public BigDecimal getTlbt30()
         {
            return this.tlbt30;
         }

         public void setTlbt30(BigDecimal tlbt30)
         {
            this.tlbt30 = tlbt30;
         }

         @Column(name = "tlbt60", nullable = true, precision = 18)  
         public BigDecimal getTlbt60()
         {
            return this.tlbt60;
         }

         public void setTlbt60(BigDecimal tlbt60)
         {
            this.tlbt60 = tlbt60;
         }

         @Column(name = "tlbt90", nullable = true, precision = 18) 
         public BigDecimal getTlbt90()
         {
            return this.tlbt90;
         }

         public void setTlbt90(BigDecimal tlbt90)
         {
            this.tlbt90 = tlbt90;
         }

         @Column(name = "tlbt99", nullable = true, precision = 18) 
         public BigDecimal getTlbt99()
         {
            return this.tlbt99;
         }

         public void setTlbt99(BigDecimal tlbt99)
         {
            this.tlbt99 = tlbt99;
         }

         @Column(name = "lbr", nullable = true, precision = 4, scale = 0)
         public short getLbr()
         {
            return this.lbr;
         }

         public void setLbr(short lbr)
         {
            this.lbr = lbr;
         }

         @Column(name = "lbrtjp", nullable = true, precision = 4, scale = 0)
         public short getLbrtjp()
         {
            return this.lbrtjp;
         }

         public void setLbrtjp(short lbrtjp)
         {
            this.lbrtjp = lbrtjp;
         }

         @Column(name = "lbrjt", nullable = true, precision = 4, scale = 0)
         public short getLbrjt()
         {
            return this.lbrjt;
         }

         public void setLbrjt(short lbrjt)
         {
            this.lbrjt = lbrjt;
         }

         @Column(name = "lbr30", nullable = true, precision = 6, scale = 0)
         public int getLbr30()
         {
            return this.lbr30;
         }

         public void setLbr30(int lbr30)
         {
            this.lbr30 = lbr30;
         }

         @Column(name = "lbr3060", nullable = true, precision = 6, scale = 0)
         public int getLbr3060()
         {
            return this.lbr3060;
         }

         public void setLbr3060(int lbr3060)
         {
            this.lbr3060 = lbr3060;
         }

         @Column(name = "lbr6090", nullable = true, precision = 6, scale = 0)
         public int getLbr6090()
         {
            return this.lbr6090;
         }

         public void setLbr6090(int lbr6090)
         {
            this.lbr6090 = lbr6090;
         }

         @Column(name = "lbr90", nullable = true, precision = 6, scale = 0)
         public int getLbr90()
         {
            return this.lbr90;
         }

         public void setLbr90(int lbr90)
         {
            this.lbr90 = lbr90;
         }

         @Column(name = "tagihlbt", nullable = true, precision = 12, scale = 0)
         public long getTagihlbt()
         {
            return this.tagihlbt;
         }

         public void setTagihlbt(long tagihlbt)
         {
            this.tagihlbt = tagihlbt;
         }

      }

      class SaId is :
      @Embeddable
      public class SaId implements java.io.Serializable
      {
         
         private String cabang = "YGY";// =cab.getKota();
         private String tahun = "2010";// =cab.getTahun();
         private String bulan = "02";// =cab.getBulan();
         private String kode;

         public SaId()
         {     
         }

         public SaId(String cabang, String tahun, String bulan, String kode)
         {
            this.cabang = cabang;
            this.tahun = tahun;
            this.bulan = bulan;
            this.kode = kode;
         }

         @Column(name = "cabang", nullable = true, length = 3)
         @Length(max = 3)
         public String getCabang()
         {    
            return this.cabang;
         }

         public void setCabang(String cabang)
         {
            this.cabang = cabang;
         }

         @Column(name = "tahun", nullable = true, length = 4)
         @Length(max = 4)
         public String getTahun()
         {
            return this.tahun;
         }

         public void setTahun(String tahun)
         {
            this.tahun = tahun;
         }

         @Column(name = "bulan", nullable = true, length = 2)
         @Length(max = 2)
         public String getBulan()
         {
            return this.bulan;
         }

         public void setBulan(String bulan)
         {
            this.bulan = bulan;
         }

         @Column(name = "kode", nullable = false, length = 5)
         @NotNull
         @Length(max = 5)
         public String getKode()
         {
            return this.kode;
         }

         public void setKode(String kode)
         {
            this.kode = kode;
         }

         public boolean equals(Object other)
         {
            if ((this == other))
               return true;
            if ((other == null))
               return false;
            if (!(other instanceof SaId))
               return false;
            SaId castOther = (SaId) other;

            return ((this.getCabang() == castOther.getCabang())
      (this.getCabang() != null && castOther.getCabang() != null && this.getCabang().equals(castOther.getCabang()))) && ((this.getTahun() == castOther.getTahun()) (this.getTahun() != null && castOther.getTahun() != null && this.getTahun().equals(castOther.getTahun()))) && ((this.getBulan() == castOther.getBulan()) (this.getBulan() != null && castOther.getBulan() != null && this.getBulan().equals(castOther.getBulan()))) && ((this.getKode() == castOther.getKode()) (this.getKode() != null && castOther.getKode() != null && this.getKode().equals(castOther.getKode())));
         }

         public int hashCode()
         {
            int result = 17;

            result = 37 * result + (getCabang() == null ? 0 : this.getCabang().hashCode());
            result = 37 * result + (getTahun() == null ? 0 : this.getTahun().hashCode());
            result = 37 * result + (getBulan() == null ? 0 : this.getBulan().hashCode());
            result = 37 * result + (getKode() == null ? 0 : this.getKode().hashCode());
            return result;
         }  
      }
      class Cabang is :
      @Entity
      @Name("cab")
      @Scope(SESSION)
      @Table(name = "cabang", catalog = "eStock2011")
      public class Cabang implements java.io.Serializable {

              private Integer id;
              private String kode;   
              private String kota;   
              private String nama;
              private Double nomer;
              //Numpang naruh variable yang tidak disimpan di database.      
              private String tahun;  
              private String bulan;
             
              public Cabang() {
              }

              public Cabang(String kode, String kota, String nama, Double nomer) {
                      this.kode = kode;
                      this.kota = kota;
                      this.nama = nama;
                      this.nomer = nomer;
              }

              @Id
              @GeneratedValue(strategy = IDENTITY)
              @Column(name = "id", unique = true, nullable = false)
              public Integer getId() {
                      return this.id;
              }

              public void setId(Integer id) {
                      this.id = id;
              }

              @Column(name = "kode", length = 2)
              @Length(max = 2)
              public String getKode() {
                      return this.kode;
              }

              public void setKode(String kode) {
                      this.kode = kode;
              }

              @Column(name = "kota", length = 3)
              @Length(max = 3)
              public String getKota() {
                 System.out.println("Kota : " + kota);
                      return this.kota;
              }

              public void setKota(String kota) {
                      this.kota = kota;
              }

              @Column(name = "nama", length = 20)
              @Length(max = 20)
              public String getNama() {        
                      return this.nama;
              }

              public void setNama(String nama) {
                      this.nama = nama;
              }

              @Column(name = "nomer", precision = 22, scale = 0)
              public Double getNomer() {
                      return this.nomer;
              }

              public void setNomer(Double nomer) {
                      this.nomer = nomer;
              }
              @Transient
         public String getTahun()
         {
                 System.out.println("Tahun : " + tahun);
            return tahun;
         }

         public void setTahun(String tahun)
         {
            this.tahun = tahun;
         }
         @Transient
         public String getBulan()
         {
            System.out.println("Bulan : " + bulan);
            return bulan;
         }

         public void setBulan(String bulan)
         {
            this.bulan = bulan;
         }

      }

      could somebody help me?

      Thank you *

        • 2. Re: Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component:..."
          Feri Lauw Newbie





          Hello All,


          Iam newbie and i need some help, iam using :
          JBoss5.1.0GA
          JBoss Seam2.2.0GA
          Eclipse GalileoSR1
          jdk1.6.0_22
          Windows 7


          i need value of variable can be use in another entity bean.
          so, iam using injection. but when i run the program it's seem have a few problem :


          Exception during request processing:
          Caused by org.jboss.seam.InstantiationException with message : Could not instantiate Seam component: _saHome



          org.jboss.seam.Component.newInstance(Component.java:2144)
          org.jboss.seam.Component.getInstance(Component.java:2021)
          org.jboss.seam.Component.getInstance(Component.java:1983)
          org.jboss.seam.Component.getInstance(Component.java:1977)
          org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
          org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
          org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
          org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
          javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
          com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
          org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
          org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
          org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
          org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
          org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
          org.jboss.seam.navigation.Page.preRender(Page.java:311)
          org.jboss.seam.navigation.Pages.preRender(Pages.java:350)
          org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
          org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
          org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
          org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
          com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
          com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
          com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:510)
          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
          org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
          org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
          org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
          org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
          org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
          org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
          org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
          org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
          org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
          org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
          org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
          org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
          org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
          org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          java.lang.Thread.run(Unknown Source)


          Caused by java.lang.NullPointerException with message:



          org.fla.eStock.session.SaHome.setSaId(SaHome.java:17)
          org.fla.eStock.session.SaHome.<init>(SaHome.java:30)
          sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
          sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
          java.lang.reflect.Constructor.newInstance(Unknown Source)
          java.lang.Class.newInstance0(Unknown Source)
          java.lang.Class.newInstance(Unknown Source)
          org.jboss.seam.Component.instantiateJavaBean(Component.java:1438)
          org.jboss.seam.Component.instantiate(Component.java:1359)
          org.jboss.seam.Component.newInstance(Component.java:2122)
          org.jboss.seam.Component.getInstance(Component.java:2021)
          org.jboss.seam.Component.getInstance(Component.java:1983)
          org.jboss.seam.Component.getInstance(Component.java:1977)
          org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
          org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
          org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
          org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
          javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
          com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
          org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
          org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
          org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
          org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
          org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
          org.jboss.seam.navigation.Page.preRender(Page.java:311)
          org.jboss.seam.navigation.Pages.preRender(Pages.java:350)
          org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
          org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
          org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
          org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
          com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
          com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
          com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:510)
          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
          org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
          org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
          org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
          org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
          org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
          org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
          org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
          org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
          org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
          org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
          org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
          org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
          org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
          org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          java.lang.Thread.run(Unknown Source)


          and class saHome is :


          @Name("saHome")
          public class SaHome extends EntityHome<Sa>
          {
             @In(required = false) protected Cabang cabang;
             
             public void setSaId(SaId id)
             {      
                id.setCabang(cabang.getKota());       
                setId(id);
             }
          
             public SaId getSaId()
             {
                return (SaId) getId();
             }
          
             public SaHome()
             {     
                setSaId(new SaId());
             }
          
             @Override
             public boolean isIdDefined()
             {
                if (getSaId().getCabang() == null || "".equals(getSaId().getCabang()))
                   return false;
                if (getSaId().getTahun() == null || "".equals(getSaId().getTahun()))
                   return false;
                if (getSaId().getBulan() == null || "".equals(getSaId().getBulan()))
                   return false;
                if (getSaId().getKode() == null || "".equals(getSaId().getKode()))
                   return false;
                return true;
             }
          
             @Override
             protected Sa createInstance()
             {
                Sa sa = new Sa();
                sa.setId(new SaId());
                return sa;
             }
          
             public void load()
             {
                if (isIdDefined())
                {
                   wire();
                }
             }
          
             public void wire()
             {
                getInstance();
             }
          
             public boolean isWired()
             {
                return true;
             }
          
             public Sa getDefinedInstance()
             {
                return isIdDefined() ? getInstance() : null;
             }
          
          }
          



          class Sa is :


          @Entity
          @Name("sa")
          @Scope(SESSION)
          @Table(name = "sa", catalog = "eStock2011", uniqueConstraints = @UniqueConstraint(columnNames = "id"))
          public class Sa implements java.io.Serializable
          {
          
             private SaId id;
             private int id_1;
             private String nama;
             private BigDecimal oa;
             private BigDecimal od;
             private BigDecimal ok;
             private BigDecimal awal;
             private BigDecimal jual;
             private BigDecimal retur;
             private String singkat;
             private BigDecimal komcash;
             private BigDecimal kom45;
             private BigDecimal kom75;
             private BigDecimal kom90;
             private Date tgl;
             private BigDecimal piutang;
             private BigDecimal piujt;
             private BigDecimal tagih;
             private BigDecimal tlbt0;
             private BigDecimal tlbt30;
             private BigDecimal tlbt60;
             private BigDecimal tlbt90;
             private BigDecimal tlbt99;
             private short lbr;
             private short lbrtjp;
             private short lbrjt;
             private int lbr30;
             private int lbr3060;
             private int lbr6090;
             private int lbr90;
             private long tagihlbt;
          
             public Sa()
             {
             }
          
             public Sa(SaId id, int id_1, String nama, BigDecimal oa, BigDecimal od, BigDecimal ok, BigDecimal awal, BigDecimal jual, BigDecimal retur, String singkat, BigDecimal komcash, BigDecimal kom45, BigDecimal kom75, BigDecimal kom90, Date tgl, BigDecimal piutang, BigDecimal piujt, BigDecimal tagih, BigDecimal tlbt0, BigDecimal tlbt30, BigDecimal tlbt60, BigDecimal tlbt90, BigDecimal tlbt99, short lbr, short lbrtjp, short lbrjt, int lbr30, int lbr3060, int lbr6090, int lbr90, long tagihlbt)
             {
                this.id = id;
                this.id_1 = id_1;
                this.nama = nama;
                this.oa = oa;
                this.od = od;
                this.ok = ok;
                this.awal = awal;
                this.jual = jual;
                this.retur = retur;
                this.singkat = singkat;
                this.komcash = komcash;
                this.kom45 = kom45;
                this.kom75 = kom75;
                this.kom90 = kom90;
                this.tgl = tgl;
                this.piutang = piutang;
                this.piujt = piujt;
                this.tagih = tagih;
                this.tlbt0 = tlbt0;
                this.tlbt30 = tlbt30;
                this.tlbt60 = tlbt60;
                this.tlbt90 = tlbt90;
                this.tlbt99 = tlbt99;
                this.lbr = lbr;
                this.lbrtjp = lbrtjp;
                this.lbrjt = lbrjt;
                this.lbr30 = lbr30;
                this.lbr3060 = lbr3060;
                this.lbr6090 = lbr6090;
                this.lbr90 = lbr90;
                this.tagihlbt = tagihlbt;
             }
          
             @EmbeddedId
             @AttributeOverrides( { @AttributeOverride(name = "cabang", column = @Column(name = "cabang", nullable = false, length = 3)), @AttributeOverride(name = "tahun", column = @Column(name = "tahun", nullable = false, length = 4)), @AttributeOverride(name = "bulan", column = @Column(name = "bulan", nullable = false, length = 2)), @AttributeOverride(name = "kode", column = @Column(name = "kode", nullable = false, length = 5)) })
             @NotNull
             public SaId getId()
             {
                return this.id;
             }
          
             public void setId(SaId id)
             {
                this.id = id;
             }
          
             @Column(name = "id", unique = true, nullable = false)
             public int getId_1()
             {
                return this.id_1;
             }
          
             public void setId_1(int id_1)
             {
                this.id_1 = id_1;
             }
          
             @Column(name = "nama", nullable = false, length = 20)
             @NotNull
             @Length(max = 20)
             public String getNama()
             {
                return this.nama;
             }
          
             public void setNama(String nama)
             {
                this.nama = nama;
             }
          
             @Column(name = "oa", nullable = true, precision = 18)
             public BigDecimal getOa()
             {
                return this.oa;
             }
          
             public void setOa(BigDecimal oa)
             {
                this.oa = oa;
             }
          
             @Column(name = "od", nullable = true, precision = 18)  
             public BigDecimal getOd()
             {
                return this.od;
             }
          
             public void setOd(BigDecimal od)
             {
                this.od = od;
             }
          
             @Column(name = "ok", nullable = true, precision = 18)  
             public BigDecimal getOk()
             {
                return this.ok;
             }
          
             public void setOk(BigDecimal ok)
             {
                this.ok = ok;
             }
          
             @Column(name = "awal", nullable = true, precision = 18) 
             public BigDecimal getAwal()
             {
                return this.awal;
             }
          
             public void setAwal(BigDecimal awal)
             {
                this.awal = awal;
             }
          
             @Column(name = "jual", nullable = true, precision = 18)  
             public BigDecimal getJual()
             {
                return this.jual;
             }
          
             public void setJual(BigDecimal jual)
             {
                this.jual = jual;
             }
          
             @Column(name = "retur", nullable = true, precision = 18) 
             public BigDecimal getRetur()
             {
                return this.retur;
             }
          
             public void setRetur(BigDecimal retur)
             {
                this.retur = retur;
             }
          
             @Column(name = "singkat", nullable = true, length = 3)  
             @Length(max = 3)
             public String getSingkat()
             {
                return this.singkat;
             }
          
             public void setSingkat(String singkat)
             {
                this.singkat = singkat;
             }
          
             @Column(name = "komcash", nullable = true, precision = 12)  
             public BigDecimal getKomcash()
             {
                return this.komcash;
             }
          
             public void setKomcash(BigDecimal komcash)
             {
                this.komcash = komcash;
             }
          
             @Column(name = "kom45", nullable = true, precision = 12)  
             public BigDecimal getKom45()
             {
                return this.kom45;
             }
          
             public void setKom45(BigDecimal kom45)
             {
                this.kom45 = kom45;
             }
          
             @Column(name = "kom75", nullable = true, precision = 12)   
             public BigDecimal getKom75()
             {
                return this.kom75;
             }
          
             public void setKom75(BigDecimal kom75)
             {
                this.kom75 = kom75;
             }
          
             @Column(name = "kom90", nullable = true, precision = 12)  
             public BigDecimal getKom90()
             {
                return this.kom90;
             }
          
             public void setKom90(BigDecimal kom90)
             {
                this.kom90 = kom90;
             }
          
             @Temporal(TemporalType.DATE)
             @Column(name = "tgl", nullable = true, length = 10)   
             public Date getTgl()
             {
                return this.tgl;
             }
          
             public void setTgl(Date tgl)
             {
                this.tgl = tgl;
             }
          
             @Column(name = "piutang", nullable = true, precision = 18)   
             public BigDecimal getPiutang()
             {
                return this.piutang;
             }
          
             public void setPiutang(BigDecimal piutang)
             {
                this.piutang = piutang;
             }
          
             @Column(name = "piujt", nullable = true, precision = 18)   
             public BigDecimal getPiujt()
             {
                return this.piujt;
             }
          
             public void setPiujt(BigDecimal piujt)
             {
                this.piujt = piujt;
             }
          
             @Column(name = "tagih", nullable = true, precision = 18)   
             public BigDecimal getTagih()
             {
                return this.tagih;
             }
          
             public void setTagih(BigDecimal tagih)
             {
                this.tagih = tagih;
             }
          
             @Column(name = "tlbt0", nullable = true, precision = 18)  
             public BigDecimal getTlbt0()
             {
                return this.tlbt0;
             }
          
             public void setTlbt0(BigDecimal tlbt0)
             {
                this.tlbt0 = tlbt0;
             }
          
             @Column(name = "tlbt30", nullable = true, precision = 18)   
             public BigDecimal getTlbt30()
             {
                return this.tlbt30;
             }
          
             public void setTlbt30(BigDecimal tlbt30)
             {
                this.tlbt30 = tlbt30;
             }
          
             @Column(name = "tlbt60", nullable = true, precision = 18)   
             public BigDecimal getTlbt60()
             {
                return this.tlbt60;
             }
          
             public void setTlbt60(BigDecimal tlbt60)
             {
                this.tlbt60 = tlbt60;
             }
          
             @Column(name = "tlbt90", nullable = true, precision = 18)  
             public BigDecimal getTlbt90()
             {
                return this.tlbt90;
             }
          
             public void setTlbt90(BigDecimal tlbt90)
             {
                this.tlbt90 = tlbt90;
             }
          
             @Column(name = "tlbt99", nullable = true, precision = 18)  
             public BigDecimal getTlbt99()
             {
                return this.tlbt99;
             }
          
             public void setTlbt99(BigDecimal tlbt99)
             {
                this.tlbt99 = tlbt99;
             }
          
             @Column(name = "lbr", nullable = true, precision = 4, scale = 0)
             public short getLbr()
             {
                return this.lbr;
             }
          
             public void setLbr(short lbr)
             {
                this.lbr = lbr;
             }
          
             @Column(name = "lbrtjp", nullable = true, precision = 4, scale = 0)
             public short getLbrtjp()
             {
                return this.lbrtjp;
             }
          
             public void setLbrtjp(short lbrtjp)
             {
                this.lbrtjp = lbrtjp;
             }
          
             @Column(name = "lbrjt", nullable = true, precision = 4, scale = 0)
             public short getLbrjt()
             {
                return this.lbrjt;
             }
          
             public void setLbrjt(short lbrjt)
             {
                this.lbrjt = lbrjt;
             }
          
             @Column(name = "lbr30", nullable = true, precision = 6, scale = 0)
             public int getLbr30()
             {
                return this.lbr30;
             }
          
             public void setLbr30(int lbr30)
             {
                this.lbr30 = lbr30;
             }
          
             @Column(name = "lbr3060", nullable = true, precision = 6, scale = 0)
             public int getLbr3060()
             {
                return this.lbr3060;
             }
          
             public void setLbr3060(int lbr3060)
             {
                this.lbr3060 = lbr3060;
             }
          
             @Column(name = "lbr6090", nullable = true, precision = 6, scale = 0)
             public int getLbr6090()
             {
                return this.lbr6090;
             }
          
             public void setLbr6090(int lbr6090)
             {
                this.lbr6090 = lbr6090;
             }
          
             @Column(name = "lbr90", nullable = true, precision = 6, scale = 0)
             public int getLbr90()
             {
                return this.lbr90;
             }
          
             public void setLbr90(int lbr90)
             {
                this.lbr90 = lbr90;
             }
          
             @Column(name = "tagihlbt", nullable = true, precision = 12, scale = 0)
             public long getTagihlbt()
             {
                return this.tagihlbt;
             }
          
             public void setTagihlbt(long tagihlbt)
             {
                this.tagihlbt = tagihlbt;
             }
          
          }
          



          class SaId is :


          @Embeddable
          public class SaId implements java.io.Serializable
          {
              
             private String cabang = "YGY";// =cab.getKota();
             private String tahun = "2010";// =cab.getTahun();
             private String bulan = "02";// =cab.getBulan();
             private String kode;
          
             public SaId()
             {      
             }
          
             public SaId(String cabang, String tahun, String bulan, String kode)
             {
                this.cabang = cabang;
                this.tahun = tahun;
                this.bulan = bulan;
                this.kode = kode;
             }
          
             @Column(name = "cabang", nullable = true, length = 3)
             @Length(max = 3)
             public String getCabang()
             {     
                return this.cabang;
             }
          
             public void setCabang(String cabang)
             {
                this.cabang = cabang;
             }
          
             @Column(name = "tahun", nullable = true, length = 4)
             @Length(max = 4)
             public String getTahun()
             {
                return this.tahun;
             }
          
             public void setTahun(String tahun)
             {
                this.tahun = tahun;
             }
          
             @Column(name = "bulan", nullable = true, length = 2)
             @Length(max = 2)
             public String getBulan()
             {
                return this.bulan;
             }
          
             public void setBulan(String bulan)
             {
                this.bulan = bulan;
             }
          
             @Column(name = "kode", nullable = false, length = 5)
             @NotNull
             @Length(max = 5)
             public String getKode()
             {
                return this.kode;
             }
          
             public void setKode(String kode)
             {
                this.kode = kode;
             }
          
             public boolean equals(Object other)
             {
                if ((this == other))
                   return true;
                if ((other == null))
                   return false;
                if (!(other instanceof SaId))
                   return false;
                SaId castOther = (SaId) other;
          
                return ((this.getCabang() == castOther.getCabang()) || (this.getCabang() != null && castOther.getCabang() != null && this.getCabang().equals(castOther.getCabang()))) && ((this.getTahun() == castOther.getTahun()) || (this.getTahun() != null && castOther.getTahun() != null && this.getTahun().equals(castOther.getTahun()))) && ((this.getBulan() == castOther.getBulan()) || (this.getBulan() != null && castOther.getBulan() != null && this.getBulan().equals(castOther.getBulan()))) && ((this.getKode() == castOther.getKode()) || (this.getKode() != null && castOther.getKode() != null && this.getKode().equals(castOther.getKode())));
             }
          
             public int hashCode()
             {
                int result = 17;
          
                result = 37 * result + (getCabang() == null ? 0 : this.getCabang().hashCode());
                result = 37 * result + (getTahun() == null ? 0 : this.getTahun().hashCode());
                result = 37 * result + (getBulan() == null ? 0 : this.getBulan().hashCode());
                result = 37 * result + (getKode() == null ? 0 : this.getKode().hashCode());
                return result;
             }   
          }
          



          class Cabang is :


          @Entity
          @Name("cab")
          @Scope(SESSION)
          @Table(name = "cabang", catalog = "eStock2011")
          public class Cabang implements java.io.Serializable {
          
                  private Integer id;
                  private String kode;    
                  private String kota;    
                  private String nama;
                  private Double nomer;
                  //Numpang naruh variable yang tidak disimpan di database.       
                  private String tahun;   
                  private String bulan;
                  
                  public Cabang() {
                  }
          
                  public Cabang(String kode, String kota, String nama, Double nomer) {
                          this.kode = kode;
                          this.kota = kota;
                          this.nama = nama;
                          this.nomer = nomer;
                  }
          
                  @Id
                  @GeneratedValue(strategy = IDENTITY)
                  @Column(name = "id", unique = true, nullable = false)
                  public Integer getId() {
                          return this.id;
                  }
          
                  public void setId(Integer id) {
                          this.id = id;
                  }
          
                  @Column(name = "kode", length = 2)
                  @Length(max = 2)
                  public String getKode() {
                          return this.kode;
                  }
          
                  public void setKode(String kode) {
                          this.kode = kode;
                  }
          
                  @Column(name = "kota", length = 3)
                  @Length(max = 3)
                  public String getKota() {
                     System.out.println("Kota : " + kota);
                          return this.kota;
                  }
          
                  public void setKota(String kota) {
                          this.kota = kota;
                  }
          
                  @Column(name = "nama", length = 20)
                  @Length(max = 20)
                  public String getNama() {         
                          return this.nama;
                  }
          
                  public void setNama(String nama) {
                          this.nama = nama;
                  }
          
                  @Column(name = "nomer", precision = 22, scale = 0)
                  public Double getNomer() {
                          return this.nomer;
                  }
          
                  public void setNomer(Double nomer) {
                          this.nomer = nomer;
                  }
                  @Transient
             public String getTahun()
             {
                     System.out.println("Tahun : " + tahun);
                return tahun;
             }
          
             public void setTahun(String tahun)
             {
                this.tahun = tahun;
             }
             @Transient
             public String getBulan()
             {
                System.out.println("Bulan : " + bulan);
                return bulan;
             }
          
             public void setBulan(String bulan)
             {
                this.bulan = bulan;
             }
          
          }
          




          could somebody help me?


          Thank you


          • 3. Re: Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component:..."
            Rob Shepherd Newbie

            Hi Feri,


            You can't use injected comonents during a constructor.


            (The reason being, there is technically no instance yet for the interceptors to inject the dependency into)


            So,


            You need to move any work with injected dependencies into a method annotated with @Create, as this is run after the constructor, when the interceptors can get to your instance.


            I haven't looked at your code in any depth, but try this for example.



            public SaHome()
            {     
                // setDaId(..) moved to onCreate()
            }
            
            @Create
            public onCreate()
            {
                setSaId(new SaId());
            }
            



            Hope this helps,


            Rob


            • 4. Re: Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component:..."
              Rob Shepherd Newbie

              Sorry,  that code example was clearly awful, I'm sure you'd have worked it out but this is better:


              public SaHome()
              {     
                  // setSaId(..) moved to onCreate()
              }
              
              @Create
              public void onCreate()
              {
                  setSaId(new SaId());
              }
              
              

              • 5. Re: Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component:..."
                Feri Lauw Newbie

                Hi Sir Rob,

                I already Try as you told me before, but when i run the project error come :




                Caused by: java.lang.IllegalStateException: component has two @Create methods: <component name>
                     at org.jboss.seam.Component.scanMethod(Component.java:677)
                     at org.jboss.seam.Component.initMembers(Component.java:552)
                     at org.jboss.seam.Component.<init>(Component.java:244)
                     at org.jboss.seam.Component.<init>(Component.java:205)
                     at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1186)





                I try to find in forum too about this error and i found link like this :

                component has two @Create


                Could you help me?


                Thanks u so much

                • 6. Re: Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component:..."
                  Rob Shepherd Newbie

                  Feri,


                  in your object's inheritance


                  Home
                  \
                   \
                    EntityHome
                    \
                     \
                      SaHome
                  



                  Home already has the @Create annotation in use, but (if you look at the source) it is kind enough to offer you a method you can override during this process.


                  @Override
                  public void create()
                  {
                      super.create();
                      setSaId(new SaId());
                  }
                  



                  .... should do the trick!

                  • 7. Re: Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component:..."
                    Feri Lauw Newbie

                    Hi Sir Rob,

                    Thanks you so much, the solution that you give to me it's work!.

                    • 8. Re: Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component:..."
                      Feri Lauw Newbie

                      Hai Sir Rob,

                      When I Save error come :
                      Caused by javax.servlet.ServletException with message: "#{saHome.persist}: org.hibernate.validator.InvalidStateException: validation failed for: org.fla.eStock.entity.Sa"


                      I Try Override persist(), but still error.
                      Could you help me?


                      Thanks before.