Vaadin-CDI and Glassfish 4.1

Hi, try with deltaspike 1.2.0, it worked for me.

https://github.com/mstahv/vaadin-java-ee-essentials/commit/39a0c3ebdbda7afd22f54f81aa8876e75d3c8ff7

cheers,
matti

Hi,
Thanks for reply and help, Matti.
I don’t know what I do wrong, but after adding DeltaSpike 1.2.0 dependencies to pom files, GlassFish (while app deploying) produces following three types of error:

First error:

Error occurred during deployment: Exception while loading the app : CDI deployment failure:Exception List with 5 exceptions: Exception 0 : org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type DeltaSpikeContextExtension with qualifiers @Default at injection point [BackedAnnotatedField]
 @Inject private org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.deltaSpikeContextExtension at org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.deltaSpikeContextExtension(WindowContextProducer.java:0) at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:370) at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:291) at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134) at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:165) at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:529) at org.jboss.w .... msg.seeServerLog

Second error:

Error occurred during deployment: Exception while loading the app : CDI deployment failure:WELD-001414: Bean name is ambiguous. Name dsWindowContext resolves to beans: [Producer Method [WindowContext]
 with qualifiers [@Default @Named @Any]
 declared as [[BackedAnnotatedMethod]
 @Produces @Named @Dependent public org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.getWindowContext()], Producer Method [WindowContext]
 with qualifiers [@Default @Named @Any]
 declared as [[BackedAnnotatedMethod]
 @Produces @Named @Dependent public org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.getWindowContext()]]. Please see server.log for more details.

And sometimes following error (when I redeploy app without restart of GlassFish server):

Error occurred during deployment: Exception while loading the app : CDI deployment failure:WELD-001408: Unsatisfied dependencies for type CDIViewProvider with qualifiers @Default at injection point [BackedAnnotatedField]
 @Inject protected org.vaadin.cdiviewmenu.ViewMenuUI.viewProvider at org.vaadin.cdiviewmenu.ViewMenuUI.viewProvider(ViewMenuUI.java:0) . Please see server.log for more details.

My example pom file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
        
    <parent>
        <artifactId>MotoFleetWeb</artifactId>
        <groupId>pl.com.companyname</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
  
    <groupId>pl.com.companyname</groupId>
    <artifactId>MotoFleetWeb-UI-web</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>MotoFleetWeb-UI-web</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <vaadin.version>7.3.6</vaadin.version>
        <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
    </properties>
    
    <repositories>
        <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>false</enabled>
            </releases>
            <snapshots>
            </snapshots>
        </repository>
        
        <repository>
            <id>oss-sonatype</id>
            <name>oss-sonatype</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    
    <pluginRepositories>
        <pluginRepository>
            <id>vaadin-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
    
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>MotoFleetWeb-DAO-ejb</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiled</artifactId>
            <version>${vaadin.version}</version>
        </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-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-themes</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-testbench-api</artifactId>
            <version>RELEASE</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
             <groupId>org.apache.openejb</groupId>
             <artifactId>javaee-api</artifactId>
             <version>6.0-6</version>
             <scope>provided</scope>
         </dependency>
        
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-cdi</artifactId>
            <version>1.0.2</version>
        </dependency>
        
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>googleanalyticstracker</artifactId>
            <version>2.1.0</version>
        </dependency>
        
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>filteringtable</artifactId>
            <version>0.9.11.v7</version>
        </dependency>
        
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>contextmenu</artifactId>
            <version>4.5</version>
        </dependency>
        
        <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>
        
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>6.0.0</version>
        </dependency>
        
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.6.6</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.10.1</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.10.1</version>
        </dependency>
        
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.34</version>
        </dependency>
        
        <dependency>
            <groupId>org.rxtx</groupId>
            <artifactId>rxtx</artifactId>
            <version>2.1.7</version>
        </dependency>
        
        <dependency>
            <groupId>org.smslib</groupId>
            <artifactId>smslib</artifactId>
            <version>dev-SNAPSHOT</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.tika</groupId>
            <artifactId>tika-core</artifactId>
            <version>1.6</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.deltaspike.core</groupId>
            <artifactId>deltaspike-core-api</artifactId>
            <version>1.2.0</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.deltaspike.core</groupId>
            <artifactId>deltaspike-core-impl</artifactId>
            <version>1.2.0</version>
            <scope>runtime</scope>
        </dependency>
        
        <dependency>
            <groupId>org.vaadin</groupId>
            <artifactId>cdi-helpers</artifactId>
            <version>1.5</version>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            
            <!--plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src/main/webapp/VAADIN/widgetsets</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin-->
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.plugin.version}</version>
                <configuration>
                    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                    <!--runTarget>mobilemail</runTarget-->
                    <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
                    <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
                    <persistentunitcachedir>${project.build.directory}</persistentunitcachedir>
                    <deploy>${project.build.directory}/gwt-deploy</deploy>
                    <compileReport>false</compileReport>
                    <noServer>true</noServer>
                    <draftCompile>false</draftCompile>
                    <style>OBF</style>
                    <strict>true</strict>
                    <!--runTarget>http://localhost:8080/</runTarget-->
                </configuration>
                <executions>
                    <execution>
                        <configuration></configuration>
                        <goals>
                            <!--goal>clean</goal-->
                            <goal>resources</goal>
                            <goal>update-theme</goal>
                            <goal>update-widgetset</goal>
                            <goal>compile-theme</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>8.1.16.v20140903</version>
            </plugin>
        </plugins>
        
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.vaadin</groupId>
                                        <artifactId>vaadin-maven-plugin</artifactId>
                                        <versionRange>[7.3.6,)</versionRange>
                                        <goals>
                                            <goal>resources</goal>
                                            <goal>update-widgetset</goal>
                                            <goal>compile</goal>
                                            <goal>update-theme</goal>
                                            <goal>compile-theme</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                
                <plugin>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <configuration>
                        <wtpversion>2.0</wtpversion>
                        <additionalProjectnatures>
                            <projectnature>com.vaadin.integration.eclipse.widgetsetNature</projectnature>
                        </additionalProjectnatures>
                        <additionalBuildcommands>
                            <buildcommand>com.vaadin.integration.eclipse.widgetsetBuilder</buildcommand>
                            <buildcommand>com.vaadin.integration.eclipse.addonStylesBuilder</buildcommand>
                        </additionalBuildcommands>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

