Hybrid View

  1. #1
    Sencha Premium Member Neilcoder's Avatar
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    264
    Vote Rating
    0
    Neilcoder is on a distinguished road

      0  

    Default How to get the examples-src working locally?

    How to get the examples-src working locally?


    I’m currently failing to get the examples working locally, would be really cool if i could have them working locally to help mock a few UI screens, as I'm just getting to grips with Gxt (3beta4). I started to take notes as I was trying to solve the problem, that way if anyone else wants to follow my footsteps and post what they learned here that would be great

    I created a new project in eclipse, using a directory with the examples-src fold contents (from the download) placed inside a directory src.

    The project had errors but after including jars for, GWT (latest), GXT3beta4, Javaee-api-6, jabsorb (for the json array/object imports), guice 1.5, app engine sdk, JRE6 I only have one eclipse error now in com.sencha.gxt.examples.resources.server.data.Folder.java;

    Code:
    TypedQuery<Folder> q = em.createQuery("select f from Folder f where f.parentFolder is null", Folder.class);
    createQuery here doesn’t match the arguments... and neither of the 2 fixes suggested by eclipse work
    I wasn’t sure how to run the examples so I tried to run it from each of the xml files, test, resources, explorer, but these complained about not having html files, so I created a html file for each of the xml files.
    I then got this from running it;

    Code:
    00:00:00.016 [WARN] Module declares a servlet class 'com.sencha.gxt.examples.resources.server.ExampleServiceImpl' with a mapping to '/explorer/service', but the web.xml has no corresponding mapping; please add the following lines to your web.xml:
     <servlet-mapping>
     <servlet-name>com_sencha_gxt_examples_resources_server_ExampleServiceImpl</servlet-name>
     <url-pattern>/explorer/service</url-pattern>
     </servlet-mapping>
    And;

    Code:
    00:00:00.016 [WARN] Module declares a servlet class 'com.sencha.gxt.examples.resources.server.FileServiceImpl' with a mapping to '/explorer/fileservice', but the web.xml has no corresponding mapping; please add the following lines to your web.xml:
     <servlet-mapping>
     <servlet-name>com_sencha_gxt_examples_resources_server_FileServiceImpl</servlet-name>
     <url-pattern>/explorer/fileservice</url-pattern>
     </servlet-mapping>


    And I get a blank page when I go to;
    http://127.0.0.1:8888/Explorer.html?...127.0.0.1:9997

    jetty gives me a warning;

    Code:
    00:00:00.000 [WARN] Adding classpath entry 'file:/C:/Code/Gxt/GxtExamples/src/' to the web app classpath for this session 
    More info: file:/C:/eclispe/eclipse_Indigo_2011/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201202290255-rel-r37/gwt-2.4.0/doc/helpInfo/webAppClassPath.html
    I followed the link and it says;

    The most common reason to encounter this problem with a new project is using RPC, which tries to loadcom.google.gwt.user.client.rpc.RemoteService. The solution to is copy gwt-servlet.jar from the GWT install directory into your web app'swar/WEB-INF/lib/ directory.

    so the gwt-servlet.jar is already in my web directory.
    This is as far as I’ve got for now, would be good to get some insight on how to set up the examples, if anyone else managed to get them up and running ok.... any hints or tips?

    ______________________________

    Update

    I've taken a different more clunky approach to working with the example code,

    I created a GWT project in eclipse, using the option to create the template boiler plating (you the one where you enter a user name and the server replies back) and then configured this to use GXT. 3 beta 4, and used all the aforementioned jars dependencies I mentioned earlier.

    I figured if I then used the file import feature and import the examples-src , then I would be able to use import statement with them when coding in the boiler plate client package.

    However straight importing while it got the files in ok, but using the import statement from outside the client package was failing for me.

    I've (tried) to recreated the type of error I would get;

    09:31:16.963 [ERROR] [gxte] Line 65: No source code is available for type com.sencha.gxt.examples.resources.client.images.ExampleImages; did you forget to inherit a required module?

    (in reality it seems that it can't find some images in this example, but the error message format has been same for classes that aren't trying to access the image files in the ExampleImages which are missing - is this a bug that the images are missing?)

    My guess is that this error is something to do with me needed to understand the GWT framework better. So a rather clunky laborious solution I found was just to cut n paste the code into new classes inside my client package (com.example.gxte.client). This is good enough for now, and I have learnt a lot about setting up GWT projects in the process, and so far I'm putting together a page of various examples in border layout for the purpose of looking at theme / style adaptation for different colour themes.

    If anyone is having a similar experience or insights would love to hear about it here.




    ______________________

    UPDATE

    Was browsing through this forum for general reading and found some really useful information I didn't find in my initial search, thanks to Colin Alworth!

    http://www.sencha.com/forum/showthre...WT-3.0-Samples

    I will have to try this out at some point!
    Last edited by Neilcoder; 28 Mar 2012 at 1:39 AM. Reason: update with progress

  2. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    5
    Vote Rating
    1
    rss245 is on a distinguished road

      0  

    Default


    I finally compiled cleanly a GWT web application project in Java EE Eclipse but got the following
    exceptions:
    EntryPoint initialization exception
    <p>Exception while loading module com.sencha.gxt.explorer.client.Explorer. See Development Mode for details.
    com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:512) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:384) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) at java.lang.Thread.run(Unknown Source)
    c
    Console showed:
    [DEBUG] [explorer] - Validating units:
    [SPAM] [explorer] - Resolving javax.inject.Named
    [SPAM] [explorer] - Found type 'javax.inject.Named'
    [WARN] [explorer] - Ignoring unresolvable annotation type javax.inject.Qualifier
    [SPAM] [explorer] - Resolving javax.inject.Singleton
    [SPAM] [explorer] - Found type 'javax.inject.Singleton'
    [WARN] [explorer] - Ignoring unresolvable annotation type javax.inject.Scope
    [ERROR] [explorer] - Failed to create an instance of 'com.sencha.gxt.explorer.client.Explorer' via deferred binding
    [ERROR] [explorer] - Unable to load module entry point class com.sencha.gxt.explorer.client.Explorer (see associated exception for details)
    [ERROR] [explorer] - Failed to load module 'explorer' from user agent 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11' at 127.0.0.1:57369

    Any help here would be great - Why is this not working??

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    5
    Vote Rating
    1
    rss245 is on a distinguished road

      0  

    Default


    Also the Jar files I added include:
    gxt-3.0.0b.jar
    gxt-chart-3.0.0b.jar
    gxt-legacy-3.0.0b.jar
    uibinder-bridge-2.4.0.jar
    \glassfish3\glassfish\modules\javax.persistence.jar
    guice-2.0.jar
    gin-1.5-pre-gwt-2.2.jar

  4. #4
    Sencha Premium Member Neilcoder's Avatar
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    264
    Vote Rating
    0
    Neilcoder is on a distinguished road

      0  

    Default


    It might help to comment out the entrypoint in the exlorer xml file, and/or you could be missing some of the jars that you need to run the example.

    I've set it up a couple of times now and I've tried to keep track of my steps and put them in a guide here;

    http://neiliscoding.blogspot.ie/2012...-in-gxt-3.html

  5. #5
    Sencha Premium Member Neilcoder's Avatar
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    264
    Vote Rating
    0
    Neilcoder is on a distinguished road

      0  

    Default


    These are the jars that worked for me;

    gxt-3.0.0.jar
    gxt-chart-3.0.0.jar
    gxt-legacy-3.0.0.jar
    uibinder-bridge-2.4.0.jar
    gwt-dev.jar
    gin-1.5-post-gwt-2.2.jar
    guice-3.0.jar
    json-org.jar
    javax.persistence.jar
    javax.inject.jar

  6. #6
    Sencha User
    Join Date
    Jul 2012
    Posts
    5
    Vote Rating
    1
    rss245 is on a distinguished road

      0  

    Default How to get the examples-src working locally?

    How to get the examples-src working locally?


    Hello Neil Coder,
    I am trying again from scratch to build a working war file of Explorer. Does it even work under Jetty server?

    I know the war file Sencha provides works but how do I build it properly. It is not so easy. A simple zip file for eclipse would have gone a long way.
    Anyway I got stuck on part 4B:
    4b. Add GXT jar to launch configuration.
    a. Choose Run / Open Run Dialog.
    b. Select your appropriate launch configuration under 'Java Application'.
    c. Select the 'Classpath' tab.
    d. Add the gxt-3.X.X.jar to the classpath under 'User Entries'.

    Screenshots would have been nice but
    Here is what I get when I follow this under Java EE Eclipse. Maybe its different than basic eclipse?
    Under the top level run menu which I have to assume they mean here as its a separate step:
    Use Step Filters
    Run
    Debug
    Run History
    Run As
    Run Configurations..
    Debug History
    Debug As
    Debug Configurations..
    Skip All Breakpoints
    Breakpoint Types
    External Tools
    Launch the Webservices Explorer

    No where does it mention a Run Dialog box or Java Application - What do I really do here to add the jar files to the launch configuration? Run Configurations???
    Please Advise!

  7. #7
    Sencha Premium Member Neilcoder's Avatar
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    264
    Vote Rating
    0
    Neilcoder is on a distinguished road

      0  

    Default


    Quote Originally Posted by rss245 View Post
    Hello Neil Coder,

    Anyway I got stuck on part 4B:
    4b. Add GXT jar to launch configuration.
    a. Choose Run / Open Run Dialog.
    b. Select your appropriate launch configuration under 'Java Application'.
    c. Select the 'Classpath' tab.
    d. Add the gxt-3.X.X.jar to the classpath under 'User Entries'.

    Screenshots would have been nice but
    Just added a shot here from my eclipse juno,

    http://neiliscoding.blogspot.ie/2012...for-gxt-3.html

    I use; Run > Run configurations... to get there.

    ...and yep, I think I've noticed the labels in eclipse tend to change over time, depending on the version too.

Thread Participants: 1