hunthu2000 / gwt-cal

Automatically exported from code.google.com/p/gwt-cal
0 stars 0 forks source link

javascript error: “No file found for: /null” #114

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
(originally posted in 
http://groups.google.com/group/gwt-cal/browse_thread/thread/e060bbc29d0d6765)

What steps will reproduce the problem?
Hello everybody, 
I suspect I've found a bug in gwt-cal that is blocking a proof-of- 
concept project that we are running with a client in Switzerland. The 
problem is that the gwt-cal-demo project throws javascript errors and 
these currently rule out use of gwt-cal. 
I downloaded gwt-cal-0.9.2 and for use with gwt 2.1.0 in a project 
we’re developing. Everything seemed to work out fine. However I 
noticed that when I click on an appointment or switch between month 
and week view, Firefox 3.6 (with Firebug 1.6.2) shows me a javascript 
error: “No file found for: /null”. This happens in both DevMode and in 
production. In Dev mode, I confirmed that Safari 5.0.3 produces the 
same error, so I don’t think this is a browser quirk. 
Is this a known issue? Does anyone have any ideas what I can do to fix 
it? 
To investigate further, I fetched the sources from svn and managed to 
compile gwt-cal an gwt-cal-demo without errors, but the abovementioned 
error is still there. I tried switching back to gwt-2.0.3, but that 
did not solve the problem. 
I’d be very grateful for any help on this.  The rest of this post 
explains what my tests actually did in more detail. 
In eclipse 3.6 on my mac (OSX 10.6) I imported: 
- http://gwt-cal.googlecode.com/svn/trunk/gwt-cal 
- http://gwt-cal.googlecode.com/svn/trunk/gwt-cal-demo 
The first project “gwt-cal” is a maven project and the pom.xml shows 
dependencies for: 
-       com.allen_sauer.gwt.dnd.gwt-dnd:jar:3.0.0 
-       com.google.gwt:gwt-user:jar:2.0.3 
I changed to gwt-dnd-3.0.1.jar, which is what I am using locally, and 
stuck with the choice of gwt 2.0.3. However, the build still failed 
because gwt:test could not find gwt-dev-2.1.0-mac.jar, which (AFAIK) 
does not exist. (The naming convention looks like a leftover from gwt 
1.x for OSX…. ) Not really knowing how to rescue the pom, I decided to 
replace it with one taken from another project. This seems like brute 
force and probably someone out there has a better approach. 
Nonetheless this worked and for completeness I’ve attached the pom 
below. Now mvn install produces gwt-cal-0.9.2-SNAPSHOT.jar and gwt- 
cal-0.9.2-SNAPSHOT-sources.jar as expected. 
The second project “gwt-cal-demo” is a gwt project so to work with it, 
you need the get plugin - and you’ll need to make sure it’s pointing 
at gwt-2.0.3 (Eclipse/Preferences/Google/Web Tool Kit and make sure 
you use 2.0.3). The build path contains a broken reference to Allen 
Sauer’s gwt-dnd-2.6.5.jar (in /home/brad/…sigh…) which I replaced with 
gwt-dnd-3.0.1.jar in my local repository. The next problem I had was 
that the gwt-cal was included as a project in gwt-cal-demo, so the gwt- 
compiler picked up source and libs that were meant only for java unit 
test – and it failed to compile lots of *.class files into 
javascript ;-). To fix this, I removed gwt-cal as a project and 
instead added gwt-cal-0.9.2-SNAPSHOT.jar to the build path. (Note that 
gwt-dnd-3.0.1.jar and find gwt-cal-0.9.2-SNAPSHOT.jar include not only 
the *.class files but, more important for us, also the *.java  - 
excluding unit text java files - and *.gwt.xml files needed by the gwt- 
compiler as well). 
At this point, I got a clean compile. Since, to speed things up,  I 
retain only English and Polish, there are only 12 (not 60) iterations 
and output looks like this: 
Compiling module com.bradrydzewski.gwt.calendar.demo.Gwt_cal_demo 
   Compiling 12 permutations 
      Compiling permutation 0... 
      Compiling permutation 1... 
      Compiling permutation 2... 
      Compiling permutation 3... 
      Compiling permutation 4... 
      Compiling permutation 5... 
      Compiling permutation 6... 
      Compiling permutation 7... 
      Compiling permutation 8... 
      Compiling permutation 9... 
      Compiling permutation 10... 
      Compiling permutation 11... 
   Compile of permutations succeeded 
