1. #1
    Sencha User
    Join Date
    Aug 2008
    Posts
    129
    Vote Rating
    0
    Padster is on a distinguished road

      0  

    Default Apress Ext Gwt chapter 5-6: beanmodel class not found

    Apress Ext Gwt chapter 5-6: beanmodel class not found


    Hey folks im going through gslenders book and im having trouble with bean model classes and compling my application. i have a simple bean party and i have the interface extending beanmodelmarker.

    Party class
    Code:
    package 
    Code:
    org.emn.data; 
    import java.io.Serializable;
    public class Party implements Serializable {
    privatestaticfinallongserialVersionUID = -2021563303213112570L;
    private String id;private String name;
    public Party() {}
    public Party(String id, String name) { setId(id); setName(name);}
    public String getId() { returnid;}
    publicvoid setId(String id) { this.id = id;}
    public String getName(){ returnname;}
     publicvoid setName(String name) { this.name = name;}
    }




    BeanModelMarker

    Code:
    package org.emn.data;import com.extjs.gxt.ui.client.data.BeanModelMarker;import com.extjs.gxt.ui.client.data.BeanModelMarker.BEAN; @BEAN(org.emn.data.Party.class)     public interface PartyBeanModel extends BeanModelMarker {}
    Now im quite new to Ext Gwt and java just been at it a few months and i have searched for the problem using the compilation error but i dont find something that helps me as i often dont get the answers presented by other users.

    the Error is : class not found.

    Code:
    Compiling module org.emn.GxtEmn
       Refreshing module from source
          Refreshing TypeOracle
             Processing types in compilation unit: file:/C:/GxtEmn/src/org/emn/data/PartyBeanModel.java
                Found type 'PartyBeanModel'
                   Resolving annotation '@BEAN(org.emn.data.Party.class)'
                      [ERROR] 
    java.lang.ClassNotFoundException: org.emn.data.Party
     at java.net.URLClassLoader$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClassInternal(Unknown Source)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Unknown Source)
     at com.google.gwt.dev.javac.TypeOracleMediator.getClassLiteral(TypeOracleMediator.java:763)
     at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationElementValue(TypeOracleMediator.java:674)
     at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotationInstance(TypeOracleMediator.java:442)
     at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:836)
     at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:857)
     at com.google.gwt.dev.javac.TypeOracleMediator.resolveTypeDeclaration(TypeOracleMediator.java:1384)
     at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:389)
     at com.google.gwt.dev.javac.TypeOracleMediator.refresh(TypeOracleMediator.java:417)
     at com.google.gwt.dev.javac.CompilationState.refresh(CompilationState.java:179)
     at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:93)
     at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:264)
     at com.google.gwt.dev.Precompile.precompile(Precompile.java:283)
     at com.google.gwt.dev.Compiler.run(Compiler.java:170)
     at com.google.gwt.dev.Compiler$1.run(Compiler.java:124)
     at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:84)
     at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:78)
     at com.google.gwt.dev.Compiler.main(Compiler.java:131)
       Scanning for additional dependencies: jar:file:/C:/Users/Administrator/Documents/Libraries/gxt-2.0-m1/gxt.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
                Invoking <generate-with class='com.extjs.gxt.ui.rebind.core.BeanModelGenerator'/>
                   [ERROR] Class com.extjs.gxt.ui.client.data.BeanModelLookup not found.
    java.lang.NullPointerException
     at com.extjs.gxt.ui.rebind.core.BeanModelGenerator.getMarkerBean(BeanModelGenerator.java:170)
     at com.extjs.gxt.ui.rebind.core.BeanModelGenerator.generate(BeanModelGenerator.java:53)
     at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:49)
     at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:113)
     at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:62)
     at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:172)
     at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:161)
     at com.google.gwt.dev.Precompile$DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(Precompile.java:204)
     at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:128)
     at com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.process(AbstractCompiler.java:151)
     at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
     at com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.compile(AbstractCompiler.java:85)
     at com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.compile(AbstractCompiler.java:181)
     at com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.access$400(AbstractCompiler.java:71)
     at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:473)
     at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:73)
     at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:254)
     at com.google.gwt.dev.Precompile.precompile(Precompile.java:300)
     at com.google.gwt.dev.Compiler.run(Compiler.java:170)
     at com.google.gwt.dev.Compiler$1.run(Compiler.java:124)
     at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:84)
     at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:78)
     at com.google.gwt.dev.Compiler.main(Compiler.java:131)
       [ERROR] Errors in 'jar:file:/C:/Users/Administrator/Documents/Libraries/gxt-2.0-m1/gxt.jar!/com/extjs/gxt/ui/client/data/BeanModelLookup.java'
          [ERROR] Line 24:  Failed to resolve 'com.extjs.gxt.ui.client.data.BeanModelLookup' via deferred binding
       [ERROR] Cannot proceed due to previous errors
    Please can someone with lots of patience help me out. i have been through the books source code and i cant see what i have missed out they seem identical to me.


  2. #2
    Ext User
    Join Date
    May 2009
    Location
    Germany
    Posts
    1
    Vote Rating
    0
    corporate-cretin is on a distinguished road

      0  

    Default


    I'm trying to compile the samples on a Rational Application Developer (Eclipse 3.4 runtime) and I am having the same problem.

    I've also tried different jre versions (1.5, 1.6) without luck.

    Code:
    compile-gwt:
         [java] Compiling module com.extjs.gxt.samples.resources.Resources
         [java]    Refreshing module from source
         [java]       Refreshing TypeOracle
         [java]          Processing types in compilation unit: file:/D:/Development/work/workspaces/workspace_rad75/wspl_gxt_war/src/com/extjs/gxt/samples/resources/client/model/CustomerBeanModel.java
         [java]             Found type 'CustomerBeanModel'
         [java]                Resolving annotation '@BEAN(com.extjs.gxt.samples.resources.client.model.Customer.class)'
         [java]                   [ERROR] 
         [java] java.lang.ClassNotFoundException: com.extjs.gxt.samples.resources.client.model.Customer
         [java]     at java.net.URLClassLoader$1.run(Unknown Source)
         [java]     at java.security.AccessController.doPrivileged(Native Method)
         [java]     at java.net.URLClassLoader.findClass(Unknown Source)
         [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
         [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
         [java]     at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         [java]     at java.lang.Class.forName0(Native Method)
         [java]     at java.lang.Class.forName(Unknown Source)
         [java]     at com.google.gwt.dev.javac.TypeOracleMediator.getClassLiteral(TypeOracleMediator.java:763)
         [java]     at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationElementValue(TypeOracleMediator.java:674)
         [java]     at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotationInstance(TypeOracleMediator.java:442)
         [java]     at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:836)
         [java]     at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:857)
         [java]     at com.google.gwt.dev.javac.TypeOracleMediator.resolveTypeDeclaration(TypeOracleMediator.java:1384)
         [java]     at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:389)
         [java]     at com.google.gwt.dev.javac.TypeOracleMediator.refresh(TypeOracleMediator.java:417)
         [java]     at com.google.gwt.dev.javac.CompilationState.refresh(CompilationState.java:179)
         [java]     at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:93)
         [java]     at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:264)
         [java]     at com.google.gwt.dev.Precompile.precompile(Precompile.java:283)
         [java]     at com.google.gwt.dev.Compiler.run(Compiler.java:170)
         [java]     at com.google.gwt.dev.Compiler$1.run(Compiler.java:124)
         [java]     at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:84)
         [java]     at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:78)
         [java]     at com.google.gwt.dev.Compiler.main(Compiler.java:131)
         [java]    [ERROR] Module has no entry points defined
         [java] Java Result: 1
    any ideas?

  3. #3
    Sencha User
    Join Date
    Aug 2008
    Posts
    129
    Vote Rating
    0
    Padster is on a distinguished road

      0  

    Default


    I decided to try and implement BeanmodelTag and changed my party class to the following

    Code:
     
    import
    
    com.extjs.gxt.ui.client.data.BeanModelTag;
    publicclass Party implements BeanModelTag,Serializable {}
    I then compiled my code in hosted mode and it worked!! For fun i though id remove the beanModelTag from the implementation of the class and surprise it still worked however only in hosted mode!

    I cannot complie normally only through hosted mode. This makes no sense!

    Im using GWt 1.6 and the google eclipse plugin. (compile button is what i mean by normal compile)

  4. #4
    Sencha Premium Member
    Join Date
    Dec 2008
    Location
    Munich, Germany
    Posts
    183
    Vote Rating
    0
    Jose Jeria is an unknown quantity at this point

      0  

    Default


    What book is this?

  5. #5
    Sencha User
    Join Date
    Aug 2008
    Posts
    129
    Vote Rating
    0
    Padster is on a distinguished road

      0  

    Default


    Developing with Ext GWT: Enterprise RIA Development

    http://www.apress.com/book/view/1430219408

  6. #6
    Sencha Premium Member
    Join Date
    Dec 2008
    Location
    Munich, Germany
    Posts
    183
    Vote Rating
    0
    Jose Jeria is an unknown quantity at this point

      0  

    Default


    Thanks!

  7. #7
    Ext GWT Premium Member
    Join Date
    Apr 2009
    Location
    NYC
    Posts
    112
    Vote Rating
    1
    stan229 is on a distinguished road

      0  

    Default


    Is your class with the annotation in the client project?

    BTW. I highly recommend that book! Saved me many hours. Doesn't have much content, but there's not that much to write about. Sometimes its nice to see something being explained in text rather than in JavaDoc

  8. #8
    Sencha User
    Join Date
    Aug 2008
    Posts
    129
    Vote Rating
    0
    Padster is on a distinguished road

      0  

    Default


    No i dont have it in the client package. Following examples in the book i have put my bean class in a package called "data". modified the Xml to recognise the new package etc.
    Attached Images

  9. #9
    Sencha Premium Member
    Join Date
    Dec 2008
    Location
    Munich, Germany
    Posts
    183
    Vote Rating
    0
    Jose Jeria is an unknown quantity at this point

      0  

    Default


    Check out the "Keeping Data Independent" block on page 109. I believe that this is what you are looking for.

  10. #10
    Ext User
    Join Date
    Feb 2010
    Posts
    2
    Vote Rating
    0
    arkitekt is on a distinguished road

      0  

    Default


    The book indeed is very interesting and resourceful.

    However, i have some questions in regards to the example in chapter 6. Currently the Domain Objects are passed between client and server using the "
    Code:
    BeanModelMarker
    " interface.

    That is fine, however, i stumbled into a problem when i wanted to use
    Code:
    RowEditor
    inside the grid to edit the domain objects, This is due to the fact that
    Code:
    RowEditor
    expects an object that extends
    Code:
    ModelData
    .

    Here is the code:

    Code:
    private Grid initGrid(){
    		
    		RpcProxy<BeanModel> proxy = new RpcProxy<BeanModel>() {
    			
    			@Override
    			protected void load(Object loadConfig, AsyncCallback callback) {
    
    				TestService.Util.getInstance().loadUsers(callback);
    			}
    		};
    		
    		BeanModelReader reader = new BeanModelReader();
    		ListLoader<BeanModel> loader = new BaseListLoader(proxy, reader);
    		
    		
    		Store<BeanModel> store = new ListStore<BeanModel>(loader);
    		  
    		final RowEditor re = new RowEditor();
    		
    		Grid grid = new Grid<BeanModel>((ListStore) store, initGridColumnModel());
    		grid.setAutoExpandColumn("name");
    		grid.setBorders(false);
    		grid.setStripeRows(true);
    		grid.addPlugin(re);
    		
    		loader.load();
    		
    		return grid;
    		
    }
    I have also provided the screenshot of the grid with the RowEditor popping up but not having any editors inside.

    So how do we specify that the RowEditor should edit a particular object when we dont have it at design time!
    Attached Images