We have a GWT application. Using Maven 3 we build and run the GWT application.
The application runs fine when we build and run on Windows 7 and test on IE on Windows. However, when we compile and run the application on Linux and then test on IE on Windows, the application looks differently.
To rule out client problems: we test on exactly the same client - Internet Explorer on Windows 7.
Further investigation revealed the Javascript on the Linux-server is differently from the Javascript on the Windows-server.
Does anyone know why GWT behaves differently on Linux and Windows? What can we do have GWT behave the same on both Windows and Linux.
We use Maven 3 to compile and run gwt.
Here's the plugin configuration of GWT:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>MyApplication.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>nl.my.app.client.Messages</i18nMessagesBundle>
<inplace>true</inplace>
</configuration>
</plugin>
and here's the module configuration:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='MyApplication'>
<inherits name='com.google.gwt.user.User' />
<inherits name="com.google.gwt.i18n.I18N" />
<inherits name='nl.my.module' />
<inherits name="com.sencha.gxt.ui.GXT" />
<inherits name="com.google.common.collect.Collect" />
<inherits name='com.google.gwt.user.Debug' />
<inherits name='nl.my.othermodule' />
<entry-point class='nl.my.MYApplication' />
<source path='client' />
<source path='shared' />
<set-configuration-property name="UiBinder.useSafeHtmlTemplates" value="true" />
<extend-property name="locale" values="nl_NL" />
</module>
The application is build and run using the following command:
mvn gwt:run
You probably have different JDKs on the two different systems. Ensure the JDK being used by maven is the same.
We found the problem - compatibility mode: as stated in the question the problem only occurred in Internet Explorer (IE). The compatibility mode of IE was enabled automatically when we'd access the application via a non-local address. In compatibility mode IE behaves slightly different. That's why, when we did access the application via localhost - on our development workstation - compatibility mode was not enabled by IE and the application looked like it should.
Problem was solved by adding the following in the head section of the application's single html file:
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
Related
I am trying to change the console output produced by webdrivermanager-java from https://github.com/bonigarcia/webdrivermanager
I have found several tutorials on how to do that but none of them works for me (or I am missing something).
Here is the current console output:
[TestNG-PoolService-2] INFO io.github.bonigarcia.wdm.WebDriverManager - Using chromedriver 91.0.4472.101 (resolved driver for Chrome 91)
[TestNG-PoolService-2] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as ...
I would like to remove it completely so here are the configurations I tested without success:
On another question here on StackOverflow: How to suppress webdriver-manager logs
The solution is to add logback.xml to the resources folder - tested it and it does not work for me
On the github readme the author is mentioning how to influence logging so i have tested following config:
java.util.logging.Logger.getLogger("org.apache.hc").setLevel(Level.SEVERE);
java.util.logging.Logger.getLogger("org.apache.http").setLevel(Level.SEVERE);
but that does not work either.
I am using webdrivermanager version 4.4.3
Fixed by adding logback to my project as a maven dependancy and a logback.xml file with logging config:
dependancy:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
logback.xml:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<logger name="org.apache" level="ERROR" />
<logger name="httpclient" level="ERROR" />
</configuration>
I am attempting to transform a built node-webkit app that I created into an executable appx Win 8.1 Metro App.
After creating my appx package and signing it, and creating my AppxManifest.xml file :
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name="bouveret" Version="1.0.0.0" Publisher="CN=Mc" />
<Properties>
<DisplayName>iMotion</DisplayName>
<PublisherDisplayName>XXX</PublisherDisplayName>
<Logo>logo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.2.1</OSMinVersion>
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="fr" />
</Resources>
<Applications>
<Application Id="bouveret" Executable="bouveret.exe" EntryPoint="WinMain">
<VisualElements DisplayName="iMotion" Logo="logo.png" SmallLogo="logo.png" Description="iMotion" ForegroundText="light" BackgroundColor="#000000" ToastCapable="false">
<DefaultTile ShowName="allLogos" ShortName="iMotion" WideLogo="logo.png" />
<SplashScreen Image="logo.png" />
<InitialRotationPreference>
<Rotation Preference="portrait" />
</InitialRotationPreference>
</VisualElements>
</Application>
</Applications>
</Package>
I manage to install it via Powershell, but I suspect it doesn't manage to run the entry point for the app. NW apps don't have a C# interface I can use to set a proper entry point.
Anyone has any idea on which entry point should be set? The executable launches itself properly, but the appx package doesn't launch anything : I see the logo on a black background and then it minimizes itself to the desktop without any debug trace.
Thank you.
I'm looking a way to deploy a maven project developed using eclipse in a remote linux server's tomcat. I know you can export it as a .war file and dump it in CATALINA_HOME/webapps folder of the remote server. But for that you have to first export it to .war file and then copy the .war file in to remote server through SFTP or SCP. I'm looking for a way to do it with few clicks using eclipse or/and configuring some maven settings(in pom.xml or settings.xml). Does any one know how to do this? Any help is really appreciated.
The tool you are loooking for is called Tomcat Maven Plugin
What it basically does is it uses the API of Tomcat manager application, which you have to make sure is deployed on the Tomcat instance you are using. By default Tomcat manager should be available in the following location:
http://ip_of_your_linux_server:8080/manager/html
If it is not, please install it using the following command:
sudo apt-get install tomcat6-admin
You can configure the location of your Tomcat instance as follows:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://www.mydomain.com:1234/mymanager</url>
</configuration>
</plugin>
and then run maven mvn tomcat:deploy goal. (Either from command line of from Eclipse using m2Eclipse plugin.)
Please refer to configuration and deployment pages of the plugin for more verbose information.
The most flexible solution with adapters for many different containers like Tomcat, Jetty, Glassfish, etc. is probably Maven Cargo plugin. You can find an extensive list of examples on their homepage, so no need to paste that here again.
To remotely deploy an application you'll need to configure the tomcat deployer app on the tomcat instance. Be warned, the configuration of admin users has undergone some subtle changes between tomcat 6 and 7.
Once this is working the Maven cargo plugin can deploy war files as follows:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>tomcat-deploy</id>
<phase>package</phase>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.uri>${tomcat.manager.url}</cargo.remote.uri>
<cargo.remote.username>${tomcat.manager.user}</cargo.remote.username>
<cargo.remote.password>${tomcat.manager.pass}</cargo.remote.password>
</properties>
</configuration>
<deployer>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<properties>
<context>${project.artifactId}</context>
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
Additional notes
The Cargo plugin supports several different containers, problem is the doco is difficult to interpret.
I haven't used the Maven plugin. It's very new
I have an old web project that I'm currently mavenizing. This has been written for Apache httpd, that means a lot of rules are sitting in lots of .htaccess files (redirects, rewrites) and the pages use server side includes. I tried to use jetty with the HTAccessHandler, but this doesn't care for the rewrites/redirects. I think I now need to get to use httpd to get that properly processed, but is there a way to start apache webserver embedded from maven? Or do you know a java webserver implementation that can handle all the .htaccess properties?
Cheers,
Kai
To answer myself, I am now using the antrun plugin to start the Apache httpd binary and to call the system specific kill command with the pid file Apache is creating. I'm providing a httpd.conf file with my project where I filter maven properties including the target port, the log location and the pidfile name and location. system specific values are set by maven profiles activated by the os family. The home folder of apache httpd is to be set in the users settings.xml file. This looks like:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>Starting Apache</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="Starting Apache">
<mkdir dir="${project.build.directory}/logs" />
<echo>Starting Apache httpd:</echo>
<exec executable="${apache.home}/${apache.executable}" spawn="true">
<arg value="-f" />
<arg value="${project.build.directory}/httpd.conf" />
</exec>
</target>
</configuration>
</execution>
<execution>
<id>Stopping Apache</id>
<phase>post-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="Stopping Apache">
<echo>Stopping Apache httpd:</echo>
<loadfile property="PID" srcFile="${project.build.directory}/httpd.pid">
<filterchain>
<striplinebreaks />
</filterchain>
</loadfile>
<exec executable="${kill.executable}" failonerror="true">
<arg value="${kill.argument1}" />
<arg value="${kill.argument2}" />
<arg value="${kill.argument3}" />
<arg value="${PID}" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
I had a look at various newsgroups as we have the same feature request in our community
We will starting to develop a httpd-plugin in the next days. However I tried to find something at google but there seems to be no plugin that covers this topic. Developing a plugin to start and stop an apache should be fairly simple. Since Maven java it is clear to me why nearly everyone prefers tomcat or jetty.
Targeted for version 2.0 of php-maven
The Plugin will be similar to the jetty and tomcat plugin (identical goals, similar setup). The first versions will be depending on a separate installation of apache and will only setup either a virtual host or set the document root. For simple configurations and on development machines this will be ok.
Watch http://www.php-maven.org/rss.xml or https://groups.google.com/forum/?fromgroups#!forum/maven-for-php for news.
However please submit your wishes at http://trac.php-maven.org/ticket/47 (registration required) or at our google group.
The problem is that my JNLP file works locally on my 64-bit machine (running on my own machine), and locally and remotely on my 32-bit machine - but not remotely on the 64-bit machine (you see the Java 6... message for a looong time, and then it just terminates!). Any suggestions about how to trouble-shoot this? Should I specify different libraries for 64-bit and 32-bit? FWIW the jnlp file looks like this (maybe quite wrong!):
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+"
codebase="http://www.jpaulmorrison.com/graphicsstuff/">
<information>
<title>DrawFBP</title>
<vendor>J.P. Morrison Enterprises, Ltd.</vendor>
<description>FBP Diagramming Tool</description>
<icon href="DrawFBP-logo.jpg"/>
</information>
<security>
<all-permissions/>
</security>
<offline-allowed/>
<resources>
<j2se version="1.6+"/>
<j2se version="1.5"/>
<jar href="DrawFBP_signed-2.3.jar" main="true"/>
<extension name="javahelp" href="javahelp.jnlp">
</extension>
</resources>
<application-desc/>
</jnlp>
and javahelp.jnlp is as follows:
<!-- Java Network Launching Protocol file for JavaHelp
(requires Java Web Start http://www.java.com/) - thanks to www.koders.com -->
<jnlp codebase="https://jwindows.dev.java.net/" href="javahelp.jnlp" spec="1.0+">
<information>
<title>Java Help</title>
<vendor>Sun Microsystems</vendor>
<homepage href="http://java.sun.com/products/javahelp/"/>
<description>Java Help 2.0</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+"/>
<jar href="lib/jhall.jar" part="javahelp"/>
<package name="javax.help" part="javahelp" recursive="true"/>
</resources>
<component-desc/>
</jnlp>
TIA
Turns out you have to install both the 32-bit version of Java and the 64-bit version. Very confusing, but apparently Java can figure out which to use! It would be nice (but not essential) if someone could tell me why this works...?
PS I posted this to the Oracle forum, and nobody answered it either :-) I will post this answer there too.