Linking into /Users/jae/Documents/workspaces/examples/gwt-cal-demo/war/ 
gwt_cal_demo. 
   Link succeeded 
   Compilation succeeded -- 67.022s 
So we now have: 
-       gwt-cal cleanly compiled 
-       all unit tests gwt-cal executed successfully 
-       gwt-cal-0.9.2-SNAPSHOT.jar updated in my local repository 
-       gwt-cal-demo cleanly compiled. 
The demo comes up in DevMode behaving exactly as expected – all seems 
fine, but that javascript error is still there!  I would be very 
grateful if anyone can let me know what’s required to fix this problem 
because it threatens to kill our proof-of-concept. In the meantime, I 
hope I’ve shed some light on how to make the project more platform 
independent. 
To complete this post, as promised, here is the pom.xml I used to get 
gwt-cal to install. 
<?xml version="1.0" encoding="UTF-8"?> 
<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 
                                                         http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
        <modelVersion>4.0.0</modelVersion> 
    <groupId>com.bradrydzewski</groupId> 
    <artifactId>gwt-cal</artifactId> 
    <packaging>jar</packaging> 
    <version>0.9.2-SNAPSHOT</version> 
        <!-- Modified POM to build gwt-cal - Jae --> 
        <name>gwt-cal</name> 
    <licenses> 
        <license> 
            <name>GNU General Public License v3</name> 
            <url>http://www.gnu.org/licenses/gpl.html</url> 
        </license> 
    </licenses> 
    <description>a personal calendar widget similar to iCal, Outlook, 
        Google Calendar, etc 
    </description> 
    <developers> 
        <developer> 
            <name>Brad Rydzewski</name> 
            <url>http://www.google.com/profiles/Brad.Rydzewski</url> 
        </developer> 
    </developers> 
    <url>http://code.google.com/p/gwt-cal/</url> 
        <properties> 
                <!-- convenience to define GWT version in one place --> 
                <gwt.version>2.0.3</gwt.version> 
                <gwt.maven.plugin.version>2.1.0</gwt.maven.plugin.version> 
                <!-- tell the compiler we can use 1.6 --> 
                <maven.compiler.source>1.6</maven.compiler.source> 
                <maven.compiler.target>1.6</maven.compiler.target> 
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
        </properties> 
        <dependencies> 
                <!-- GWT dependencies (from central repo) --> 
                <dependency> 
                        <groupId>com.google.gwt</groupId> 
                        <artifactId>gwt-servlet</artifactId> 
                        <version>${gwt.version}</version> 
                        <scope>runtime</scope> 
                </dependency> 
                <dependency> 
                        <groupId>com.google.gwt</groupId> 
                        <artifactId>gwt-user</artifactId> 
                        <version>${gwt.version}</version> 
                        <scope>provided</scope> 
                </dependency> 
                <dependency> 
                        <groupId>com.google.code.gwt-log</groupId> 
                        <artifactId>gwt-log</artifactId> 
                        <version>3.0.4</version> 
                        <scope>compile</scope> 
                </dependency> 
                <dependency> 
                <groupId>com.allen_sauer.gwt.dnd</groupId> 
            <artifactId>gwt-dnd</artifactId> 
            <version>3.0.1</version> 
        </dependency> 
                <!-- Apache Stuff --> 
                <dependency> 
                        <groupId>log4j</groupId> 
                        <artifactId>log4j</artifactId> 
                        <version>1.2.16</version> 
                </dependency> 
                <dependency> 
                        <groupId>commons-lang</groupId> 
                        <artifactId>commons-lang</artifactId> 
                        <version>2.6</version> 
                </dependency> 
                <dependency> 
                        <groupId>commons-pool</groupId> 
                        <artifactId>commons-pool</artifactId> 
                        <version>1.5.5</version> 
                </dependency> 
                <dependency> 
                        <groupId>commons-dbcp</groupId> 
                        <artifactId>commons-dbcp</artifactId> 
                        <version>1.4</version> 
                </dependency> 
                <dependency> 
                        <groupId>commons-collections</groupId> 
                        <artifactId>commons-collections</artifactId> 
                        <version>3.2.1</version> 
                </dependency> 
                <dependency> 
                        <groupId>commons-io</groupId> 
                        <artifactId>commons-io</artifactId> 
                        <version>2.0.1</version> 
                </dependency> 
                <dependency> 
                        <groupId>commons-beanutils</groupId> 
                        <artifactId>commons-beanutils-core</artifactId> 
                        <version>1.8.3</version> 
                </dependency> 
                <dependency> 
                        <groupId>commons-configuration</groupId> 
                        <artifactId>commons-configuration</artifactId> 
                        <version>1.6</version> 
                </dependency> 
                <dependency> 
                        <groupId>junit</groupId> 
                        <artifactId>junit</artifactId> 
                        <version>4.6</version> 
                        <scope>test</scope> 
                </dependency> 
        </dependencies> 
        <build> 
                <finalName>xsaps</finalName> 
                <plugins> 
                        <plugin> 
                                <groupId>org.apache.maven.plugins</groupId> 
                                <artifactId>maven-compiler-plugin</artifactId> 
                                <configuration> 
                                        <source>1.6</source> 
                                        <target>1.6</target> 
                                </configuration> 
                        </plugin> 
                        <plugin> 
                                <groupId>org.apache.maven.plugins</groupId> 
                                <artifactId>maven-jar-plugin</artifactId> 
                                <version>2.3.1</version> 
                                <configuration> 
                                        <archive> 
                                                <index>true</index> 
                                                <manifest> 
                                                        <addClasspath>true</addClasspath> 
                                                </manifest> 
                                                <manifestEntries> 
                                                        <attribute name="Built-By" value="${user.name}" /> 
                                                        <Implementation-Vendor>Brad Rydzewski </Implementation-Vendor> 
                                                        <Implementation-Title>GWT-CAL</Implementation-Title> 
                                                        <Implementation-Version>${project.version}</Implementation- 
