Hi,
After the changes am getting the below exception:
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
[CDIUI_WITHOUT_UI]
Inconsistent deployment: The non-abstract class com.shaic.***
with @CDIUI should extend com.vaadin.ui.UI
at com.vaadin.cdi.internal.VaadinExtension.throwInconsistentDeployment(VaadinExtension.java:93)
ollit.1
(Olli Tietäväinen)
April 26, 2019, 11:23am
8
Error seems to say you have the @CDIUI
annotation on a class that does not extend UI
. Is this the case?
Yes,import com.vaadin.cdi.CDIUI;
ollit.1
(Olli Tietäväinen)
April 26, 2019, 11:31am
10
No, I mean, which class do you have the @CDIUI
annotation on? You should have something like this:
@CDIUI("myui")
public class MyUI extends UI {
...
@CDIUI
public abstract class GBaseTable<T> extends ViewComponent {
}
ollit.1
(Olli Tietäväinen)
April 26, 2019, 11:45am
12
Ok, then that is your problem. Like the error message says, the @CDIUI
annotation should only be placed on a class that extends UI
. You have the @CDIUI
annotation on a class that extends ViewComponent
, which I assume is not a UI
.
Hi,
Now we are facing the below exception,
SEVERE [com.vaadin.server.DefaultErrorHandler]
(default task-8) : java.lang.NullPointerException
at com.vaadin.cdi.internal.AnnotationUtil.getUiBeans(AnnotationUtil.java:80)
at com.vaadin.cdi.CDIUIProvider.getUIBeanWithMapping(CDIUIProvider.java:176)
at com.vaadin.cdi.CDIUIProvider.getUIClass(CDIUIProvider.java:118)
Kindly suggest.
ollit.1
(Olli Tietäväinen)
April 26, 2019, 2:12pm
14
So what does your @CDIUI-annotated class look like now?
We are now using @CDIUI anotation only for classes that extends UI
Tatu2
(Tatu Lund)
April 29, 2019, 6:44am
17
There has been some API and usage changes between 2.0 and 3.0 versions of the CDI add-on.
I have one demo app which covers most of the cases how to use 3.0 with Vaadin 8 https://github.com/TatuLund/cdi-demo
Hi,
Thanks,We will check and update.
Hi,
The below exception message
com.vaadin.cdi.internal.AnnotationUtil.getUiBeans(AnnotationUtil.java:80) at
shows me that BeanManager is null, when i debug. Is there any way to make sure
BeanManager is available and instantiated???
Any Idea on this
From AnnotationUtil.java
public static Set<Bean<?>> getUiBeans(BeanManager beanManager) {
// The annotation @CDIUI can have a value, so using it as the type
// parameter of AnnotationLiteral is somewhat problematic.
Set<Bean<?>> uiBeans = beanManager.getBeans(UI.class,
new AnnotationLiteral<Any>() {
});
return uiBeans;
}
Dineshkumar1
(Dineshkumar Mohan)
September 28, 2019, 5:45pm
20
any update on the issue?
Below is my pom file
<!-- <finalName>${project.artifactId}</finalName> -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>8.5.2</vaadin.version>
<vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<vaadin.widgetset.mode>local</vaadin.widgetset.mode>
<!-- <org.mapstruct.version>1.0.0.Beta2</org.mapstruct.version> -->
</properties>
<repositories>
<repository>
<id>public</id>
<url>http://maven.nuxeo.org/nexus/content/repositories/public/</url>
</repository>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>local-repository</id>
<url>file:${project.basedir}/lib</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<!-- <dependency>
<groupId>com.zybnet</groupId>
<artifactId>vaadin-autocomplete</artifactId>
<version>1.1.1</version>
</dependency> -->
<!-- J2EE Add-Ons -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>
<groupId>de.steinwedel.vaadin.addon</groupId>
<artifactId>messagebox</artifactId>
<version>2.0.7</version>
</dependency> -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
<!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory).
For widgetset compilation, vaadin-client-compiler is automatically added
on the compilation classpath by vaadin-maven-plugin so normally there is
no need for an explicit dependency. -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-client</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-themes</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
<version>${vaadin.version}</version>
</dependency>
<!-- Vaadin Add-Ons -->
<dependency>
<groupId>org.vaadin.addon</groupId>
<artifactId>cdi-properties</artifactId>
<version>0.9.2</version>
</dependency>
<dependency>
<groupId>com.shaic</groupId>
<artifactId>dms-galaxy-ejb-client</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.shaic</groupId>
<artifactId>galaxy-wizard</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
<version>4.6.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>core</artifactId>
<version>3.3.0-v_771</version>
<exclusions>
<exclusion>
<artifactId>resources</artifactId>
<groupId>org.eclipse.core</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.oracle.soa</groupId>
<artifactId>wlthint3client</artifactId>
<version>12.1.3.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle.soa</groupId>
<artifactId>xml</artifactId>
<version>12.1.3.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle.soa</groupId>
<artifactId>xmlparserv2</artifactId>
<version>12.1.3.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
<version>18.0</version>
</dependency>
<dependency>
<groupId>org.vaadin.virkki</groupId>
<artifactId>carousel</artifactId>
<version>0.5.2</version>
</dependency>
<dependency>
<groupId>org.vaadin.addon</groupId>
<artifactId>cdi-mvp</artifactId>
<version>0.9.4</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-cdi</artifactId>
<version>2.0.0</version>
<!-- <version>1.0.0.alpha1</version> -->
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>csvalidation</artifactId>
<version>0.5.1</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.8.2</version>
</dependency>
<!-- <dependency>
<groupId>org.tepi.filtertable</groupId>
<artifactId>filteringtable</artifactId>
<version>1.0.1.v8</version>
</dependency> -->
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>filteringtable</artifactId>
<version>0.9.13.v7</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>popupbutton</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>pagedtable</artifactId>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>org.vaadin.addon</groupId>
<artifactId>confirmdialog</artifactId>
<version>3.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.vaadin.addon/grid -->
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>grid</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.zybnet</groupId>
<artifactId>vaadin-autocomplete</artifactId>
<version>1.1.1</version>
</dependency>
<!-- <dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>autocomplete</artifactId>
<version>0.2.4</version>
</dependency> -->
<dependency>
<groupId>eu.maxschuster</groupId>
<artifactId>vaadin-autocompletetextfield</artifactId>
<version>3.0-alpha-2</version>
</dependency>
<dependency>
<groupId>de.steinwedel.vaadin.addon</groupId>
<artifactId>messagebox</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.1.0</version>
<exclusions>
<exclusion>
<artifactId>jdtcore</artifactId>
<groupId>eclipse</groupId>
</exclusion>
<exclusion>
<artifactId>jackson-annotations</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>6.8.0</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext-rups</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
<!-- Mapper -->
<dependency>
<groupId>ma.glasnost.orika</groupId>
<artifactId>orika-core</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.paranamer</groupId>
<artifactId>paranamer</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>ma.glasnost.orika</groupId>
<artifactId>orika-eclipse-tools</artifactId>
<version>1.5.0</version>
<exclusions>
<exclusion>
<artifactId>org.eclipse.jdt.core</artifactId>
<groupId>org.eclipse.tycho</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.meemin</groupId>
<artifactId>PMTable</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>tokenfield</artifactId>
<version>7.0.1</version>
</dependency>
<!-- will be removed in future -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.16.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.2.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.2.16.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>flexibleoptiongroup</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>tableexport-for-vaadin</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>atg.taglib.json</groupId>
<artifactId>json-taglib</artifactId>
<version>0.4.1</version>
</dependency>
<!-- <dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>pdfexport</artifactId>
<version>1.0.1</version>
</dependency> -->
<!-- quartz scheduler dependency starts -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-jobs</artifactId>
<version>2.2.1</version>
</dependency>
<!-- JBOSS EAP-6.4 dependency starts -->
<dependency>
<groupId>org.ajaxtags</groupId>
<artifactId>ajaxtags</artifactId>
<version>1.3-beta-rc7</version>
</dependency>
<dependency>
<groupId>net.htmlparser</groupId>
<artifactId>jericho-html</artifactId>
<version>1.5-dev1</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>1.8.11</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.8-beta4</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.6</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>8.0.0-RC1</version>
</dependency>
<!-- JSP validation Page to get token -->
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.1.0</version>
</dependency>
<!-- ComboBoxMultiSelect Addon -->
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>vaadin-combobox-multiselect</artifactId>
<version>1.2.2</version>
</dependency>
<!-- EnhancedBrowserWindowOpener Addon -->
<dependency>
<groupId>org.vaadin.addon</groupId>
<artifactId>enhanced-window-opener</artifactId>
<version>0.1.2</version>
</dependency>
<!-- Added for exporting the tasks from queue to excel sheet -->
<!-- JBOSS EAP-6.4 dependency ends -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.0.7.Final</version>
<scope>provided</scope>
</dependency>
<!-- quartz scheduler dependency ends -->
<!-- XMLTogregorian calendar conversion dependency -->
<!-- <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId>
<version>2.11.0</version> </dependency> -->
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-saml-servlet-filter-adapter</artifactId>
<version>3.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<version>3.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-servlet-filter-adapter</artifactId>
<version>3.2.0.Final</version>
<exclusions>
<exclusion>
<artifactId>jackson-annotations</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-adapter-core</artifactId>
<version>3.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>3.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-model-api</artifactId>
<version>1.0.2.Final</version>
<scope>provided</scope>
</dependency>
<!-- Newly added dependencies after wso2 removal Start -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
<version>1.5.11</version>
</dependency>
<!-- Newly added dependencies after wso2 removal End -->
<!-- HashIds for URL shortener -->
<dependency>
<groupId>org.hashids</groupId>
<artifactId>hashids</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.icepush</groupId>
<artifactId>icepush</artifactId>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.lib.gwt</artifactId>
<version>2.4.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.xtext</groupId>
<artifactId>org.eclipse.xtext.xbase.lib.gwt</artifactId>
<version>2.4.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
Tatu2
(Tatu Lund)
September 30, 2019, 5:31am
21
Is there any way to make sure BeanManager is available and instantiated???
Bean manager is setup by the container, e.g. Wildfly, so if it is not there, something has gone wrong earlier in the startup of the app. You may find hints by reading the log.
Also did you remember to add beans.xml https://github.com/TatuLund/cdi-demo/tree/master/src/main/webapp/WEB-INF ?
I have followed the below document, added the Default and alternative annotations into more than one classes which are implemented the same interface. Also, added alternative entries in beans.xml file and still getting same error. If an interface implemented in only one class, Should I mark Default annotation for that too? Please advise.
https://vaadin.com/docs/flow/cdi/tutorial-cdi-service-beans.html
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<alternatives>
<class>com.aic.aim.preauth.wizard.pages.MedicalDecisionTable</class>
<class>com.aic.aim.clearcashless.ClearCashlessViewImpl</class>
</alternatives>
</beans>
17874926.log (300 KB)
Tatu2
(Tatu Lund)
October 4, 2019, 5:08pm
23
The documentation you linked is for Vaadin 14
The documentation about Vaadin 8 version of CDI add-on is here: https://vaadin.com/docs/v8/framework/advanced/advanced-cdi.html
Normaly you do not need to add anything to beans.xml
Dineshkumar1
(Dineshkumar Mohan)
October 5, 2019, 12:19pm
24
Okay! Let me check and revert you back.
As per documentation “The application should not have a servlet extending VaadinServlet, as Vaadin servlet has its own VaadinCDIServlet that is deployed automatically.” https://vaadin.com/docs/v8/framework/advanced/advanced-cdi.html )
Changed VaadinServlet to VaadinCDIServlet and application working fine now.
public class CreateIntServlet extends VaadinCDIServlet {
public class MSServlet extends VaadinCDIServlet {