I use GWT Logging with a simple web application project. I have the following on my module gwt.xml:
<inherits name="com.google.gwt.logging.Logging" />
<set-property name="gwt.logging.logLevel" value="INFO" />
<set-property name="gwt.logging.enabled" value="TRUE" />
<set-property name="gwt.logging.consoleHandler" value="ENABLED" />
<set-property name="gwt.logging.simpleRemoteHandler"
value="ENABLED" />
<set-property name="gwt.logging.developmentModeHandler" value="ENABLED" />
In my onModuleLoad function I set:
Logger rootLogger = Logger.getLogger("");
rootLogger.log(Level.SEVERE, "root SEVERE");
rootLogger.log(Level.INFO, "root INFO");
When I run the app in SuperDevMode I get the following output in my browser console:
root SEVERE
Even with log level INFO I do not get the info log message.
How do I get all GWT log level to be displayed?
Check your GWT run configuration. On the Arguments tab, you should see something like this:
-remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -port 8888 -server com.google.appengine.tools.development.gwt.AppEngineLauncher -war C:\Users\username\workspace\ProjectName\war com.domain.name.ProjectName
If you see "-logLevel SEVERE" instead of "-logLevel INFO", that's your problem.
Since GWT 2.7.0 you need to explicitly include few properties in your .gwt.xml file. This should fix your problem:
<set-property name="gwt.logging.enabled" value="TRUE"/>
<set-property name="gwt.logging.logLevel" value="INFO" />
<set-property name="gwt.logging.consoleHandler" value="ENABLED"/>
Source
Related
For some reason, my custom appearance is not being used to replace gxt class any longer (worked yesterday).
All I did was comment out this part, recompile application and then revert it and recompile again:
<replace-with class='com.test.Test_portal.web.theme.client.header.TestColumnHeaderAppearance'>
<when-type-is class='com.sencha.gxt.widget.core.client.grid.ColumnHeader.ColumnHeaderAppearance' />
</replace-with>
Relevant code:
<module>
<inherits name="com.sencha.gxt.theme.base.Base" />
<replace-with class='com.acdlabs.Test_portal.web.theme.client.header.TestColumnHeaderAppearance'>
<when-type-is class='com.sencha.gxt.widget.core.client.grid.ColumnHeader.ColumnHeaderAppearance' />
</replace-with>
</module>
public class TestColumnHeaderAppearance extends ColumnHeaderDefaultAppearance {
public interface TestColumnHeaderResources extends ColumnHeaderResources {
#Override
#Source({ "com/sencha/gxt/theme/base/client/grid/ColumnHeader.gss", "TestColumnHeader.gss" })
public TestColumnHeaderStyle style();
}
public interface TestColumnHeaderStyle extends DefaultColumnHeaderStyles {
String filterIcon();
}
public TestColumnHeaderAppearance() {
super(GWT.<ColumnHeaderResources> create(TestColumnHeaderResources.class));
}
}
public class TestColumnHeader<M> extends ColumnHeader<M> {
public TestColumnHeader(Grid<M> container, ColumnModel<M> cm, ColumnHeaderAppearance appearance) {
super(container, cm, appearance);
if (appearance.styles() instanceof TestColumnHeaderStyle) {
styles = (TestColumnHeaderStyle) appearance.styles(); // <-- this is never reached and I that's why I get exceptions like "Cannot read property 'filterIcon_0_g$' of undefined"
}
}
}
Can my browser be caching themes and ignoring my TestColumnHeaderAppearance?
Added a comment in TestColumnHeader, which shows that TestColumnHeaderAppearance is not being loaded.
Any ideas?
EDIT
It's working in different browser (fire fox), so it does seem like cache problem. Though I clear cache of the browser that's not working (chrome) and still no change. Deleted /target folter, recompile everything, still no changes.
EDIT 2
When application is built in .war format and deployed to tomcat, everything works (I can see that styling has changed). Might be a problem with super dev mode then or its configuration.
WeblibTheme.gwt.xml
<module>
<inherits name="com.sencha.gxt.theme.base.Base" />
<!-- Buttons -->
<replace-with class="com.test.Test_portal.web.theme.client.button.TestWebButtonCellAppearance">
<when-type-is class="com.sencha.gxt.cell.core.client.ButtonCell.ButtonCellAppearance" />
</replace-with>
<replace-with class="com.test.Test_portal.web.theme.client.field.TestWebDualListFieldAppearance">
<when-type-is class="com.sencha.gxt.widget.core.client.form.DualListField.DualListFieldAppearance" />
</replace-with>
<replace-with class='com.test.Test_portal.web.theme.client.header.TestColumnHeaderAppearance'>
<when-type-is class='com.sencha.gxt.widget.core.client.grid.ColumnHeader.ColumnHeaderAppearance' />
</replace-with>
<!-- Slider -->
<replace-with class="com.test.Test_portal.web.theme.client.slider.TestWebSliderAppearance">
<any>
<when-type-is class="com.sencha.gxt.cell.core.client.SliderCell.SliderAppearance" />
<when-type-is class="com.sencha.gxt.cell.core.client.SliderCell.HorizontalSliderAppearance" />
</any>
</replace-with>
<!-- TreeAppearance -->
<replace-with class="com.test.Test_portal.web.theme.client.tree.TestTreeAppearance">
<when-type-is class="com.sencha.gxt.widget.core.client.tree.Tree.TreeAppearance"/>
</replace-with>
<!-- DatePicker -->
<replace-with class="com.test.Test_portal.web.theme.client.datepicker.TestDatePickerAppearance">
<when-type-is class="com.sencha.gxt.widget.core.client.DatePicker.DatePickerAppearance"/>
</replace-with>
</module>
TestWeb.gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='TestWeb'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.inject.Inject' />
<inherits name='com.google.gwt.resources.Resources' />
<!-- Other module inherits -->
<inherits name='com.gwtplatform.mvp.Mvp' />
<inherits name='com.gwtplatform.dispatch.Dispatch' />
<inherits name="org.atmosphere.gwt20.AtmosphereGwt20" />
<inherits name='com.sencha.gxt.chart.Chart' />
<inherits name='com.sencha.gxt.ui.GXT' />
<inherits name="com.google.gwt.logging.Logging" />
<inherits name="com.google.gwt.uibinder.UiBinder" />
<inherits name="com.googlecode.gwt.crypto.Crypto" />
<inherits name="com.test.chemwidgets.ChemWidgets" />
<inherits name="com.test.gxt_widgets.GxtWidgets" />
<inherits name="com.test.Test_portal.web.theme.WeblibTheme" />
<collapse-property name="user.agent.os" values="*" />
<collapse-property name="gxt.user.agent" values="air, safari*, chrome" />
<collapse-property name="gxt.user.agent" values="ie9, ie10" />
<collapse-property name="gxt.user.agent" values="gecko*" />
<replace-with class='com.sencha.gxt.chart.client.draw.engine.VML'>
<when-type-is class='com.sencha.gxt.chart.client.draw.Surface' />
<any>
<when-property-is name='user.agent' value='ie8' />
</any>
</replace-with>
<!-- Specify the app entry point class. -->
<entry-point class='com.test.Test_portal.web.client.TestWeb' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
<set-property name="gwt.logging.logLevel" value="INFO" />
<set-configuration-property name='gin.ginjector'
value='com.test.Test_portal.web.client.gin.ClientGinjector' />
<set-configuration-property name='gin.ginjector'
value='com.test.Test_portal.web.client.gin.ClientGinjector' />
<!-- By default (GWT 2.7.0) CssResources uses CSS instead of GSS -->
<set-configuration-property name="CssResource.enableGss"
value="true" />
<!-- GWT Compiler converts all .css files to .gss, if value for CssResource.enableGss
is true -->
<set-configuration-property name="CssResource.conversionMode"
value="strict" />
<!-- The default for GSS in UiBinder -->
<set-configuration-property name="CssResource.gssDefaultInUiBinder"
value="true" />
<set-property name="compiler.stackMode" value="emulated" />
<set-configuration-property name="compiler.emulatedStack.recordFileNames"
value="true" />
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers"
value="true" />
<set-property name="compiler.stackMode" value="emulated" />
<set-configuration-property name="compiler.emulatedStack.recordFileNames"
value="true" />
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers"
value="true" />
</module>
TestWeb-dev.gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='TestWeb'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.test.Test_portal.web.TestWeb" />
<!-- Collapsing all permutations into one. -->
<collapse-all-properties />
</module>
EDIT (fixed, no idea why):
Cleared my AppData\Local\Temp\ folder and recompiled the application. Maybe super dev mode ignored the changes made to modules until as long as temp folder held previous version?
I have several .launch files for Eclipse (I'm using Eclipse Oxygen), here is an example
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false" />
<stringAttribute key="M2_GOALS" value="clean com.google.cloud.tools:appengine-maven-plugin:deploy" />
<booleanAttribute key="M2_NON_RECURSIVE" value="false" />
<booleanAttribute key="M2_OFFLINE" value="false" />
<stringAttribute key="M2_PROFILES" value="" />
<listAttribute key="M2_PROPERTIES" />
<stringAttribute key="M2_RUNTIME" value="EMBEDDED" />
<booleanAttribute key="M2_SKIP_TESTS" value="true" />
<intAttribute key="M2_THREADS" value="1" />
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false" />
<stringAttribute key="M2_USER_SETTINGS" value="" />
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false" />
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc}" />
</launchConfiguration>
Note that I'm using ${project_loc} variable in order to make it usable for any project.
I'm using this kind of files because I can share those with my team. Also the most used Maven Build configurations are ready to go w/o configuring every time a new launch profile.
The problem I'm facing is related to the profile value
<stringAttribute key="M2_PROFILES" value="" />
With the CTRL+ALT+P shortcut on a project, I can select the proper profile to load (Select Maven Profiles... function). I'm using different profile to discern the environment for the deploy (development, stage o production).
I'm trying to "inject" the profile I enabled for the project into the generic launch profile configuration, something like the ${project_loc} variable but related to the current Maven profile.
If this cannot be made I need to create a launch profile for each environment, which means 3 files per every goal to launch.
Is there a way to use/create an Eclipse variable that can be resolved with the Maven profile I activated on the project?
Something like
<stringAttribute key="M2_PROFILES" value="${maven.profile.id}" />
You'll need to create an Eclipse plugin (or contribute to Eclipse m2e project) in order to define a variable using the dedicated extension-point.
I'm pretty new to MuleESB. I'm using Mule Standalone 3.8.1 with a configuration to filter HTTP requests using the xpath3() function. The configuration I have used is as follows.
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" />
<http:request-config name="HTTP_Request_Configuration" host="example.com" port="8081" basePath="basePath" responseTimeout="120000" />
<custom-transformer name="XML_Transformer" class="org.mule.module.xml.transformer.XmlToOutputHandler"/>
<message-properties-transformer name="Response_Error_Transformer">
<add-message-property key="http.status" value="500"/>
<add-message-property key="Content-Type" value="text/xml" />
</message-properties-transformer>
<message-properties-transformer name="Response_Transformer">
<add-message-property key="Content-Type" value="text/xml" />
</message-properties-transformer>
<set-payload name="Create_Error_Response" value="
<PurchaseOrder PurchaseOrderNumber="99503" OrderDate="1999-10-20">
<fault>
<code>500</code>
<message>#[flowVars['errorMessage']]</message>
</fault>
</PurchaseOrder>" />
<flow name="Choice_Flow">
<http:listener config-ref="HTTP_Listener_Configuration" path="productFilter" />
<choice>
<when expression="#[xpath3('//Item[1]/ProductName') == 'Laptop']">
<transformer ref="XML_Transformer"/>
<http:request config-ref="HTTP_Request_Configuration" path="EchoService" method="POST" />
<flow-ref name="Response_Transformer" />
</when>
<otherwise>
<flow-ref name="Response_Error_Transformer" />
<set-variable variableName="errorMessage" value="First item must be a Laptop" />
<flow-ref name="Create_Error_Response" />
</otherwise>
</choice>
</flow>
When I'm sending HTTP requests at 10 threads it's working fine. But, then when I tried sending requests at 500 threads, some of the requests got failed. The request is an XML with 2500 Item elements. I don't see any descriptive errors in the logs or anywhere, but the requests got failed. After this happens, some of the requests got failed even for small thread numbers, and I couldn't find any error in files in the logs directory. Only error I see in the mule.log file is as follows. This is written at the first occurrence of this error. Then, simply, nothing.
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "[default].http.listener(6)"
Can someone please explain me what's going on here? How to do this without any error? Is something wrong with my configuration?
I use GWT 2.7 and want to provide logging with Level INFO and WARNUNG in my app. In my gwt.xml file I have:
<inherits name="com.google.gwt.logging.Logging"/>
<set-property name="gwt.logging.logLevel" value="INFO"/>
It works perfect in Dev mode but in SuperDevMode I only get Log level SEVERE to be logged.
Why does SuperDevMode only provides LogLevel SEVERE?
I just checked one of my applications (which uses GXT) and there I see the log message:
I use this lines inside my module descriptor:
<!-- values are: severe, warning, info, config, fine, finer, finest -->
<set-property name="gwt.logging.logLevel" value="INFO"/>
<set-property name="gwt.logging.enabled" value="TRUE" />
<!-- Write messages to browser consoles and to the jvm and dev mode -->
<!-- Note that these are the defaults, so we don’t actually need to list them -->
<set-property name="gwt.logging.consoleHandler" value="ENABLED"/>
<set-property name="gwt.logging.developmentModeHandler" value="ENABLED"/>
<set-property name="gwt.logging.systemHandler" value="ENABLED"/>
<!-- Leave RPC logging disabled, as we aren’t setting that up in this example -->
<set-property name="gwt.logging.simpleRemoteHandler" value="DISABLED"/>
<!-- Ask GXT to log all internal details -->
<set-property name="gxt.logging.enabled" value="true"/>
and add this code to my presenter:
private static final Logger logger = logger.getLogger(ShellPresenter.class.getName());
logger.log(Level.INFO, "Starting module Hermes");
I don't spent time to find out which one of the configurations enables logging nor if it is related to GXT.
And some more informations:
groups.google.com/forum/#!topic/google-web-toolkit/BRZNt1_qEjg
To change log level in SDM, add this option to command line when running it:
-logLevel (ERROR|WARN|INFO|TRACE|DEBUG|SPAM|ALL)
I have a .jsp page (the main page of my gwt module) and I'm trying to enable super dev mode as I'm migrating to gwt 2.6.
Following the explanations I found out on internet, once I launch the codeserver and add the bookmarklets, next I gotta open the page in my browser, so I call the jsp page from my tomcat server.
The problem is that nothing happens, and looking at the chrome console it seems it is unable to find my module/module.nocache.js
Any idea?
EDIT : added .gwt.xml
<inherits name="XXX.frontend.gwt.Framework"/>
<inherits name="XXX.frontend.gwt.sample.frontend.module.blanc.Module"/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- Specify the application entry point class -->
<entry-point class='XXX.frontend.gwt.client.FrameworkEntryPoint'/>
<!-- Compile for specific browser -->
<!-- <set-property name="user.agent" value="ie8,ie9,ie10,gecko1_8,safari" /-->
<!-- Compile for specific language -->
<extend-property name="locale" values="fr" />
<set-property-fallback name="locale" value="fr" />
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE' />
<set-configuration-property name="devModeUrlWhitelistRegexp" value="http://(localhost|127\.0\.0\.1)(:\d+)?/.*" />
<add-linker name="xsiframe" />
<set-property name="compiler.useSourceMaps" value="true" />
You have to load your .nocache.js file from your codeserver instance.
In your .jsp you must have something like this:
<script src="http://localhost:9876/myapp/myapp.nocache.js"></script>
In your gwt.xml you need these lines as well:
<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
<set-property name="compiler.useSourceMaps" value="true" />