Version> 
                                                </manifestEntries> 
                                        </archive> 
                                </configuration> 
                        </plugin> 
                        <plugin> 
                                <groupId>org.apache.maven.plugins</groupId> 
                                <artifactId>maven-source-plugin</artifactId> 
                                <version>2.1</version> 
                                <executions> 
                                        <execution> 
                                                <id>attach-sources</id> 
                                                <phase>package</phase> 
                                                <goals> 
                                                        <goal>jar</goal> 
                                                </goals> 
                                        </execution> 
                                </executions> 
                        </plugin> 
                        <plugin> 
                                <groupId>org.codehaus.mojo</groupId> 
                                <artifactId>gwt-maven-plugin</artifactId> 
                                <version>2.1.0-1</version> 
                                <executions> 
                                        <execution> 
                                                <goals> 
                                                        <goal>resources</goal> 
                                                </goals> 
                                        </execution> 
                                </executions> 
                        </plugin> 
                </plugins> 
                <extensions> 
                        <extension> 
                                <groupId>org.apache.maven.wagon</groupId> 
                                <artifactId>wagon-webdav</artifactId> 
                                <version>1.0-beta-2</version> 
                        </extension> 
                </extensions> 
                <resources> 
            <resource> 
                <directory>src/main/java</directory> 
                <includes> 
                    <include>**/client/**</include> 
                    <include>**/public/**</include> 
                    <include>**/*.gwt.xml</include> 
                    <include>**/*.gif</include> 
                    <include>**/*.png</include> 
                    <include>**/*.css</include> 
                </includes> 
            </resource> 
                </resources> 
        </build> 
        <distributionManagement> 
                <repository> 
                        <id>deployment.webdav</id> 
                        <name>Internal Release Repository</name> 
                        <url>dav:http://www.gsaps.de:180/nexus/content/repositories/ 
releases 
                        </url> 
                </repository> 
        </distributionManagement> 
</project> 

Original issue reported on code.google.com by carlos.m...@gmail.com on 9 Mar 2011 at 10:58

GoogleCodeExporter commented 9 years ago
Hello Jae,

Brad identified the issue (see the original Google Groups discussion) and I 
have updated the code so that we verify if the active theme uses background 
images or not. Please update your copy of the code to revision 366 and let us 
know if this fixes the problem.

Best,

Carlos

Original comment by carlos.m...@gmail.com on 9 Mar 2011 at 11:04

GoogleCodeExporter commented 9 years ago

Original comment by ctasada on 3 Jan 2012 at 4:01