Saturday, June 11, 2011

Spring Roo GWT application works in dev mode but not in production

Problem

A spring roo gwt application works in dev mode (mvn gwt:run) but not works in production mode (mvn tomcat:run or mvn jetty:run). When trying the late it shows a page with a rectangle with the message loading inside.

Reason

Solution

Assuming that the project is the sample that comes with roo expenses.roo. In STS (Spring Source Tool Suite):

  • Edit the project properties
  • Select Deployment Assembly
  • Click Add
  • Select Folder
  • Select target/extrack-0.1.0.BUILD-SNAPSHOT (or whatever your version is)
  • Click Finish
  • Right click on the project or the pom.xml
  • Select Run As -> Maven assembly:assembly
  • App should re-deploy to the server

This solution was originally posted here: http://forum.springsource.org/showthread.php?106292-Problem-with-expenses.roo-sample-and-STS-2.6.0

Aplicação Spring Roo GWT funciona em modo de desenvolvimento, mas não em produção

Problema

Uma aplicação spring roo configurada para utilizar o gwt funciona em modo de desenvolvimento (mvn gwt:run), mas não funciona quando se faz o deploy em produção (mvn tomcat:run ou mvn jetty:run). Quando se tenta o último mostra uma página com um quadrado e dentro a mensagem loading.

Motivo

Solução

Assumindo que o projeto é o sample que vem com o spring roo (expenses.roo). No STS (Spring Source Tool Suite):
  • Vá nas propriedades do projeto.
  • Selecione Deployment Assembly.
  • Clique em adicionar.
  • Selecione folder.
  • Selecione target/extrack-0.1.0.BUILD-SNAPSHOT.
  • Clique em finalizar.
  • Selecione Run As -> Maven assembly:assembly.


Atualização em 25 ago 2011

Por algum motivo os passos acima não estavam funcionando. Talvez tenha sido pela atualização do STS. Os passos abaixo resolveram o problema:

  • Retire o diretório target/extrack-0.1.0.BUILD-SNAPSHOT do Deployment Assembly como tinha feito acima.
  • Execute o comando mvn jetty:run-exploded.

Compilation error without editing source files in spring roo project

Problem

With no editing of source files from a spring roo project compilation errors appears. This errors are in the source controlled by roo (the aspects).


Sem que se tenha editado o código fonte de um projeto spring roo, problemas de compilação apareceram. Este problemas são na parte que o o roo controla e não devemos editar (Os aspectos).

Reason

Using a different version (older) of roo to work with the project that was created with a newer version of roo. I think it is a problem of roo. It should not allow to open a new projet with an old version of roo.

Solution

Revert the sources to the previous version. It is trivial if you are using a version control.

Erro de compilação em projeto spring roo sem ter editado arquivos

Problema

Sem que se tenha editado o código fonte de um projeto spring roo, problemas de compilação apareceram. Este problemas são na parte que o o roo controla e não devemos editar (Os aspectos).

Motivo

Utilizar o roo numa versão diferente (no caso mais antiga) da versão que foi utilizada para a criação do projeto. O próprio roo deveria verificar isto e nãom permitir abrir o projeto.

Solução

Voltar o código fonte a versão anterior. Trivial com a utilização de controle de versão.

Wednesday, June 8, 2011

Why insn´t Firefox picking up the GWT Developer Plugin when started from Junit using Webdriver?

Problem

When trying to access the GWT Development Environment (http://127.0.0.1:8888/ApplicationScaffold.html?gwt.codesvr=127.0.0.1:9997) using Wedriver inside Junit a page requesting the installation of GWT Development Plugin. Even with the plugin already installed.

Reason

By default, the Wedriver driver to Firefox use a clean profile( new FirefoxDriver()) without any extensions.

O driver para o Firefox que o Webdriver utiliza está com um perfil limpo (new FirefoxDriver()), sem nenhuma extensão.

Solution

To configure the profile to use the GWT Development Plugin as follows:

Download the plugin from https://dl-ssl.google.com/gwt/plugins/firefox/gwt-dev-plugin.xpi and put in some place in your computer.

Configure the driver to use the plugin:

FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(new File("path to gwt-dev-plugin.xpi"));
WebDriver driver = new FirefoxDriver(profile);

More informationhere: http://groups.google.com/group/webdriver/browse_thread/thread/c4f0ee7529c0c70a?pli=1

Porque o Firefox não utiliza o GWT Developer Plugin quando iniciado do Junit utilizando o Webdriver?

Problema

Ao tentar acessar a URL para o ambiente do desenvolvimento do GWT (http://127.0.0.1:8888/ApplicationScaffold.html?gwt.codesvr=127.0.0.1:9997) utilizando o Webdriver dentro do Junit, é exibida página solicitando a instalação do plugin de desenvolvimento do GWT. Mesmo este plugin já tendo sido instalado.

Motivo

O driver para o Firefox que o Webdriver utiliza está com um perfil limpo (new FirefoxDriver()), sem nenhuma extensão.

Solução

Configurar para que o perfil utilizado possua o plugin de desenvolvimento do GWT. Segue roteiro:

Baixe o plugin a partir deste link: https://dl-ssl.google.com/gwt/plugins/firefox/gwt-dev-plugin.xpi e salve em algum local no computador

Configure o Firefox para utilizar o plugin:
FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(new File("path to gwt-dev-plugin.xpi"));
WebDriver driver = new FirefoxDriver(profile);




Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port 7055 Problema Ao tentar executar os testes web utiliz

Problem

When trying to execute web tests with wedriver and Firefox the following error message appears:


org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Arquivos de programas\Mozilla Firefox\firefox.exe) on port 7055; process output follows:

##### IGeared_tavgpAVGTbApiComponent start
##### IGeared_tavgpAVGTbApiComponent init done
### go!ÿ
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_14'
Driver info: driver.version: firefox
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:91)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:117)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:64)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:100)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:92)
at br.com.leilao.estorias.concorrerleilao.DadoQueResgistrouConcorrerIpadComTempoParaDarLanceAhDezSegundosDeVencer.registrarConcorrenciaLeilao(DadoQueResgistrouConcorrerIpadComTempoParaDarLanceAhDezSegundosDeVencer.java:24)
at br.com.leilao.estorias.concorrerleilao.DadoQueResgistrouConcorrerIpadComTempoParaDarLanceAhDezSegundosDeVencer.registrarConcorrenciaAhProdutoNoLeilao(DadoQueResgistrouConcorrerIpadComTempoParaDarLanceAhDezSegundosDeVencer.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host localhost on port 7055 after 45000 ms
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:87)
... 29 more.


Reason

Not identified

Solution

To use the 3.6 version of Firefox (I was using 4.x). It is a workaround while a definitive solution is found. Other sugestions could be found in this link: http://groups.google.com/group/webdriver/browse_thread/thread/3d0bbb40cce5dfac/e4844f5f91882602?lnk=raot&pli=1

It no worked to me.