3

I am currently trying to migrate smartGWT 4.0 sample project callled BuiltinDS to Maven through Eclipse, with the following characteristics:

  • Smartgwt version 4.0-pro
  • GWT version 2.8.1
  • JDK java 1.8
  • Eclipse version 2021-03
  • SmartGWT libraries are in NEXUS

enter image description here

enter image description here

enter image description here

enter image description here

This is the Pom with the dependencies I found it should have.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>builtinds</groupId>
  <artifactId>builtinds</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <dependencies>
  
           <!-- Standard GWT depdendency -->
           <dependency>
               <groupId>com.google.gwt</groupId>
               <artifactId>gwt-user</artifactId>
               <version>2.8.1</version>
               <scope>provided</scope>
           </dependency>
           
            <!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-servlet -->
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-servlet</artifactId>
                <version>2.8.1</version>
                <scope>provided</scope>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-dev -->
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-dev</artifactId>
                <version>2.8.1</version>
                <scope>provided</scope>
            </dependency>
            
            
            <!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api -->
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
            </dependency>
    
           <!-- The SmartGWT Evaluation edition -->
           <dependency>
               <groupId>com.isomorphic.smartgwt.pro</groupId>
               <artifactId>smartgwt-pro</artifactId>
               <version>4.0-focuss</version>
               <exclusions>
                    <!-- Exclusion: required to avoid conflicting with the asm dependency below -->
                    <exclusion>
                        <groupId>asm</groupId>
                        <artifactId>asm</artifactId>
                    </exclusion>
                </exclusions>
           </dependency>
    
           <!-- Add support for SQLDataSources -->
           <dependency>
               <groupId>com.isomorphic.smartgwt.pro</groupId>
               <artifactId>isomorphic-sql</artifactId>
               <version>4.0-focuss</version>
           </dependency>
           
           <!-- only_for_building\log4j\log4j-1.2.15.jar -->
            <!-- https://mvnrepository.com/artifact/log4j/log4j -->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.17</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/org.hsqldb/hsqldb --> 
            <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>2.2.9</version>
            </dependency>   
            
            <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.3</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/commons-collections/commons-collections -->
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>3.2.1</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
            <dependency>
                <groupId>commons-fileupload</groupId>
                <artifactId>commons-fileupload</artifactId>
                <version>1.3</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-dbcp2</artifactId>
                <version>2.0</version>
            </dependency>       
            
            
            <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml</artifactId>
                <version>3.9</version>
            </dependency>
            
            <!-- Logging: Slf4j -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.7.7</version>
            </dependency>
        
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.7</version>
            </dependency>       
            
            <!-- https://mvnrepository.com/artifact/commons-jxpath/commons-jxpath -->
            <dependency>
                <groupId>commons-jxpath</groupId>
                <artifactId>commons-jxpath</artifactId>
                <version>1.3</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/oro/oro -->
            <dependency>
                <groupId>oro</groupId>
                <artifactId>oro</artifactId>
                <version>2.0.6</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/com.smartgwt/smartgwt-skins -->
            <dependency>
                <groupId>com.smartgwt</groupId>
                <artifactId>smartgwt-skins</artifactId>
                <version>2.5</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.4</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/commons-pool/commons-pool -->
            <dependency>
                <groupId>commons-pool</groupId>
                <artifactId>commons-pool</artifactId>
                <version>1.4</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi</artifactId>
                <version>3.9</version>
            </dependency>   
            
            <!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-maven-plugin -->
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.19.v20190610</version>
            </dependency>       
    
       
    </dependencies>
       
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      
      <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>gwt-maven-plugin</artifactId>
           <version>2.8.1</version>
           <executions>
                  <execution>
                      <goals>
                          <goal>compile</goal>
                      </goals>
                  </execution>
           </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.0.0</version>
     </plugin>
    </plugins>
  </build>
</project>

This is the BuiltInDS.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.6.1//EN"
   "http://www.gwtproject.org/doctype/2.6.1/gwt-module.dtd">
<module rename-to="builtinds">
    <inherits name='com.google.gwt.user.User'/>
    <inherits name="com.smartgwt.tools.SmartGwtTools"/>
    <inherits name="com.smartgwtee.tools.Tools"/>
    <inherits name="com.smartgwtee.SmartGwtEE"/>

    <!-- Other module inherits -->
    <!-- 1) Add SmartGWT module -->
    <inherits name="com.smartgwt.SmartGwt"/>
    
    <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
    
    <entry-point class='com.smartgwt.sample.client.BuiltInDS'/>
</module>

This is the BuiltInDS.html

<!DOCTYPE html>

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <!--                                           -->
    <!-- Any title is fine                         -->
    <!--                                           -->
    <title>BuiltInDS</title>
    
    <!-- IMPORTANT : You must set the variable isomorphicDir to [MODULE_NAME]/sc/ so that the SmartGWT resource are 
      correctly resolved -->    
    <script> var isomorphicDir = "builtinds/sc/"; </script>
    
    <!--                                           -->
    <!-- This script loads your compiled module.   -->
    <!-- If you add any GWT meta tags, they must   -->
    <!-- be added before this line.                -->
    <!--                                           -->      
    <script type="text/javascript" language="javascript" src="builtinds/builtinds.nocache.js"></script>

    <!-- The following script is required if you're running (Super)DevMode and are using module
         definitions that contain <script> tags.  Normally, this script is loaded automatically
         by builtinds.nocache.js above, but this isn't possible when (Super)DevMode is running.
         Note: it should not create any issue to always load it below (even if already loaded). -->
    <script type="text/javascript" language="javascript" src="builtinds/loadScriptTagFiles.js"></script>

    <script src="builtinds/sc/modules/ISC_Core.js"> </script>
    <script src="builtinds/sc/modules/ISC_Foundation.js"> </script>
    <script src="builtinds/sc/modules/ISC_Containers.js"> </script>
    <script src="builtinds/sc/modules/ISC_Grids.js"> </script>
    <script src="builtinds/sc/modules/ISC_Forms.js"> </script>
    <script src="builtinds/sc/modules/ISC_RichTextEditor.js"></script>
    <script src="builtinds/sc/modules/ISC_Calendar.js"> </script>
    <script src="builtinds/sc/modules/ISC_DataBinding.js"> </script>
    <script src="builtinds/sc/skins/Enterprise/load_skin.js"></script>

  </head>

  <!--                                           -->
  <!-- The body can have arbitrary html, or      -->
  <!-- you can leave the body empty if you want  -->
  <!-- to create a completely dynamic UI.        -->
  <!--                                           -->
  <body>

    <!--load the datasources-->
    <script src="builtinds/sc/DataSourceLoader?dataSource=supplyItem,animals,employees,bufferTable,bufferHistoryTable"></script>

    <!-- OPTIONAL: include this if you want history support -->
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>

  </body>
</html>

The compilation is successful, but when I run a configuration of type GWT Development Mode (CodeServer) the console gives me the following and the application does not launch. enter image description here

enter image description here

1 Answers1

0

I had a similar problem few months ago, on a project similar to yours, but without the involvement of Maven.

For my problem, the issue was to be blamed on the Eclipse version. It seems that any version of Eclipse AFTER 2020-06 is not capable of launching your Java 8 - GWT project with your actual Java 8. You wrote you are using 2021-03, I suggest you to try to downgrade your Eclipse to version 2020-06.

I tested my project on Eclipse 2020-06 with GWT 2.8.1 and GWT 2.9.0 and they both work very well.

I hope I have been helpful!

Luke