使用gwt:run-codeserver

时间:2014-05-22 10:02:00

标签: maven gwt intellij-idea gwt-maven-plugin

我刚开始在我的项目中使用gwt maven插件,一切似乎都运行正常。但是,调试非常困难,因为我无法使superdevmode正常工作,我无法在IDE(IntelliJ)上显示错误。

这是我做gwt时的日志:运行

[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.    SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building GWT Maven Archetype 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> gwt-maven-plugin:2.5.0:run (default-cli) @ xxxxxadmin >>>
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-    io:commons-io:jar:1.3.2
[INFO] 
[INFO] --- gwt-maven-plugin:2.5.0:i18n (default) @ xxxxxadmin ---
[INFO] 
[INFO] --- gwt-maven-plugin:2.5.0:generateAsync (default) @ xxxxxadmin ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ xxxxxadmin ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 883 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ xxxxxadmin ---
[INFO] Compiling 1 source file to /Users/myuser/git xxxxxadmin/target xxxxxadmin-1.0-SNAPSHOT/WEB-INF/    classes
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:exploded (default) @ xxxxxadmin ---
[INFO] Exploding webapp
[INFO] Assembling webapp  xxxxxadmin] in [/Users/myuser/git xxxxxadmin/target xxxxxadmin-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/myuser/git xxxxxadmin/src/main/webapp]
[INFO] Webapp assembled in [867 msecs]
[INFO] 
[INFO] <<< gwt-maven-plugin:2.5.0:run (default-cli) @ xxxxxadmin <<<
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-    io:commons-io:jar:1.3.2
[INFO] 
[INFO] --- gwt-maven-plugin:2.5.0:run (default-cli) @ xxxxxadmin ---
[INFO] create exploded Jetty webapp in /Users/myuser/git xxxxxadmin/target xxxxxadmin-1.0-SNAPSHOT
[INFO] auto discovered modules [com xxxxx.admin.gwt.portaladmin]
[ERROR] log4j:WARN No appenders could be found for logger (org.apache.jasper.compiler.    JspRuntimeContext).
[ERROR] log4j:WARN Please initialize the log4j system properly.
[ERROR] log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[INFO] ISC: Configuring log4j from: file:/Users/myuser/git xxxxxadmin/target xxxxxadmin-1.0-SNAPSHOT/    WEB-INF/classes/log4j.isc.config.xml
[INFO] === 2014-05-22 10:50:18,873 [main] INFO  Logger - Logging system started.

这是我做gwt时的日志:run-codeserver

[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.    SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building GWT Maven Archetype 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> gwt-maven-plugin:2.5.0:run-codeserver (default-cli) @ xxxxxxadmin >>>
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-    io:commons-io:jar:1.3.2
[INFO] 
[INFO] --- gwt-maven-plugin:2.5.0:i18n (default) @ xxxxxxadmin ---
[INFO] 
[INFO] --- gwt-maven-plugin:2.5.0:generateAsync (default) @ xxxxxxadmin ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ xxxxxxadmin ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 883 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ xxxxxxadmin ---
[INFO] Compiling 1 source file to /Users/myuser/git/xxxxxxadmin/target/xxxxxxadmin-1.0-SNAPSHOT/WEB-    INF/classes
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:exploded (default) @ xxxxxxadmin ---
[INFO] Exploding webapp
[INFO] Assembling webapp [xxxxxxadmin] in [/Users/myuser/git/xxxxxxadmin/target/xxxxxxadmin-1.0-    SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/myuser/git/xxxxxxadmin/src/main/webapp]
[INFO] Webapp assembled in [815 msecs]
[INFO] 
[INFO] <<< gwt-maven-plugin:2.5.0:run-codeserver (default-cli) @ xxxxxxadmin <<<
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-    io:commons-io:jar:1.3.2
[INFO] 
[INFO] --- gwt-maven-plugin:2.5.0:run-codeserver (default-cli) @ xxxxxxadmin ---
[INFO] auto discovered modules [com.xxxxxx.admin.gwt.portaladmin]
[INFO] workDir: /var/folders/g3/zr930nm51091q0wtc4j8qt1c0000gn/T/gwt-codeserver-7465083041692192607.    tmp
[INFO] binding: user.agent=safari
[INFO] binding: compiler.useSourceMaps=true
[INFO] binding: locale=en
[INFO] Compiling module com.xxxxxx.admin.gwt.portaladmin

Here is the screen I see on the superdevmode codeserver Here is the screen I see when I click "Dev Mode On"

但是,当我单击编译按钮时没有任何反应。在我之前的设置中,我可以看到编译日志,页面一旦结束就会重新加载。

对于gwt:debug运行,我无法按照here所述设置我的环境。

我已经运行了gwt:debug maven配置。

gwt:debug maven configuration

和远程配置

remote configuration

根据建议。我确实看到GWT开发模式窗口,就像我做gwt:run一样,但我看不到任何日志信息,只有this

[更新]我已经破解了Bookmarklet代码,以确定如果我调用网址

http://localhost:9876/recompile/portaladmin?__gwtDevModeSession:portaladmin 

我的superdevmode服务器以

响应
[INFO] Compiling module com.xxxxx.admin.gwt.portaladmin
[INFO]    Validating units:
[INFO]       Ignored 80 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO]    Compiling 18 permutations
[INFO]       Compiling permutation 0...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 1...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 2...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 3...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 4...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 5...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 6...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 7...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 8...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 9...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 10...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 11...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 12...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 13...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 14...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 15...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 16...
[INFO]       Source Maps Enabled
[INFO]       Compiling permutation 17...
[INFO]       Source Maps Enabled
[INFO]    Compile of permutations succeeded
[INFO] Linking into /var/folders/g3/zr930nm51091q0wtc4j8qt1c0000gn/T/gwt-codeserver-431669712100879679.tmp/com.xxxxxx.admin.gwt.portaladmin/compile-2/war/portaladmin; Writing extras to /var/folders/g3/zr930nm51091q0wtc4j8qt1c0000gn/T/gwt-codeserver-431669712100879679.tmp/com.xxxxxx.admin.gwt.portaladmin/compile-2/extras/portaladmin
[INFO]    Link succeeded
[INFO]    Compilation succeeded -- 29.577s
[INFO] Compile completed in 29782 ms
[INFO] [ERROR] invalid callback: null

所以现在我们已经将错误隔离到Bookmarklets:不知何故,我的bookmarklet没有指向正确的服务器或使用正确的参数。你能帮忙吗?这是我在点击Dev Mode On bookmarklet属性时看到的内容:

    javascript:{ window.__gwt_bookmarklet_params = {server_url:'http://localhost:9876/',module_name:'portaladmin'}; var s = document.createElement('script'); s.src = 'http://localhost:9876/dev_mode_on.js'; void(document.getElementsByTagName('head')[0].appendChild(s));}

通过检查对服务器的调用,它永远不会进行/重新编译AJAX调用。不知何故,dev_mode_on.js文件中出现了问题

1 个答案:

答案 0 :(得分:0)

您是否尝试摆脱log4j init问题?当您的日志记录不起作用时,您通常会失明。您的WEB-INF / classes / log4j.isc.config.xml是否有效?