Static content not loading in spring cloud gateway - spring-webflux

I recently updated my spring version from 2.5.5 to 2.5.6 which upgraded my spring-webflux dependency from 5.3.10 to 5.3.12. After this the static content is not loading. I assume there is a bug in this version.
I have a custom WebFluxConfigurer class which loads via resourceHandler and resourceLocation. Apparently after this upgrade it stopped working.
#Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("/home/gecloud/dist/").resourceChain(true)
Is there a workaround. For now I am running with spring boot 2.5.6 but overrided the webflux version to older one.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
<version>5.3.10</version>
</dependency>

Related

Unable to use Infinispan embedded cachemanager on JBoss EAP 7.2

I need to use cache system on my web application under JBoss EAP 7.2
My purpose is to configure cache at application level, therefore no server configuration should be required.
The cache provider is Infinispan
This is my pom.xml:
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-hibernate-cache-v53</artifactId>
<version>${version.infinispan}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>${version.infinispan}</version>
<scope>provided</scope>
</dependency>
${version.infinispan} is 9.3.3.Final, the version shipped by JBoss EAP 7.2 (see also https://access.redhat.com/articles/112673)
When I try to start the AS, i have got this error:
[...] a class it references was not found: org.infinispan.manager.EmbeddedCacheManager
Guess I have to configure it on manifest or something else,
however I haven't found how.
Any help would be appreciated
EDIT
On RedHat page is reported the following sentence:
Infinispan is delivered as a private module in EAP to provide the caching capabilities of EAP. Infinispan is not supported for direct use by application
Does it mean that I can't use infinispan cache directly ?
If you want to add caching to EAP for your own data, you should use JBoss Datagrid (downstream) or Infinispan (upstream) modules, so that you have full control over the version and capabilities of the caching layer. See this quickstart to do just that.
The version that ships with EAP is fixed and does not contain all the Infinispan modules, so we recommend against directly using this.

ScalaTest: testing web apps with multiple browsers

I am trying to have the same integration test for a web app with multiple browsers (Chrome, Firefox, InternetExplorer, etc. one after the other).
ScalaTest plus Play has these traits AllBrowsersPerTest and AllBrowsersPerSuite. Did anyone wrote something similar but not tied to a web framework? (The web app I am testing is based on Wicket, not Play.)
I was able to solve my problem using PageObject.
PageObject uses all available browsers (i.e. those with a configured WebDriver) by default (in my case Firefox, Chrome and Internet Explorer).
These are my dependencies:
<dependency>
<groupId>org.pageobject</groupId>
<artifactId>scalatest_${scalaBinaryVersion}</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.1</version>
</dependency>
I found the code of PageObjectTour helpful to get started.
Note: PageObject 0.1.0 uses its own version of ScalaTest 3.0.0 because of a bug not yet fixed in the ScalaTest trunk. So I had to remove my own dependencies to org.scalatest:scalatest.

Installing Vaadin Charts Trial License in Intellij Idea, Windows platform

As the Book of Vaadin explains I added the maven repository;
<dependencies>
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>vaadin-charts</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
But the resolving becomes unsuccessful for 2.0.0 so I used 1.0.0 which was successful.
I got the TRIAL license key from vaadin but I cannot find a way to install it. My IDE is intellij Idea and im using windows 8. When i deploy the tutorial in the book of vaadin without the license i get the following error.
HTTP Status 500 - com.vaadin.server.ServiceException: java.lang.NoClassDefFoundError: com/vaadin/addon/charts/model/Series
Any help regarding this is greatly appreciated.
I worked out the issue by starting the vaading project using Maven in intellij idea. I didnt go for the Vaadin application but went for a new project using vaadin maven repo.
It downloaded the needed resources through the repo. And I ran the package maven goal to get my widget set compiled.
as to the licensing problem I had, It was solved by placing the licence key in a file named .vaadin.chartsdeveloper.license inside my home
that is in windows, : C:\Users\username
Now all is working fine.

Spring boot application intellij

The autowiring and the bean detection feature are not working for my spring boot application. The application is running fine it's just that intellij does not detect correctly the beans. I have added the Spring facet, hibernate facet, jpa facet to the module.
Here is my main class:
#SpringBootApplication
#EnableWebMvcSecurity
#ImportResource("classpath:spring/applicationContext.xml")
public class MyApplication{
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
}
This is a known bug in IntelliJ. However proper Spring Boot support is planned for the 14.1 release (last time I checked this release should be ready in a few months). Check out IDEA-119230 for more details.

In what maven2 repository can Google Guice be found?

As far as I understand Google Guice 2.0 is out not so long ago. But I see that central repo still has outdated 1.0 version. Please, tell where can I find maven2 repository with Google Guice 2.0.
Guice 3.0 is now available on central. You'll need the following to depend on it.
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
Sadly, they haven't uploaded source jars, and the class files have been compiled with Java 6. This may be a show-stopper for you…
Guice 2.0 is now available in the official google-maven-repository. To use it, add the following to your pom.xml inside of the <dependencies> tag (you'll need to add one if there isn't one):
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>2.0</version>
</dependency>
You shouldn't need to, but you can add a reference to the official google-maven-repository in your pom.xml by following the instructions here.
Since I don't see Guice 2.0 in central I thought I'd include a stable repo where I found it:
https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads/
The Grails OpenID plugin references http://guice-maven.googlecode.com/svn/trunk/ but that doesn't have it (currently).
They will put it to the central repository soon, as they promised here: http://groups.google.com/group/google-guice/browse_thread/thread/6707a887ed5ef2e3
Never mind. Guice-maven is intended to provide this.
Until it reaches the central repository, I've been getting it from here: http://guice-maven.googlecode.com/svn/trunk