Best regards,
Radoslaw

Hi,

Did you try a clean build and re-deploying that? Maybe the old deltaspike version is still on classpath? This happened to me when I found out the workaround.

If it still don’t work, you could add a bug ticket to dev.vaadin.com. If you can provide a test case that would help a lot to get this resolved. If you can post the example to public forum and making a dummy example takes too much effort, just zip your project and send it to henri.sara@vaadin.com. He is our greatest mind working on this product.

cheers,
matti

Hi,
In attachement there is an sample project with EJB module and two Vaadin web modules, which share one EJB module. In first case, if we have one web module - injecting is correct. With two web modules there is following error while app deploying in GlassFish.

Can you check this sample project or publish your own example where injecting for two Vaadin web modules is corrected?
I will be very thankful for any example.

Error occurred during deployment: Exception while loading the app : CDI deployment failure:WELD-001408: Unsatisfied dependencies for type CDIViewProvider with qualifiers @Default at injection point [BackedAnnotatedField]
 @Inject protected org.vaadin.cdiviewmenu.ViewMenuUI.viewProvider at org.vaadin.cdiviewmenu.ViewMenuUI.viewProvider(ViewMenuUI.java:0) . Please see server.log for more details.

17612.zip (82.6 KB)

just a quick link here with a similar issue but this time on Weblogic 12c that I reported in
http://dev.vaadin.com/ticket/15344

running into same problem as Radoslaw Bujak. … any update on this issue?

Hi,

Recently tried upgrading to vaadin-cdi-1.0.2 on GlassFish 3.1.2.2. Also buldled deltaspike-core-api-1.2.1.jar and deltaspike-core-impl-1.2.1.jar.

Now I get no errors related to delta spike but the page doesnt load at all. There is no error on the server log :frowning:

With Alpha version, everything worked fine.

Please help.

Hitesh

Hi,

I tried the attached Maven project using “mvn install” and deploying to Glassfish 4.1. The only thing I got in the logs was “Autodeploy failed” and “Error occurred during deployment: There is no installed container capable of handling this application mavenproject1-ear-1.0.0. Please see server.log for more details.” (of course server.log has no more details). Am I missing something or is the project missing something?

Do you have an example project you could post which works with the alpha version and no longer works with 1.0.2?

Just a note , one of my developer’s had the same issue on a Linux desktop , while the same project worked on my Mac (Identical versions of Glassfish 4.1).

Make sure you exlude deltaspike from vaadin-cdi and explicitly add a direct dependency in you project to the new version.

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-cdi</artifactId>
            <version>1.0.2</version>
            <exclusions>
                <exclusion>
                    <groupId>com.vaadin</groupId>
                    <artifactId>vaadin-server</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.deltaspike.core</groupId>
                    <artifactId>deltaspike-core-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.deltaspike.core</groupId>
                    <artifactId>deltaspike-core-impl</artifactId>
                </exclusion>                
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.deltaspike.core</groupId>
            <artifactId>deltaspike-core-api</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.deltaspike.core</groupId>
            <artifactId>deltaspike-core-impl</artifactId>
            <version>1.2.1</version>
        </dependency> 

