GWT 2.7.0 superDevMode recompiling (cache.js.gz error) - eclipse

I am using eclipse to develop a gwt application and recently I migrated from GWT 2.6.0 to 2.7.0. I was always using super dev mode(with built-in jetty) and it worked ok with 2.6. While using superdev mode on 2.7 it has become quite frequent for the linker to not detect the cache.js.gz and it seems like this causes gwt to generate an insane amount of recompiles with a simple refresh(pressing F5 on firefox).
Recently I cleared my Temp folder with ccleaner and I am not sure if this affected the files used for the jetty codeserver. Though normally every time you run a gwt app it generates all the necessary files in the Temp/ folder.
Here is a sample log:
>Super Dev Mode starting up
> workDir: C:\Users\Georgios\AppData\Local\Temp\gwt-codeserver-8575962486520173754.tmp
>GET /recompile/aanwebappv1
>Job com.aan.main.AanWebAppV1_1_9
>starting job: com.aan.main.AanWebAppV1_1_1
>binding: user.agent=gecko1_8
>skipped compile because no input files have changed
0.091s total -- Compile completed
>GET /aanwebappv1/164467EFAF74C025EFC82CAB8189FED3.cache.js
> Sent error page: not found: C:\Users\Georgios\AppData\Local\Temp\gwt-codeserver-8575962486520173754.tmp\com.aan.main.AanWebAppV1\compile-2\war\aanwebappv1\164467EFAF74C025EFC82CAB8189FED3.cache.js.gz
>starting job: com.aan.main.AanWebAppV1_1_5
>GET /recompile/aanwebappv1
>Job com.aan.main.AanWebAppV1_1_10
binding: user.agent=gecko1_8
skipped compile because no input files have changed
> 0.081s total -- Compile completed
> starting job: com.aan.main.AanWebAppV1_1_6
>GET /aanwebappv1/4D923033DA748FA380787E84FE5C58B9.cache.js
>Sent error page: not found: C:\Users\Georgios\AppData\Local\Temp\gwt-codeserver-8575962486520173754.tmp\com.aan.main.AanWebAppV1\compile-2\war\aanwebappv1\4D923033DA748FA380787E84FE5C58B9.cache.js.gz
This [GET/recompile-starting job-Sent error page: not found:] cycle goes on and on generating 30-40 compiles or even more slowing the debugging process greatly...It even happens on the first compile sometimes..Any thoughts-ideas how to fix this?

Related

Codename one ActionListener build process not working

I am building my first app with codename one.
However I think that there is a bug during build when using eclipse and the new GUI Builder.
I'm on eclipse neon and just installed the cn1 plugin this week.
1) The main thing which causes actionListeners not to work is that there is a line missing inside the EventCallbackClass
public void actionPerformed(com.codename1.ui.events.ActionEvent ev) {
com.codename1.ui.Component sourceComponent = ev.getComponent();
if(sourceComponent.getParent().getLeadParent() != null) {
sourceComponent = sourceComponent.getParent().getLeadParent();
}
if(sourceComponent == gui_createAccount) {
--------------missing------------------
}
}
The oncreateAccountActionEvent-method should be invoked in there, but it is not in the generated code.
It probaly is caused because I get an error during build
2) I get this error when clicking the "Action Event" within the "Property Sheet" -> "Events" view.
'Building workspace' has encountered a problem. Errors occured during the build.
Errors occurred during the build.
Errors running builder 'Integrated External Tool Builder' on project 'MA'.
Ant build C:\Users\sieben\workspace\MA\build.xml already in progress. Concurrent Ant builds are possible if you specify to build in a separate JRE.
Ant build C:\Users\sieben\workspace\MA\build.xml already in progress. Concurrent Ant builds are possible if you specify to build in a separate JRE.
The console window however looks fine to me
[echo] Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
[echo] code size and wider device support
[javac] C:\Users\sieben\workspace\MA\build.xml:147: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] C:\Users\sieben\workspace\MA\build.xml:171: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Buildfile: C:\Users\sieben\workspace\MA\build.xml
jar:
[copy] Copying 1 file to C:\Users\sieben\workspace\MA\build\tmp
[javac] Compiling 4 source files to C:\Users\sieben\workspace\MA\build\tmp
[jar] Building jar: C:\Users\sieben\workspace\MA\dist\MA.jar
BUILD SUCCESSFUL
Total time: 1 second
Thanks for any advice, maybe I have to start over...
Edit - workaround:
specify the action event listener method inside the constructor like this:
gui_createAccount.addActionListener((ev) -> {
oncreateAccountActionEvent(ev);
});
This is a bug that was already fixed in the other IDE's but seems to still impact Eclipse. We'll try to release an Eclipse update as soon as the responsible engineer can muster it.

How can I fix tests in Ember testem with errors such as 'could not load', 'failed', 'could not find module' or 'died'?

