PDA

View Full Version : Problem with access modifier during bean model lookup



goeritz
29 Aug 2008, 4:10 AM
Hi!

We have a few problems with using the new bean model in gxt-1.1-alpha3. We want to get some SamObjects via a RPC. This class extends an abstract class AbstractSamObject which is causing some problems because there's a protected getter/setter method in it.

During the compile phase we get this error messages:


Compiling module com.sam.rsc.appstatusview.AppStatusView
Scanning for additional dependencies: jar:file:/c:/UserData/m2_repo/com/extjs/gxt/1.1-alpha3/gxt-1.1-alpha3.jar!/com/extjs/gxt/ui/client/data/BeanModelLookup.java
Computing all possible rebind results for 'com.extjs.gxt.ui.client.data.BeanModelLookup'
Rebinding com.extjs.gxt.ui.client.data.BeanModelLookup
Removing units with errors
[ERROR] Errors in 'file:/C:/UserData/workspaces/SAM/com.sam.rsc/war/target/.generated/com/extjs/gxt/ui/client/data/BeanModel_com_sam_rsc_appstatusview_rpc_data_SamObject.java'
[ERROR] Line 19: The method getVersion() from the type AbstractSamObject is not visible
[ERROR] Line 56: The method setVersion(Integer) from the type AbstractSamObject is not visible
Removing invalidated units
[WARN] Compilation unit 'file:/C:/UserData/workspaces/SAM/com.sam.rsc/war/target/.generated/com/extjs/gxt/ui/client/data/BeanModel_com_sam_rsc_appstatusview_rpc_data_SamObject_Factory.java' is removed due to invalid reference(s):
[WARN] file:/C:/UserData/workspaces/SAM/com.sam.rsc/war/target/.generated/com/extjs/gxt/ui/client/data/BeanModel_com_sam_rsc_appstatusview_rpc_data_SamObject.java
[WARN] Compilation unit 'file:/C:/UserData/workspaces/SAM/com.sam.rsc/war/target/.generated/com/extjs/gxt/ui/client/data/BeanModelLookupImpl.java' is removed due to invalid reference(s):
[WARN] file:/C:/UserData/workspaces/SAM/com.sam.rsc/war/target/.generated/com/extjs/gxt/ui/client/data/BeanModel_com_sam_rsc_appstatusview_rpc_data_SamObject_Factory.java
[ERROR] Unable to find recently-generated type 'com.extjs.gxt.ui.client.data.BeanModel_com_sam_rsc_appstatusview_rpc_data_SamObject_Factory
I'm not that familiar with the Java Bean Specification but I think the access modifier protected shouldn't cause this problem in this case.
When we replace 'protected' with 'public' everything works very well.

We're using GXT 1.1-alpha3, GWT 1.5.0-rc1 and Windows XP SP3.
Thanks for your answers!


Regards,
Robert


PS: The Java Bean Support is very helpful - thanks Darrell!!



public abstract class AbstractSamObject implements Serializable {

private Integer version;

protected Integer getVersion() {
return version;
}

protected void setVersion(Integer version) {
this.version = version;
}

public AbstractSamObject() {

}

}


public class SamObject extends AbstractSamObject {
/**
*
*/
private static final long serialVersionUID = 4289225229486590175L;

private Long id;

private String name;

private String siteCode;

private Long rank;

private boolean region;

public SamObject() {
super();
}

public Long getId() {
return id;
}

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

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getSiteCode() {
return siteCode;
}

public void setSiteCode(String siteCode) {
this.siteCode = siteCode;
}

public Long getRank() {
return rank;
}

public void setRank(Long rank) {
this.rank = rank;
}

public boolean isRegion() {
return region;
}

public void setRegion(boolean region) {
this.region = region;
}

}

gslender
30 Aug 2008, 5:10 AM
This could be a bug - the bean model generator creates a new class type for GWT by reflecting the methods as compile/runtime. As such, would probably be best to post in the bugs forum.