I’m not sure if it is a maven dependecy plugin issue , but the old deltaspike libraries was also packages if we did not exlude them.

Hi,

Thanks for reply Arthur.

Sorry for delay in reply from me. I actually do not have an example project. I cant share my project due to leagal issues :frowning:

However, I can describe it a bit, which may lead to some hint in resolving. The project uses JPA-Hibernate 4.2, Shiro 1.2 for authentication, Vaadin 7.3.6. The GlassFish version is 3.1.2.2.

Anog with the libs required for Vaadin, Hibernate and Shiro, I am using deltaspike-core-api-1.2.1.jar and deltaspike-core-impl-1.2.0.jar.

Following is how the web.xml look like :

<?xml version="1.0" encoding="UTF-8"?>


DIVA

org.apache.shiro.web.env.EnvironmentLoaderListener


shiroConfigLocations
WEB-INF/lib/shiro.ini


shiroFilter
org.apache.shiro.web.servlet.ShiroFilter

<filter-mapping>
    <filter-name>shiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
</filter-mapping>

Please let me know if anymore information about the project can help identifying the issue.

Thanks for the help Arthur and Petrus :slight_smile:

Sorry for the improper formatting of the code above :frowning:

Thanks for your Answer!

I had the same problem while deploying an ear to glassfish 4.1 (unhappily the problem occured on our production machine only, three development machines had no problem at all) - The exclusion and addition of the direct dependency fixed the issue for me.

May anybody explain this behavior? Thanks in advance.

Hi All,

Thank you for the help. I resolved the problem.

replace @CDIUI with @CDIUI(“”) and it worked. Actually I was using the alpha version earlier.

Hi,
had the same problem using Vaadin CDI Addon 1.0.2 and Glassfish 3.1. Adding deltaspike-core-api-1.3 and deltaspike-core-impl-1.3 dependency to my project pom solved the problem. Thanks for your help.

Hi there!

I’m really confused … Alpha Version Code, 1.0.2 Code CDI Servlet or not etc. …confusing …
So this is my code (I’m using my own Servlet):

