IllegalArgumentException when injecting a seam component - seam2

I am trying to migrate an application which uses seam 2.1.2, from JBoss 5.2 to JBoss 6.4 EAP. I added all the seam dependent libraries as maven dependencies and now I have the application deploying without any errors and the seam context seems to be created successfully (and some of the flows are working as expected).
I stumbled upon an issue and I hope that someone can help with an advise.
My EAR has the following structure:
myapp.ear
|
|--- warpck.war
|
|--- ejb.jar
|
|--- client1.jar
|
|--- client2.jar
|
|--- commons.jar
|
|--- loggers.jar
In the client1.jar I have the following java bean defined:
#Name(CustomClient.NAME)
#AutoCreate
public class CustomClientImpl implements CustomClient {
...
}
The CustomClient interface looks like this:
public interface CustomClient extends GeneratedSoapClients {
String NAME = "customClient";
}
During the deployment I have the following log:
09:14:44,574 INFO [org.jboss.seam.Component] (ServerService Thread Pool -- 81) Component: customClient, scope: EVENT, type: JAVA_BEAN, class: myapp.client.impl.CustomClientImpl
...so I assume that the component is registered correctly in the seam context.
The problem is when I try to inject this component into one of the classes form the ejb.jar package. I get the following error:
09:14:49,319 ERROR [org.jboss.as.ejb3.invocation] (http-/127.0.0.1:8080-1) JBAS014134: EJB Invocation failed on component CustomAdapterWs for method public myapp.webservice.v5.CustomResponse myapp.webservice.impl.CustomAdapterWs.customInformation(myapp.webservice.v5.CustomInformation): javax.ejb.EJBException: java.lang.IllegalArgumentException: could not set field value: CustomAdapterController.customClient
Caused by: java.lang.IllegalArgumentException: could not set field value: CustomAdapterController.customClient
at org.jboss.seam.Component.setFieldValue(Component.java:1927) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.Component.access$600(Component.java:126) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.Component$BijectedField.set(Component.java:2940) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.Component.injectAttributes(Component.java:1736) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.Component.inject(Component.java:1554) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam-2.1.2.jar:2.1.2]
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) [jboss-seam-2.1.2.jar:2.1.2]
Caused by: java.lang.IllegalArgumentException: Could not set field value by reflection: CustomAdapterController.customClient on: myapp.controller.CustomAdapterController with value: class myapp.client.impl.CustomClientImpl_$$_javassist_seam_2
Caused by: java.lang.IllegalArgumentException: Can not set myapp.client.CustomClient field myapp.controller.CustomAdapterController.customClient to myapp.client.impl.CustomClientImpl_$$_javassist_seam_2
The CustomAdapterController:
#Name(CustomAdapterController.NAME)
#AutoCreate
public class CustomAdapterController {
public static final String NAME = "CustomAdapterController";
#In(value = CustomClient.NAME)
private CustomClient customClient;
The javassist dependency that I use (it's added in the EAR pom):
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.20.0-GA</version>
</dependency>
The jboss-deployment-structure.xml:
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<exclusions>
<module name="org.hibernate" slot="main"/>
<module name="org.javassist" slot="main"/>
</exclusions>
<dependencies>
<module name="javax.faces.api" slot="1.2" export="true"/>
<module name="com.sun.jsf-impl" slot="1.2" export="true"/>
<module name="org.apache.log4j" export="true"/>
<module name="org.dom4j" export="true"/>
<module name="org.apache.commons.logging" export="true"/>
<module name="org.apache.commons.collections" export="true"/>
</dependencies>
</deployment>
<sub-deployment name="warpck.war">
<exclusions>
<module name="javax.faces.api" slot="main"/>
<module name="com.sun.jsf-impl" slot="main"/>
</exclusions>
<dependencies>
<module name="javax.faces.api" slot="1.2"/>
<module name="com.sun.jsf-impl" slot="1.2"/>
</dependencies>
</sub-deployment>
<sub-deployment name="ejb.jar">
<dependencies>
<module name="client1.jar"/>
</dependencies>
</sub-deployment>
</jboss-deployment-structure>
All the components that are defined in the ejb.jar are injected correctly. The issue appears each time I try to inject a bean which is defined in a differenect package. Can anyone tell me what I'm missing here?

you can't unless you use this version of seam
Seam 2.2.3
and this is jboss-deployment-structure.xml

Related

Error running Spark Main Class - Exception in thread "Thread-0" java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler

I am learning Mongodb for Java and I am trying to run the code below which shows jetty handler error. I tried searching for solutions in different threads of this forum but none of the solutions helps me. Please help. What am I missing?
package com.mongo.practice;
import spark.Request;
import spark.Response;
import spark.Route;
import spark.Spark;
public class SparkMain {
public static void main(String[] args){
Spark.get("/", new Route() {
public Object handle(final Request request, final Response response){
return "Hello worldfrom Spark";
}
});
}
}
I get this error when run
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler
at spark.embeddedserver.EmbeddedServers.initialize(EmbeddedServers.java:40)
at spark.Service.lambda$init$2(Service.java:536)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Handler
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more
This is my pom.xml
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mongo</groupId>
<artifactId>M101J</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.mongodb/mongo-java-driver -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.7.1</version>
</dependency>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>2.7.2</version>
</dependency>
</dependencies>
</project>
I tried adding this
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-server -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.4.9.v20180320</version>
</dependency>
but it did not solve the issue
You have to add two dependencies. The following:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.22</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>9.3.24.v20180605</version>
</dependency>
The version for sl4j can varry. But the version of jetty is not flexible. I have tried with the latest version. It does not work for any other version other than this.

log4j2 - JVM input arguments lookup (jvmrunargs) does not work

I have just started trying out log4j2 (I've been using log4j 1.2.X previously). Aside from the frustration of trying to figure out what is needed/valid for the configuration file (log4j2.xml), I have been unable to use the Java VM "lookup" capability supposedly supported by log4j2. As far as I can tell, I'm doing the right stuff - based on the information available from the log4j web site. Has anyone ever had any success with this?
Here are the basics of what I'm doing:
java class:
[which is using SLF4J to "bridge" to log4j]
package logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Main {
private static final Logger logger = LoggerFactory.getLogger(Main.class);
public static void main(String[] args) {
logger.info("In main()");
}
}
log4j2.xml:
[I'm trying to pass a log directory, configured elsewhere]
<?xml version="1.0" encoding="UTF-8" ?>
<configuration status="INFO" strict="true">
<Properties>
<Property name="filename">${jvmrunargs:log_dir}/log.txt</Property>
</Properties>
<!-- APPENDERS -->
<Appenders>
<Appender type="File" name="File" fileName="${filename}">
<Layout type="PatternLayout">
<Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
</Layout>
</Appender>
</Appenders>
<!-- LOGGERS -->
<Loggers>
<Root level="INFO">
<AppenderRef ref="File" />
</Root>
</Loggers>
</configuration>
This fails with multiple exceptions thrown by log4j:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/jo24447/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.7/log4j-slf4j-impl-2.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/jo24447/.m2/repository/org/slf4j/slf4j-log4j12/1.7.21/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
2016-12-07 10:44:52,566 main ERROR FileManager (${jvmrunargs:log_dir}/log.txt) java.io.FileNotFoundException: ${jvmrunargs:log_dir}\log.txt (The filename, directory name, or volume label syntax is incorrect) java.io.FileNotFoundException: ${jvmrunargs:log_dir}\log.txt (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory.createManager(FileManager.java:258)
at org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory.createManager(FileManager.java:238)
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:112)
at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
at org.apache.logging.log4j.core.appender.FileManager.getFileManager(FileManager.java:110)
at org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:89)
at org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:51)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:942)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:882)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:874)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:498)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:227)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:239)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:530)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:603)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:620)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:226)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:103)
at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at logger.Main.<clinit>(Main.java:8)
2016-12-07 10:44:52,572 main ERROR Unable to inject fields into builder class for plugin type class org.apache.logging.log4j.core.appender.FileAppender, element File. java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory#1decca33] unable to create manager for [${jvmrunargs:log_dir}/log.txt] with data [org.apache.logging.log4j.core.appender.FileManager$FactoryData#24cee99e]
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:114)
at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
at org.apache.logging.log4j.core.appender.FileManager.getFileManager(FileManager.java:110)
at org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:89)
at org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:51)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:942)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:882)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:874)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:498)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:227)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:239)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:530)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:603)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:620)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:226)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:103)
at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at logger.Main.<clinit>(Main.java:8)
2016-12-07 10:44:52,575 main ERROR Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.FileAppender for element File. java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.FileAppender
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:224)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:130)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:942)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:882)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:874)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:498)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:227)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:239)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:530)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:603)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:620)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:226)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:103)
at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at logger.Main.<clinit>(Main.java:8)
2016-12-07 10:44:52,576 main ERROR Null object returned for File in Appenders.
2016-12-07 10:44:52,581 main ERROR Unable to locate appender "File" for logger config "root"
Here is the simple pom.xml:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>logger</groupId>
<artifactId>logger</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<compileSource>1.7</compileSource>
<maven-compiler-plugin.version>2.3.2</maven-compiler-plugin.version>
<maven-jar-plugin.version>2.5</maven-jar-plugin.version>
<maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
<log4j.version>2.7</log4j.version>
<slf4j.version>1.7.21</slf4j.version>
</properties>
<dependencies>
<!-- Apache Log4J 2 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- Log4J 2 to SLF4J bridge -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- SLF4J -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${compileSource}</source>
<target>${compileSource}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