I managed to get a couple of EAK/grunt based Ember apps upgraded to 1.11 with HTMLBars, and then got them migrated to Ember CLI/Brocolli. The unit tests were setup for karma test runner so I'm looking at how to get those running in the CLI projects now, but I didn't write the tests and really have no experience with unit testing javascript modules.
Searching around the iNet, I can see that others have also used karma becasue of its coverage output and are trying to get it to work with Ember CLI, but that Ember Core isn't supporting it, though they say anyone should be able to get it set up with a custom addon. I'm also trying to use the 'testem' runner to see what sticks with that.
The Ember site does have an 'automating tests with runners' page for v1.10, with sections on 'testem' and 'karma', but it doesn't appear for v1.11 so I can't tell from that site what is or isn't relevant. But it seems like I should be able to work out a solution for the karma test runner, so I added the old devDependencies to the project package.json:
"karma": "^0.12.31",
"karma-chai": "~0.1.0",
"karma-chrome-launcher": "~0.1.2",
"karma-coverage": "~0.2.1",
"karma-firefox-launcher": "~0.1.3",
"karma-junit-reporter": "~0.2.1",
"karma-mocha": "~0.1.3",
"karma-phantomjs-launcher": "~0.1.2",
"karma-sinon-chai": "~0.1.5"
I also dropped the old 'karma.conf.js' (along with a few other karma confs) in the project and updated the paths inside (from 'vendor' to 'bower_components'). I did find a 'ember-cli-karma' node mode and installed it, but it seems to just have a 'package.json'. It has no docs and seems like just a stubbed out starter project with no implementation. I also installed 'karma', 'karma-cli' and 'testem' node modules.
The testem docs say to add you src and test files to 'testem.json', but with out examples I don't know what that means; a list of every src and test file? With what path; relative, absolute? Forward slashes, backslashes? preceded with / or ./ or ../? I just left them out because I think the system just finds the src and tests by convention.
When I run 'karma init' I get:
readline.js:529
this.line = this.line.slice(this.cursor);
^
TypeError: Cannot read property 'slice' of undefined
When I run 'testem' I get:
TEST'EM 'SCRIPTS!
Open the URL below in a browser to connect.
http://localhost:7357/aN;0faN;NaNf
...then the project's '../tests/index.html' loads in a browser, but is not able to 'find' any of the asset files (css, js) so nothing executes or renders correctly. I just see template expressions ({{content-for 'head'}}, etc).
When I run 'ember test' I get:
Building...BuildingBuilding.Building..Building...Built project successfully.
1..0
# tests 0
# pass 0
# fail 0
# ok
No tests were run, please check whether any errors occurred in the page (ember test --server) and ensure that you have a test launcher (e.g. PhantomJS) enabled.
When I run 'ember test --server' I get:
The test index.html loaded in a browser with a test report. When I uncheck 'hide passed tests' the report indicates '29 passed, 28 failed'. It has 11 sections where a particular test may have 3 problems such as 'could not load', 'failed', 'could not find module', 'attempting to register an unknown factory' or 'died'.
With this, I'm obviously running testem and not karma, so may as well work on getting testem working and figure out karma later. If there were more examples and migration troubleshooting docs I might have a systematic way to work through some of these problems.
I ran into "No tests were run,..." problem recently after a node upgrade. I fixed it with a:
npm install -g phantomjs
This provides some additional options as well:
https://github.com/ember-cli/ember-cli/issues/3969
I had the Cannot read property 'slice' of undefined error on MS Windows, running via MSys2. I have solved it by using karma init from an ordinary cmd prompt.

Dart : How to set the preamble file to run on the command-line?

I used eclipse with dart plugins, when I run "pub build", I got the result below.
I had move the built directory to a VPS with Tomcat, the client code runs okay.
How to run the server side code(TreeFilesystemServer.dart)?
Because I had some server side code, the result says I might provide a preamble file.
Do I must provide the preamble file? What does preamble file mean?
Thanks in advance!
1.My project framework.
Main
--web
--allyEdit
--TreeFilesystemServer.dart <=(this is a server side code)
--Main.css
--Main.dart <=(this is the entry point of client )
--Main.html
--pubspec.lock
--pubspec.yaml
2.Below is the message when I run pub build.
[Info from Dart2JS]:
Compiling allyEdit_dart|web/allyEdit/TreeFilesystemServer.dart...
[Warning from Dart2JS on allyEdit_dart|web/allyEdit/TreeFilesystemServer.dart]:
When run on the command-line, the compiled output might require a preamble file located in:
<sdk>/lib/_internal/lib/preambles.
[Info from Dart2JS]:
Took 0:00:04.534259 to compile allyEdit_dart|web/allyEdit/TreeFilesystemServer.dart.
Built 1649 files to "build".
A "preamble file" for dart2js compiled output is a javascript file that sets up a JS environment sufficiently similar to that of a browser, so that dart2js output can be run outside of the browser.
The Dart project's tests can be run both in a browser, in the "d8" stand-alone JavaScript shell based on v8, and in "jsshell" which is a stand-alone version of the Mozilla JS engine.
For the last two, the compiled code needs a "preamble file" to be executed before the compiled script. The dart2js preamble files are located in sdk/lib/_internal/compiler/js_lib/preambles - they were moved here semi-recently, so some older references might point to a different location.
If you only run that dart2js compiled code in a browser, you don't need to provide a preamble file.
If you want to test the output in d8, you will need the d8 preamble file (which sets up hooks for printing and simulates timers).

