Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Batch DataSource Generator Problem

    I’m having trouble with the Batch DataSource Generator. I’m trying to generate a DataSource from a Java Bean Class. According to the instructions I’m just supposed to enter the fully qualified class name in the “List of class names” text box. I do that and I get the following error:

    Code:
    Transport error - HTTP code: 404 for URL: http://127.0.0.1:8888/extree/tools/batchDSGenerator.jsp
    I’ve attached the server log and the result text from the developer console.

    Just a note, I used the visual builder to generate the DataSource successfully providing the same fully qualified class name. However, I’m evaluating the EE version and I want to see this work. Not sure what I'm doing wrong

    Thanks.

    SmartGWT version:
    v8.2p_2012-05-11/EVAL Development Only
    Attached Files

    #2
    This generally means your <inherits> are wrong in .gwt.xml, you are missing <inherits name="com.smartgwtee.tools.Tools"/> or you have not rerun a GWT Compile since adding this inherit.

    Comment


      #3
      I did a GWT compile and tried again. There was no difference.

      Below is the contents of the .gwt.xml.

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <module rename-to='extree'>
        <inherits name='com.google.gwt.user.User'/>
        <inherits name="com.smartgwt.tools.SmartGwtTools"/>
        <inherits name="com.smartgwtee.SmartGwtEE"/>
        <inherits name="com.smartgwtee.tools.Tools"/>
        
        <!-- Specify the app entry point class.                         -->
        <entry-point class='com.gdc4s.ctia.extree.client.ExTree'/>
      </module>

      Comment


        #4
        That doesn't make a lot of sense - you should verify that in your smartgwtee.jar you have com/smartclientee/tools/public/tools/batchDSGenerator.jsp - if so, then you can clearly see from the chain of <inherits> that this file should have been copied to the war/ area when you ran a GWT compile.

        Comment


          #5
          I checked and it's there.

          I attached the image that shows what I entered and the response at the top left.
          Attached Files

          Comment


            #6
            Wait, how are you running the tool? If you're seeing that UI, you should already be at the URL for which you are showing a 404.

            Comment


              #7
              Also, please show the server-side logs that happen when you hit the OK button.

              Comment


                #8
                Attached is a picture showing that I am at the correct URL and yet I'm getting the 404.

                I also attached the server log.
                Attached Files

                Comment


                  #9
                  It generates the 404 when I add the fully qualified name of the Java Bean class to the "List of class names" text box.

                  If I don't populate it and just hit the ok button without having populated any fields then it says "DataSource Generator Messages:" with a blank area.

                  I don't have a database, I'm only looking to generate a DataSource from the beans.

                  Comment


                    #10
                    Again, how are you running the tool? We would expect that, when you see the UI from your screenshot, you are already at the URL http://127.0.0.1:8888/extree/tools/batchDSGenerator.jsp. So how can you then get a 404 for that URL? If you aren't already at that URL, what URL are you at?

                    Comment


                      #11
                      After taking a closer look, there are actually two JSPs for the Batch DataSource Generator.

                      dsGenerator.jsp
                      batchDSGenerator.jsp

                      The first one is the one that brings up the dialog shown in the attachment called dsGenerator.gif.

                      The 404 occurs after I populate the class name and hit the "ok" button. The 404 is on the "batchDSGenerator.jsp".

                      After noticing this, I just to open just the batchDSGenerator.jsp and I get the screen that is attached and called batchDSGenerator.jsp.

                      I also attached the output from the results tab.
                      Attached Files

                      Comment


                        #12
                        I dove into the JSP and called the batchDSGenerator.jsp with the URL parameter of my class and I get a little more expressive error:

                        Code:
                        HTTP ERROR: 404
                        
                        ...\extree\war\WEB-INF\classes\hibernate.cfg.xml (The system cannot find the file specified)
                        
                        RequestURI=/extree/tools/batchDSGenerator.jsp
                        From the following comment in the JSP, it looks like it's actually failing to fallback to the Java Bean because it can't find the hibernate config file.

                        Code:
                        It can also generate DataSource definitions directly from Hibernate mapped entities or POJOs
                        that follow Javabean naming semantics (ie, property foo is accessed with getFoo() and setFoo()).
                        In this case, provide any number of "className" parameters - these will be interpreted as 
                        Hibernate entity names first, then as fully-qualified Java class names if they are not found
                        as Hibernate mapped entities.  Example usage:
                        
                        http://localhost:8080/tools/batchDSGenerator.jsp?className=OrderItem&className=org.bar.foo.MyClass
                        I'm not trying to use hibernate, I'm just trying to do a POJO bean.

                        Thanks.

                        Comment


                          #13
                          We're not sure yet how you're in this state (we don't see a 404 or similar problem in the SDK after following a normal install).

                          However, one quick sanity check - do you have a need to generate dozens of DataSources at once, where you need to customize the generation process to take advantage of custom Java annotations or similar additional metadata?

                          If this isn't your use case, don't use the Batch DataSource Generator, just use the approaches from the QuickStart to declare DataSources with autoDeriveSchema.

                          Comment


                            #14
                            Actually, it’s pretty easy to reproduce.

                            1. Download and unzip latest build (see version below)
                            2. cd into the samples/builtinds directory
                            3. ant
                            4. ant hosted
                            5. goto URL: http://127.0.0.1:8888//builtinds/tools/batchDSGenerator.jsp?className=foo.Bar

                            and you should get the following error:

                            HTTP ERROR: 404
                            C:\smartgwtee-3.0p\samples\built-in-ds\war\WEB-INF\classes\hibernate.cfg.xml (The system cannot find the file specified)
                            RequestURI=//builtinds/tools/batchDSGenerator.jsp

                            SmartGWT version from Dev Console:
                            SmartClient Version: v8.2p_2012-06-01/EVAL Deployment


                            From the documentation, I should be able to do this, right? I don't want to use hibernate, I just want to generate a ds.xml for a given bean class.

                            Comment


                              #15
                              That sample project doesn't have Hibernate configured or a foo.Bar bean, so this would be expected to error out even though that might not be the clearest error message. Try it in the hibernate sample project to see it working.

                              Comment

                              Working...
                              X