How will dagger support jigsaw? - dagger-2

What are the plans for dagger to support jigsaw in java 9?
Can we #Inject across different java 9 modules?
Can we #Inject a java 9 service that isn't provided explicitly by dagger?
E.g. module-info.java:
module com.foo.bar {
provides com.foo.api.MyInterface with com.foo.impl.MyImpl;
}
and be able to #Inject MyInterface without mentioning it in any dagger module.

Related

JPA #Inheritance strategy failure after domain deported to a JAR

I had to change a JPA Inheritance strategy from SINGLE_TABLE to JOINED after moving my entities to an Maven module, in order for them to used from different applications.
The junit tests were OK when launched within Eclipse (Spring Boot, Spring Data JPA) but failed at Maven build (Mapping Exception).
#Entity
//#Inheritance(strategy = TABLE_PER_CLASS)
//#DiscriminatorColumn(name = "privilege_datarealm_type")
#Inheritance(strategy = JOINED)
public abstract class PrivilegeDataRealm<E extends SchemaElement>
extends Privilege<PrivilegeDataRealm<E>>
implements SchemaElement {
Does anyone have any clue of explanations for this issue ?

Spring Boot REST controller classpath

We're starting a Spring Boot app with gradle bootRun which triggers the x.Application class which has the annotation #SpringBootApplication. After starting we can access REST services in the x package but can't access REST services in other packages. How can you configure the classpath accordingly?
Assuming your x package is something like com.example.mybootapp and your main Application.class is inside x package then you need to add this
#SpringBootApplication
#ComponentScan({"com.example.mybootapp","com.example.someother","one.more.pack"})
on your main Application.class method or Configuration file.
#SpringBootApplication itself consists of #Configuration #EnableAutoConfiguration #ComponentScan annotations, so #ComponentScan default the basePackge (i.e. packages to scan) to the package of the main Application.class and that is why Spring is unable to detect your other #Controlers which are outside of main package.
If you structure your code as suggested above (locating your application class in a root package), you can add #ComponentScan without any arguments. All of your application components (#Component, #Service, #Repository, #Controller etc.) will be automatically registered as Spring Beans.
Refer this document on how to structure your code.

Asynch class in Wildfly

in JBOSS versions prior to Wildfly there is the class
org.jboss.ejb3.asynchronous.Asynch
which one can use the make asynchronous call.
I can't find this class anywhere in Wildfly. I'm not intending to use the
#Asynchronous
annotation. This is the error that I get:
java.lang.ClassNotFoundException: org.jboss.ejb3.asynchronous.Asynch
The class actually come from the jboss-ejb3.jar which is not available on Wildfly
Thanks in avance
Import it directly from the javax.ejb.* package. This is the standard EE7 location and works on Wildly 8, 9 and 10. You neglected to tell us which version of Wildfly you were using.
import javax.ejb.Asynchronous;

Spring Roo with GWT BigDecimal serialization

I use STS 3.3.0 with roo 1.2.4. this one use GWT 2.5.0
When I database reverse engineer my database some fields are typed "BigDecimal", mainly amount on financial accounts. When I want to build using mvn gwt:run , I got a build failure due to the following error:
[ERROR] BigDecimalBox cannot be resolved to a type
After search in google I've found that GWT manage the BigDecimal since 2.1.
Any Clue?
Weird, there is no class with that name in the namespace you point (com.google.gwt.user.client.ui.ValueBox) in fact there is no BigDecimalBox in the gwt-2.5.1 library.
Implement it in your project and change imports to match the namespace you use for it.
public class BigDecimalBox extends ValueBox<BigDecimal> {
public BigDecimalBox() {
super(Document.get().createTextInputElement(), BigDecimalRenderer.instance(),
BigDecimalParser.instance());
}
}

GWT ServiceLocator with multi-module maven project

I've a multi-module GWT project and I'd like to use ServiceLocators. I have 3 modules:
"client" depends on shared
"shared"
"server" depends on shared
I wrote the ServiceLocator like this:
public class TreeServiceLocator implements ServiceLocator {
public Object getInstance(Class<?> clazz) {
return new TreeService();
}
}
and placed this class in the "shared" module because ServiceLocator has the package com.google.gwt.requestfactory.shared. However, when I compile this throws an error because TreeService is implemented in the "server" module since I need it to return beans from the server and interact with Spring, etc.
In which module should I implement the TreeServiceLocator? Also, maven will throw a circular dependency error if I try to include "server" from the "shared" module.
Thank you!
Place the TreeServiceLocator in the server package, and use a #ServiceName annotation instead of #Service. These annotations have the same effect, but the former uses string literals instead of class literals. This will avoid problems with the GWT compile if the server types aren't available on the classpath of the GWT compiler.