When deploying to Wildfly 8.2.1 I received ClassNotFoundException PushMode

Hi all,
I have created an application which is using vaadin-push. I have annotated my UI with @Push annotation.
When I deploy my EAR to wildfly, it gives the following error:

Caused by: java.lang.NoClassDefFoundError: com/vaadin/shared/communication/PushMode
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:112)
at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:109)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.annotation.AnnotationType.(AnnotationType.java:109)
at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:266)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotation(Class.java:3415)
at org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension.extractExcludeAnnotation(ExcludeExtension.java:185)
at org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension.vetoBeans(ExcludeExtension.java:156)
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90)
… 16 more
Caused by: java.lang.ClassNotFoundException: com.vaadin.shared.communication.PushMode from [Module "deployment.example-exchange-ear.ear.example-exchange-web.war:main" from Service Module Loader]

    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
    ... 36 more

[/code]My application class is defined as follows:

public class ApplicationUI extends UI {
private CDIViewProvider viewProvider;

protected void init(VaadinRequest vaadinRequest) {
    Navigator navigator = new Navigator(this, this);

[/code]Can you please advise? I am not sure what I am doing wrong. Does Vaadin need to be added to Wildfly as a module?



You’re probably not including the vaadin-push package

Hi Patrik! How do I include the vaadin-push package? I am using Maven, and Wildfly plugin for deployment.

Please refer to
this wiki article
- if that doesn’t help, we’ll try to check specifics.
Basically, as long as Maven is told to include vaadin-push, it should deploy just fine on Wildfly. I’m not really sure why it’s not doing that by default, though, but I can ask around.

Just deployed by dropping the file manually in Wildfly. So it seems to be the Wildfly deployment plugin that is not working.

I’ll test Vaadin CDI deployment with Maven and mvn:wildfly when time permits, right now I’m a bit busy… If it turns out there’s something screwy with the deployment (that’s not attributable to a simple configuration quirk), I’ll file a bug.

As for why vaadin-push is not included as a dependency in the vaadin metapackage, it’s because it might conflict with existing stuff in the server, and not everyone wants it - leaving it out reduces bloat and loadtime in the resulting war (this is what I heard from a senior dev).

…actually, what do you mean by “file”? It should work if you have vaadin-push as a Maven dependency.