@WebServlet(value = “/*”, asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = com.xxx.XXUI.class, widgetset = “com.xxx.XXWidgetSet”)
public class XXServlet extends VaadinCDIServlet {

@Override
protected final void servletInitialized() throws ServletException {
    super.servletInitialized();
    getService().addSessionInitListener(new XXSessionInitListener());
}

}

pom.xml:

com.vaadin vaadin-cdi 1.0.2 com.vaadin vaadin-server org.apache.deltaspike.core deltaspike-core-api org.apache.deltaspike.core deltaspike-core-impl
    <dependency>
        <groupId>org.apache.deltaspike.core</groupId>
        <artifactId>deltaspike-core-api</artifactId>
        <version>1.2.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.deltaspike.core</groupId>
        <artifactId>deltaspike-core-impl</artifactId>
        <version>1.2.1</version>
    </dependency> 

            <groupId>org.glassfish.embedded</groupId>
            <artifactId>maven-embedded-glassfish-plugin</artifactId>
            <version>3.1.2.2</version>
            <configuration>
                <autodelete>true</autodelete>
                <cascade>true</cascade>
                <systemProperties>
                    <property>glassfish.embedded.tmpdir=${basedir}/target/glassfish</property>
                </systemProperties>
                <app>${project.build.directory}/${project.build.finalName}</app>
                <port>8080</port>
                <contextRoot></contextRoot>
                <autoDelete>true</autoDelete>
                <!--<configFile>${basedir}/src/main/webapp/WEB-INF/config/glassfish/domain.xml</configFile> -->
                
                <resources>
                    <resource>
                        <directory>${project.build.directory}/classes</directory>
                    </resource>

                </resources>
                                  
                <classpath>                                           
                    ${project.build.directory}/classes
                </classpath>
                
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.glassfish.main.common</groupId>
                    <artifactId>simple-glassfish-api</artifactId>
                    <version>3.1.2.2</version>
                </dependency>
                <dependency>
                    <groupId>org.glassfish.main.extras</groupId>
                    <artifactId>glassfish-embedded-all</artifactId>
                    <version>3.1.2.2</version>
                </dependency>
                <dependency>
                    <groupId>postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <version>9.1-901.jdbc4</version>
                </dependency>

            </dependencies>
            
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
                
                <execution>
                    <id>start-integration</id>
                    <!-- We implement the integration testing by setting up our GlassFish instance to start and deploy our application. -->
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start</goal>
                        <goal>deploy</goal>
                    </goals>
                </execution>
                <execution>
                    <id>stop-integration</id>
                    <!-- After integration testing we undeploy the application and shutdown GlassFish gracefully. -->
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>undeploy</goal>
                        <goal>stop</goal>
                    </goals>
                </execution>
                                    
            </executions>

        </plugin>

web.xml

<?xml version="1.0" encoding="UTF-8"?> XXX Vaadin production mode productionMode ${productionMode} com.xxx.init.XXDefaultContextListener ...

I’m using ebedded Glassfish for development (look at the pom.xml above) and the injection in UI works (userFacade, browserEvents not null) :

@Theme(“XX”)
@Widgetset(“com.xx.XXWidgetSet”)
@Title(“XX”)
@SuppressWarnings(“serial”)
@CDIUI(“”)
public final class XXUI extends UI {
@Inject
private Instance userFacade;

@Inject
javax.enterprise.event.Event<BrowserResizeEvent> browserEvents;

… but now I’m using injection in a view it does not work, but I really dont know why:

public class LoginView extends VerticalLayout {
@Inject
javax.enterprise.event.Event loginEvents;

@Inject
Instance<EmuserFacade> userFacade;

… always null …

Please can you help me here, I’ve searched for days now … (checked different Versions, web.xml, Servlet etc. etc.)

Thank you!

Agrr,
this does the job:

https://vaadin.com/forum/#!/thread/8466915/8479361

Sry,
Matthias

I have a problem in general with vaadin cdi and glassfish 4.1. I am stuck on this since tree days.
I created a new maven multimodule project and i simply follow this first tutorial :
http://https://vaadin.com/wiki?p_p_id=36&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=row-1&p_p_col_pos=1&p_p_col_count=3&_36_struts_action=%2Fwiki%2Fview&p_r_p_185834411_nodeName=vaadin.com+wiki&p_r_p_185834411_title=I±+Getting+started+with+Vaadin+CDI.

I can’t deploy it on glassfish beacause the bean manager ist not found:

[code]
2015-09-13T09:10:46.901+0200|Schwerwiegend: Could not get BeanManager through JNDI
2015-09-13T09:10:46.901+0200|Schwerwiegend: java.lang.NullPointerException
at com.vaadin.cdi.internal.AnnotationUtil.getUiBeans(AnnotationUtil.java:80)
at com.vaadin.cdi.internal.AnnotationUtil.getRootUiBeans(AnnotationUtil.java:52)
at com.vaadin.cdi.CDIUIProvider.rootUI(CDIUIProvider.java:137)
at com.vaadin.cdi.CDIUIProvider.getUIClass(CDIUIProvider.java:109)
at com.vaadin.server.BootstrapHandler.synchronizedHandleRequest(BootstrapHandler.java:245)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1408)
at com.vaadin.cdi.server.VaadinCDIServletService.handleRequest(VaadinCDIServletService.java:92)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:351)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:295)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)

2015-09-13T09:10:46.903+0200|Warnung: StandardWrapperValve[VaadinServlet]
: Servlet.service() for servlet VaadinServlet threw exception
java.lang.NullPointerException
at com.vaadin.cdi.internal.AnnotationUtil.getUiBeans(AnnotationUtil.java:80)
at com.vaadin.cdi.internal.AnnotationUtil.getRootUiBeans(AnnotationUtil.java:52)
at com.vaadin.cdi.CDIUIProvider.rootUI(CDIUIProvider.java:137)
at com.vaadin.cdi.CDIUIProvider.getUIClass(CDIUIProvider.java:109)
at com.vaadin.server.BootstrapHandler.synchronizedHandleRequest(BootstrapHandler.java:245)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1408)
at com.vaadin.cdi.server.VaadinCDIServletService.handleRequest(VaadinCDIServletService.java:92)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:351)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:295)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
[/code]I don’t now what i am doing wrong. In my pom.xml i added

<dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-cdi</artifactId> <version>1.0.3</version> </dependency> and i also tried to override the dependencies

<dependency> <groupId>org.apache.deltaspike.core</groupId> <artifactId>deltaspike-core-api</artifactId> <version>1.5.0</version> </dependency> <dependency> <groupId>org.apache.deltaspike.core</groupId> <artifactId>deltaspike-core-impl</artifactId> <version>1.5.0</version> </dependency> I have also added a beans.xml in the WEB-INF folder. It doesn’t help.
Can someone please help me or give me some ideas?

Okay, just for information if i create a vaadin application with maven as a single module. Everything works…
Looks like there is a problem with the multimodule project. I have added the vaadin-cdi dependency in the ui module. Ist that right?

You should have no problem puting is the ui/web module, The majority of my projects is multi module maven projects and CDI works fine.