Running GWT SuperDevMode in IDEA on Win8

I am trying to configure my GWT project to run in SuperDevMode and experience severe problem during server run time.
So, I have working "regular" devMode configuration in Intellij IDEA. Created a new GWT configuration in app-servers list. Set the following values:
[Checked] Super Dev Mode
VM options: -Xmx512m -XX:MaxPermSize=384M
Dev Mode parameters: -bindAddress 0.0.0.0 -port 1234 -workDir d:\projects\myApp\SDV\ -src d:\projects\myApp\src\main\java com.app.MyApp
Made changes to my project's build xml file adding the lines in the end of file:
<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
<!-- enable source maps -->
<set-property name="compiler.useSourceMaps" value="true" />
Here is the console output on this config run:
workDir: d:\projects\myApp\SDV
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
binding: user.agent=safari
binding: compiler.useSourceMaps=true
binding: locale=en
Compiling module com.app.MyApp
Compiling 1 permutation
Compiling permutation 0...
Source Maps Enabled
Compile of permutations succeeded
Linking into d:\projects\myApp\SDV\com.app.MyApp\compile-1\war\myapp; Writing extras to d:\projects\myApp\SDV\com.app.MyApp\compile-1\extras\myapp
Link succeeded
Compilation succeeded -- 84.458s
Compile completed in 85210 ms
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
[ERROR] unable to create directory: d:\projects\myApp\SDV\com.app.MyApp\compile-1
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.codeserver.CompileDir.mkdir(CompileDir.java:103)
at com.google.gwt.dev.codeserver.CompileDir.create(CompileDir.java:93)
at com.google.gwt.dev.codeserver.Recompiler.makeCompileDir(Recompiler.java:267)
at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:82)
....
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Process finished with exit code 1
I suspect it maybe Win8 file access permissions problem: cannot create the directory because it wasn't deleted successfully. Both lines in the log above that have this text:
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
are of red color in IDEA (if that has any special meaning).
I unchecked READ_ONLY checkbox in the properties of for the work folder in file explorer, and also run idea64.exe as Admin. Should I somehow run this codeserver compiler "as admin" too? Is it possible?
Also it may be a configuration issue, if it is and somebody can see it from the details below - I would really appreciate the help. Thanks in advance!
UPDATE
Running the superDevMode config with parameter "-noprecompile" gives the same results:
workDir: d:\projects\myApp\sdv
deleting: d:\projects\myApp\sdv\com.app.MyApp\compile-1
Module setup completed in 865 ms
deleting: d:\projects\myApp\sdv\com.app.MyApp\compile-1
[ERROR] unable to create directory: d:\projects\myApp\sdv\com.app.MyApp\compile-1
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.codeserver.CompileDir.mkdir(CompileDir.java:103)
at com.google.gwt.dev.codeserver.CompileDir.create(CompileDir.java:93)
at com.google.gwt.dev.codeserver.Recompiler.makeCompileDir(Recompiler.java:267)
So, definitely looks like file access problem (delete doesn't do its job?). Javadoc to CompileDir.create() method says: "Creates a new compileDir directory structure. The directory must not already exist, but its parent should exist." Seems that it already exists.
I think your configuration is correct. I am using the same parameters (with another portnumber) on my Mac and it works as expected.
The red color of the text:
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
is normal and indicates no problem.
I am not familiar with Windows 8, but would think, that you don't need to run idea.exe with admin rights. I think, uncheck the read-only checkbox should solve your problems.
Another way should be, that you create your workDir directory with Intellij.
File -> New -> directory
(That's what I did).
Ok, so this is fixed now in GWT 2.7.0 by GWT team.
https://code.google.com/p/google-web-toolkit/issues/detail?id=8619
Runs well, even though I can notice the message in the IDE console:
[WARN] unable to delete 'C:\Users\me\AppData\Local\Temp\gwt-codeserver-1341369077945982663.tmp\com.bla.MyAPP\compile-1' (skipped)
[ERROR] unable to create directory: C:\Users\me\AppData\Local\Temp\gwt-codeserver-1341369077945982663.tmp\com.bla.MyAPP\compile-1
Loading Java files in com.bla.MyAPP.
after printing this the IDE continues to run the app server.
Resolving the issue.
I also found that if you are converting your project from GWT 2.6.0 to 2.7.0, you should delete your 2.6.0 run configuration and setup a new one with GWT 2.7.0 defaults.

Runtime error when deploying a JavaFX application

I'm trying to deploy a JavaFX app. The app I've been working on is fairly complex and includes several libraries. When I create a jnlp and try to run it I always get a "Runtime error. Click for details" message. Someone suggested I try doing just a simple Hello World app to see if it's an issue with the included libraries. I tried that and I still get the "Runtime error."
Here's the build.xml I'm trying to use.
<project name="App" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="C:\Program Files\Java\jdk7\lib\ant-javafx.jar" />
<target name="default">
<fx:deploy width="600" height="400" outdir="${basedir}/dist" outfile="App">
<fx:application name="App" mainClass="${javafx.main.class}"/>
<fx:resources>
<!-- include application jars -->
<fx:fileset dir="${basedir}" includes="*.jar"/>
<fx:fileset dir="${basedir}/lib" includes="*.jar"/>
<fx:fileset dir="${basedir}" includes="app.ini" />
<fx:fileset dir="${basedir}/template" includes="*.template" />
</fx:resources>
<!-- request user level installation -->
<fx:preferences install="false"/>
</fx:deploy>
</target>
</project>
For the Hello World version I just removed the <fx:resources> section.
I run both of them from inside eclipse as an ant task. They both created a dist folder in my project with a .jnlp and a .html file. I then click on the jnlp to run the app and see a small window that has the text, "Runtime error. Click for details.' I click it and get an error window that says, "The application failed to run. There was an error while executing the application. Click 'Details' for more information." I click the 'Details' button and see a Java Console with the following information (HelloWorld version):
Java Plug-in 10.7.2.11
Using JRE version 1.7.0_07-b11 Java HotSpot(TM) 64-Bit Server VM
User home directory = C:\Users\user
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
Match: beginTraversal
Match: digest selected JREDesc: JREDesc[version 1.6+, heap=-1--1, args=null, href=http://java.sun.com/products/autodl/j2se, sel=false, null, null], JREInfo: JREInfo for index 0:
platform is: 1.7
product is: 1.7.0_07
location is: http://java.sun.com/products/autodl/j2se
path is: C:\Program Files\Java\jre7\bin\javaw.exe
args is: null
native platform is: Windows, amd64 [ x86_64, 64bit ]
JavaFX runtime is: JavaFX 2.2.1 found at C:\Program Files\Java\jre7\
enabled is: true
registered is: true
system is: true
Match: ignoring maxHeap: -1
Match: ignoring InitHeap: -1
Match: digesting vmargs: null
Match: digested vmargs: [JVMParameters: isSecure: true, args: ]
Match: JVM args after accumulation: [JVMParameters: isSecure: true, args: ]
Match: digest LaunchDesc: file:/G:/workspaces/JavaProjects/JavaFXHelloWorld/dist/HelloWorld.jnlp
Match: digest properties: []
Match: JVM args: [JVMParameters: isSecure: true, args: ]
Match: endTraversal ..
Match: JVM args final:
Match: Running JREInfo Version match: 1.7.0.07 == 1.7.0.07
Match: Running JVM args match: have:<> satisfy want:<>
CacheEntry[file:/G:/workspaces/JavaProjects/JavaFXHelloWorld/dist/HelloWorld.jnlp]: updateAvailable=false,lastModified=Fri Sep 14 07:13:28 MDT 2012,length=915
I get a nearly identical error when I run the app I'm working on.
I just uninstalled java and then reinstalled the latest SDK. That didn't do anything except may the app use the 64 bit JVM instead of a 32 bit JVM I had installed. The error message stayed the same.
Does anyone know what I'm doing wrong? Is my build script incorrect? Is there a better way to deploy? I don't have to have a jnlp so I'm open to any deploy method. I just need something I can run on a windows machine and possibly a mac.
I've tried googling my problem and I've searched StackOverflow and can't seem to find anything relevent. I might just be using the wrong search terms.
Any help would be greatly appreciated.
Thanks,
Hardy
If you are using netbeans then Right Click on the Project and Go to Project Properties then to Libraries then click on Manage Platform then select the Default Javafx platform then go to JAVAFX tab and then change the JAVAFX SDK location to where your Java fx 2 sdk is and also similarly change the JAVAFX JRE. Hope this will solve your Problem.
I eventually found out that, in my case, this issue was caused by a bug in the jar signing process. The problem is avoided by emptying the Java cache (on Windows, this can be done through the Java control panel). After doing so and rebuilding, the error no longer occurred in my case.
I'm unsure this will fix your problem, though, as you do not appear to do any signing.