Jackson 2 on Wildfly 10: How to load ProviderBase?

There seems to be a lot of questions related to Wildfly and Jackson, yet I could not solve my problem despite searching the site far and wide...
I want to use Jackson 2 to handle JSON serialization on an app deployed on Wildfly 10, but I keep getting stuck on loading the com.fasterxml.jackson.jaxrs.base.ProviderBase class.
Offending code:
#Provider
public class CustomJsonProvider extends ResteasyJackson2Provider {
#Inject
private CustomSerializer customSerializer;
private List<JsonSerializer<?>> getSerializers() {
final List<JsonSerializer<?>> result = new ArrayList<>();
// Add custom serializers here.
result.add(customSerializer);
return result;
}
#Override
public void writeTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException {
final List<JsonSerializer<?>> serializers = getSerializers();
final ObjectMapper mapper = locateMapper(type, mediaType);
final SimpleModule zeModule = new SimpleModule("App", Version.unknownVersion(), serializers);
mapper.registerModule(zeModule);
this.setMapper(mapper);
super.writeTo(value, type, genericType, annotations, mediaType, httpHeaders, entityStream);
}
}
In my pom.xml, I have:
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.18.Final</version>
<scope>provided</scope>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.0.18.Final</version>
</dependency>
<!-- dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-base</artifactId>
<version>2.5.4</version>
<scope>provided</scope>
</dependency -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
And in the jboss-deployment-structure.xml file:
<deployment>
<exclusions>
<module name="org.apache.commons.logging" />
<module name="org.apache.log4j" />
<module name="org.jboss.logging" />
<module name="org.jboss.logging.jul-to-slf4j-stub" />
<module name="org.jboss.logmanager" />
<module name="org.jboss.logmanager.log4j" />
<module name="org.slf4j.impl" />
<module name="org.codehaus.jackson" />
<module name="org.codehaus.jackson.jackson-mapper-asl" />
<module name="org.codehaus.jettison" />
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
<module name="org.jboss.resteasy.resteasy-jettison-provider" />
</exclusions>
<dependencies>
<module name="org.jboss.resteasy.resteasy-jackson2-provider" services="import"/>
</dependencies>
</deployment>
With this configuration, compile and deployment go smoothly, but on runtime, I get the following exception:
Caused by: java.lang.LinkageError: loader constraint violation: when
resolving overridden method
"com.my.package.CustomJsonProvider$Proxy$_$$WeldClientProxy.disable(Lcom/fasterxml/jackson/databind/SerializationFeature;)Lcom/fasterxml/jackson/jaxrs/base/ProviderBase;"
the class loader (instance of org/jboss/modules/ModuleClassLoader) of
the current class,
com/my/package/CustomJsonProvider$Proxy$$$_WeldClientProxy, and its
superclass loader (instance of org/jboss/modules/ModuleClassLoader),
have different Class objects for the type
com/fasterxml/jackson/jaxrs/base/ProviderBase used in the signature
From what I gathered, there is a different version of ProviderBase loaded by Wildfly's classloader. So I figured that using the provided version would solve the problem (with the possible side-effect of unexpect implementation differences, but still).
Problem is, if I uncomment the commented dependency in the POM, de facto using the version of com.fasterxml.jackson.jaxrs:jackson-jaxrs-baseprovided in Wildlfy, it complains again at runtime:
Caused by: java.lang.ClassNotFoundException:
com.fasterxml.jackson.jaxrs.base.ProviderBase from [Module
"deployment.myapp-ear-0.1-SNAPSHOT.ear.myapp-core-0.1-SNAPSHOT.jar:main"
from Service Module Loader]
This seems to be a problem of conflicting classloaders.
What am I missing and how can I solve this?

java.lang.ClassCastException: org.glassfish.jersey.jackson.internal.JacksonAutoDiscoverable cannot be cast to spi.AutoDiscoverable

I am new to implementing REST API services. I have tried the simple resources to implement. unfortunately I stuck with this exception. I have googled and tried many options but no luck. I am unsure what am doing wrong. Please help me.
Created a Dynamic Web project "JersyJson"
Created a resouce named - JSONService.java (source is from googling)
Created a Java Bean class - Track.java (source is from googling)
Converted the project into Maven project
Created a Application file - JersyJson.java file for Application Annotation
using the latest Jersy Jars (version: 2.22.2)
Imported & configured jersey-media-json-jackson and jersey-media-moxy jars (2.22.2) in pom.xml
Pom.xml
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>JersyJson</groupId>
<artifactId>JersyJson</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<!-- if your container implements Servlet API older than 3.0, use "jersey-container-servlet-core" -->
<artifactId>jersey-container-servlet</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>2.22.2</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>JersyJson</display-name>
<servlet>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
</servlet>
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/json/metallica/*</url-pattern>
</servlet-mapping>
</web-app>
JersyJson.java (ApplicationAnnotation file)
#ApplicationPath("json")
public class JersyJson extends ResourceConfig {
public JersyJson() {
packages("com.sai.jersyjson");
}
}
JSONservice.java:
package com.sai.jersyjson;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
#Path("/json/metallica")
public class JSONService {
#GET
#Path("/get")
#Produces(MediaType.APPLICATION_JSON)
public Track getTrackInJSON() {
Track track = new Track();
track.setTitle("Enter Sandman");
track.setSinger("Metallica");
return track;
}
#POST
#Path("/post")
#Consumes(MediaType.APPLICATION_JSON)
public Response createTrackInJSON(Track track) {
String result = "Track saved : " + track;
return Response.status(201).entity(result).build();
}
}
Track.java (simple bean class)
package com.sai.jersyjson;
public class Track {
String title;
String singer;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getSinger() {
return singer;
}
public void setSinger(String singer) {
this.singer = singer;
}
#Override
public String toString() {
return "Track [title=" + title + ", singer=" + singer + "]";
}
}
After I run this project in Eclispe using Tomcat webserver, I get the following
error with 404-Error Status
SEVERE: StandardWrapper.Throwable
java.lang.ClassCastException: org.glassfish.jersey.jackson.internal.JacksonAutoDiscoverable cannot be cast to org.glassfish.jersey.internal.spi.AutoDiscoverable
at org.glassfish.jersey.model.internal.CommonConfig$2.compare(CommonConfig.java:594)
at java.util.TreeMap.put(Unknown Source)
at java.util.TreeSet.add(Unknown Source)
at java.util.AbstractCollection.addAll(Unknown Source)
at java.util.TreeSet.addAll(Unknown Source)
at org.glassfish.jersey.model.internal.CommonConfig.configureAutoDiscoverableProviders(CommonConfig.java:616)
at org.glassfish.jersey.server.ResourceConfig.configureAutoDiscoverableProviders(ResourceConfig.java:811)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:447)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184)
at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350)
at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255)
at org.glassfish.jersey.server.ApplicationHandler.(ApplicationHandler.java:347)
at org.glassfish.jersey.servlet.WebComponent.(WebComponent.java:392)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1238)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1041)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4996)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I had the exact same problem in Weblogic. It seems to be that the JacksonAutoDiscoverable and AutoDiscoverable came from different class loaders and therefore different versions. AutoDiscoverable exists in jersey-common and JacksonAutoDiscoverable exists in jersey-media-json-jackson.
I got around this by letting Weblogic have all the discoverable classes and instead specifying 'com.fasterxml.jackson.*' as prefer-application-packages/resources to have my own version of jackson.
I had this same problem, but I got a fix. There's an issue with conflicting dependencies. You've included the jersey-media-json-jackson dependency, but the Tomcat web container already provides those classes.
Just add the scope tag to your dependency:
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.27</version>
<scope>provided</scope>
</dependency>
Refer to the link for more information: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#
In my case I worked with Glassfish and I had the Glassfish descriptor (glassfish-web.xml) in the project as follow:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="false"/>
<parameter-encoding default-charset="UTF-8"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
</glassfish-web-app>
The class-loader property was marked with the attribute
delegate=false
, I think that was my mistake, because as Glassfish Deployment Guide say, this attribute must be true when you are exposing services.
https://javaee.github.io/glassfish/doc/4.0/application-deployment-guide.pdf#G11.1006531
The solution that worked for me was remove that file and keep only the Standard Deployment Descriptor(web.xml).
Hope this help.
I had this same problem with JBOSS6 server. After adding jersey-media-moxy dependency to pom file, it was worked.
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>2.25.1</version>
</dependency>
I solved the issue by adding both jersey-common and jersey-media-json-jackson. Removed jersey-bean-validation.
<dependency>
<artifactId>jersey-common</artifactId>
<groupId>org.glassfish.jersey.core</groupId>
<version>2.29.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.29.1</version>
</dependency>
<!--<dependency>
<artifactId>jersey-bean-validation</artifactId>
<groupId>org.glassfish.jersey.ext</groupId>
<version>2.29.1</version>
</dependency>-->

Cucucmber-Jvm (Using Maven Project) + Selenium WebDriver PageObjects + Allure Report

I am working on "Cucucmber-Jvm (Using Maven Project) + Selenium WebDriver PageObjects + Allure Report", I am unable generate "Allure" report.
Below are the codes, feature file, pom.xml, etc...
Pom.xml : Reference POM url - https://github.com/allure-framework/allure-cucumber-jvm-adaptor
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<name>Allure Cucumber-JVM Adaptor</name>
<artifactId>allure-cucumber-jvm-adaptor</artifactId>
<groupId>ru.yandex.qatools.allure</groupId>
<version>1.4-SNAPSHOT</version>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/allure-framework/allure-cucumber-jvm-adaptor</url>
<connection>scm:git#github.com:allure-framework/allure-cucumber-jvm-adaptor.git</connection>
<developerConnection>scm:git:git#github.com:allure-framework/allure-cucumber-jvm-adaptor.git</developerConnection>
</scm>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/allure-framework/allure-cucumber-jvm-adaptor/issues</url>
</issueManagement>
<ciManagement>
<system>TeamCity</system>
<url>http://teamcity.qatools.ru/</url>
</ciManagement>
<developers>
<developer>
<id>clicman</id>
<name>Viktor Sidochenko</name>
<email>viktor.sidochenko#gmail.com</email>
</developer>
</developers>
<mailingLists>
<mailingList>
<name>Allure Mailing List</name>
<post>allure#yandex-team.ru</post>
</mailingList>
</mailingLists>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<compiler.version>1.7</compiler.version>
<allure.version>1.4.5</allure.version>
<aspectj.version>1.8.4</aspectj.version>
</properties>
<dependencies>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-core</artifactId>
<version>${allure.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-java-aspects</artifactId>
<version>${allure.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-commons</artifactId>
<version>${allure.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>1.2.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.0</version>
<type>jar</type>
</dependency>
<!-- <dependency>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>9</version>
</dependency> -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.2</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.5</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<!-- parallel execution configuration -->
<parallel>classes</parallel>
<threadCount>8</threadCount>
<includes>
<include>**/*Test.java</include>
</includes>
<testFailureIgnore>false</testFailureIgnore>
<argLine>
-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
</argLine>
<properties>
<property>
<name>listener</name>
<value>ru.yandex.qatools.allure.cucumberjvm.AllureRunListener</value>
</property>
</properties>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Feature file location: src/test/resources and Name of the feature file: OpenAndclose.feature
Feature: OpenAndClose
Scenario: OpenAndClose Browser
Given user opened firefox browser
Then user entered url
Then user closed firefox browser
And codes at: src/test/java
TestRunner class:
package openANDclose;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
#RunWith(Cucumber.class)
#CucumberOptions(dryRun=false, monochrome = true, features= "src/test/resources/OpenAndclose.feature")
public class OpenAndClose_TestRunner {
}
Step Definitions:
package openANDclose;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
public class OpenAndClose_StepDefinitions {
public static WebDriver driver;
#Given("^user opened firefox browser$")
public void user_opened_firefox_browser() throws Throwable {
driver=new FirefoxDriver();
}
#Then("^user entered url$")
public void user_entered_url() throws Throwable {
OpenAndClose_PageObjects.user_opened_firefox_browser(driver);
}
#Then("^user closed firefox browser$")
public void user_closed_firefox_browser() throws Throwable {
OpenAndClose_PageObjects.user_closed_firefox_browser(driver);
}
}
Page Object Class:
package openANDclose;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class OpenAndClose_PageObjects {
public static WebDriver driver ;
public static WebElement element=null;
public static WebElement user_opened_firefox_browser(WebDriver driver) {
driver.get("http://google.co.in");
return element;
}
public static WebElement user_closed_firefox_browser(WebDriver driver) {
driver.quit();
return element;
}
}
After running "Allure" report from command prompt, getting below error message and error report.
Below report from: "mvn clean test" below error message is displaying.
D:\Cucumber_JVM_WorkSpace\Cucumber_Allure>mvn clean test
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-st
aging-maven-plugin
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Allure Cucumber-JVM Adaptor 1.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # allure-cucumber-jvm-ad
aptor ---
[INFO] Deleting D:\Cucumber_JVM_WorkSpace\Cucumber_Allure\target
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) # allure-cucumber-j
vm-adaptor ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # allure-cuc
umber-jvm-adaptor ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Cucumber_JVM_WorkSpace\Cucumber_Al
lure\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # allure-cucumber
-jvm-adaptor ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # al
lure-cucumber-jvm-adaptor ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # allure-
cucumber-jvm-adaptor ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to D:\Cucumber_JVM_WorkSpace\Cucumber_Allure\tar
get\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_StepDefinitions.java:[3,27] package org.openqa.selenium does not exis
t
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_StepDefinitions.java:[4,35] package org.openqa.selenium.firefox does
not exist
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_StepDefinitions.java:[11,23] cannot find symbol
symbol: class WebDriver
location: class openANDclose.OpenAndClose_StepDefinitions
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_PageObjects.java:[3,27] package org.openqa.selenium does not exist
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_PageObjects.java:[4,27] package org.openqa.selenium does not exist
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_PageObjects.java:[7,23] cannot find symbol
symbol: class WebDriver
location: class openANDclose.OpenAndClose_PageObjects
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_PageObjects.java:[9,23] cannot find symbol
symbol: class WebElement
location: class openANDclose.OpenAndClose_PageObjects
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_PageObjects.java:[11,62] cannot find symbol
symbol: class WebDriver
location: class openANDclose.OpenAndClose_PageObjects
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_PageObjects.java:[11,23] cannot find symbol
symbol: class WebElement
location: class openANDclose.OpenAndClose_PageObjects
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_PageObjects.java:[16,62] cannot find symbol
symbol: class WebDriver
location: class openANDclose.OpenAndClose_PageObjects
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_PageObjects.java:[16,23] cannot find symbol
symbol: class WebElement
location: class openANDclose.OpenAndClose_PageObjects
[ERROR] /D:/Cucumber_JVM_WorkSpace/Cucumber_Allure/src/test/java/openANDclose/Op
enAndClose_StepDefinitions.java:[15,36] cannot find symbol
symbol: class FirefoxDriver
location: class openANDclose.OpenAndClose_StepDefinitions
[INFO] 12 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.287 s
[INFO] Finished at: 2015-05-02T15:01:37+05:30
[INFO] Final Memory: 13M/33M
[INFO] ------------------------------------------------------------------------
Below report from: mvn site
About Allure Cucumber-JVM Adaptor
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Project not comliled successfully and not started. You should add webdriver dependencies to your project`s pom.xml.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.45.0</version>
</dependency>
Also you should not compile the adaptor itself. Use it as dependency to your project. See an example project: allure-cucumber-jvm-example.
Use example project as base and add selenium dependency to it and your code.