Spring-Data-Cassandra causes XSD validation error using XML configuration - cassandra

Heyy hello, I have some kind of error that won't affect on my project's compilation,deployment and running But it shows red mark at my configuration file for Spring-data-Cassandra also shows problem in problems menu.
Can any one please tell what's the issue?
I have seen same question related to spring-data-JPA and Spring-data-* but they are not helping so I am posting this one.
here is error message:-
The errors below were detected when validating the file "spring-tool.xsd" via the file "application-config.xml". In most cases these errors can be detected by validating "spring-tool.xsd" directly. However it is possible that errors will only occur when spring-tool.xsd is validated in the context of application-config.xml.
The errors below were detected when validating the file "spring-beans.xsd" via the file "application-config.xml". In most cases these errors can be detected by validating "spring-beans.xsd" directly. However it is possible that errors will only occur when spring-beans.xsd is validated in the context of application-config.xml.
Here is my config.xml file and pom file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:cassandra="http://www.springframework.org/schema/data/cassandra"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/cql
http://www.springframework.org/schema/cql/spring-cql.xsd
http://www.springframework.org/schema/data/cassandra
http://www.springframework.org/schema/data/cassandra/spring-cassandra.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
">
<!-- Uncomment and add your base-package here:
<context:component-scan
base-package="org.springframework.samples.service"/> -->
<!-- Loads the properties into the Spring Context and uses them to fill
in placeholders in the bean definitions -->
<context:property-placeholder location="classpath:/properties/database.properties" />
<!-- REQUIRED: The Cassandra Cluster -->
<cassandra:cluster contact-points="${cassandra.contactpoints}"
port="${cassandra.port}" />
<!-- REQUIRED: The Cassandra Session, built from the Cluster, and attaching
to a keyspace -->
<cassandra:session keyspace-name="${cassandra.keyspace}" />
<!-- REQUIRED: The Default Cassandra Mapping Context used by CassandraConverter -->
<cassandra:mapping />
<!-- REQUIRED: The Default Cassandra Converter used by CassandraTemplate -->
<cassandra:converter />
<!-- REQUIRED: The Cassandra Template is the building block of all Spring
Data Cassandra -->
<cassandra:template id="cassandraTemplate" />
</beans>
POM file
<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>org.springframework.samples.service.service</groupId>
<artifactId>XYZ</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<!-- Generic properties -->
<java.version>1.6</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Web -->
<jsp.version>2.2</jsp.version>
<jstl.version>1.2</jstl.version>
<servlet.version>2.5</servlet.version>
<!-- Spring -->
<spring-framework.version>4.0.0.RELEASE</spring-framework.version>
**<!-- I also try this one -->**
<!-- <spring-framework.version>3.2.8.RELEASE</spring-framework.version> -->
<!-- Logging -->
<logback.version>1.0.13</logback.version>
<slf4j.version>1.7.5</slf4j.version>
<!-- Test -->
<junit.version>4.11</junit.version>
</properties>
<dependencies>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<!-- Other Web dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>${jsp.version}</version>
<scope>provided</scope>
</dependency>
<!-- Spring and Transactions -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<!-- Logging with SLF4J & LogBack -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>runtime</scope>
</dependency>
<!-- Test Artifacts -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring-framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Cassandra Connectivity -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-cassandra</artifactId>
<version>1.2.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring-framework.version}</version>
</dependency>
</dependencies>
<repositories>
<!-- Spring Milestone -->
<repository>
<id>spring-milestone</id>
<name>Spring Maven MILESTONE Repository</name>
<url>http://repo.springsource.org/libs-milestone</url>
</repository>
</repositories>
</project>

Related

jaxb2-basics-annotate plugin migration to jaxb 3.0 and jakarta namespace

Years ago I have developed a maven archetype for creating a skeleton project that uses an xsd schema and a global.xjb to generate jaxb classes through xjc.
It is based on com.evolvedbinary.maven.jvnet:jaxb2-maven-plugin, org.jvnet.jaxb2_commons:jaxb2-basics-annotate (in order to add JacksonProperty annotations) and com.fillumina:krasa-jaxb-tools (to apply Bean Validation instead of jaxb schema validation)
I would like to refactor it in order to comply to the new JAXB 3.0 and in particular to the the jakarta namespace that has superseeded the old javax.
jaxb2-maven-plugin has a new version for that (jaxb30-maven-plugin). krasa-jaxb-tools got a new option validationAnnotations = ( jakarta | javax ).
And everything works fine except for annotations.
I couldn't find anything new for jaxb2-basics-annotate plugin.
Who knows if is there a new refactored version?
Also a org.jvnet.jaxb2_commons:jaxb2-basics could be useful, for generating equals method, etc.
Many thanks
UPDATE
This is the new pom with the use of the new plugins refactored by Rick O'Sullivan
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>jaxb-xjc-sample</artifactId>
<version>1.0-SNAPSHOT</version>
<name>jaxb-xjc-sample</name>
<description>Generate java classes from schema through xjc</description>
<properties>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<resources-dir>src/main/resources</resources-dir>
<jaxb-resources-dir>${resources-dir}/jaxb</jaxb-resources-dir>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<!-- jaxb3 -->
<jaxb-api.version>4.0.0</jaxb-api.version>
<!-- jaxb2 -->
<!-- <jaxb-api.version>2.3.1</jaxb-api.version> -->
<!-- jaxb3 -->
<jaxb-runtime.version>4.0.1</jaxb-runtime.version>
<!-- jaxb2 -->
<!-- <jaxb-runtime.version>2.3.7</jaxb-runtime.version> -->
<jackson.version>2.14.0</jackson.version>
<higherjaxb-maven-plugin.version>2.0.0</higherjaxb-maven-plugin.version>
<basicjaxb-plugins.version>2.0.0</basicjaxb-plugins.version>
<basicjaxb-runtime.version>2.0.0</basicjaxb-runtime.version>
<hyperjaxb-annox-plugin.version>2.0.0</hyperjaxb-annox-plugin.version>
<krasa-jaxb-tools.version>2.2</krasa-jaxb-tools.version>
<!-- jaxb3 -->
<validation-api.version>3.0.2</validation-api.version>
<!-- jaxb2 -->
<!-- <validation-api.version>2.0.1.Final</validation-api.version> -->
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<slf4j.version>2.0.4</slf4j.version>
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
<commons-utils.version>1.0.0</commons-utils.version>
<commons-logging.version>1.2</commons-logging.version>
</properties>
<dependencies>
<dependency>
<groupId>com.fsajeva.commons</groupId>
<artifactId>commons-utils</artifactId>
<version>${commons-utils.version}</version>
</dependency>
<!-- basicjaxb-runtime is needed by basicjaxb.plugins for some args, e.g. -Xequals
uncomment or comment this dependency in case of use -->
<dependency>
<groupId>org.patrodyne.jvnet</groupId>
<artifactId>hisrc-basicjaxb-runtime</artifactId>
<version>${basicjaxb-runtime.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- jaxb3 -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency>
<!-- jaxb2 -->
<!-- <dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency> -->
<!-- jaxb3 -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${jaxb-api.version}</version>
</dependency>
<!-- jaxb2 -->
<!-- <dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api.version}</version>
</dependency> -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb-runtime.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.patrodyne.jvnet</groupId>
<!-- jaxb3 -->
<artifactId>hisrc-higherjaxb30-maven-plugin</artifactId>
<!-- jaxb2 -->
<!-- <artifactId>hisrc-higherjaxb23-maven-plugin</artifactId> -->
<version>${higherjaxb-maven-plugin.version}</version>
<executions>
<execution>
<id>generate</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<extension>true</extension>
<args>
<arg>-Xannotate</arg>
<arg>-Xsetters</arg>
<arg>-Xsetters-mode=direct</arg>
<arg>-XJsr303Annotations</arg>
<!-- just comment this in case of jaxb2 as javax is the default value -->
<arg>-XJsr303Annotations:validationAnnotations=jakarta</arg>
</args>
<schemaDirectory>${jaxb-resources-dir}/xsd</schemaDirectory>
<schemaIncludes>
<include>books.xsd</include>
</schemaIncludes>
<bindingDirectory>${jaxb-resources-dir}/xjb</bindingDirectory>
<bindingIncludes>
<include>global.xjb</include>
</bindingIncludes>
<plugins>
<plugin>
<groupId>org.patrodyne.jvnet</groupId>
<artifactId>hisrc-basicjaxb-plugins</artifactId>
<version>${basicjaxb-plugins.version}</version>
</plugin>
<plugin>
<groupId>org.patrodyne.jvnet</groupId>
<artifactId>hisrc-hyperjaxb-annox-plugin</artifactId>
<version>${hyperjaxb-annox-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.fillumina</groupId>
<artifactId>krasa-jaxb-tools</artifactId>
<version>${krasa-jaxb-tools.version}</version>
</plugin>
</plugins>
</configuration>
<dependencies>
<!-- jaxb3 -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency>
<!-- jaxb2 -->
<!-- <dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency> -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- needed by Xsetters-mode=direct -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<parallel>methods</parallel>
<threadCount>10</threadCount>
</configuration>
</plugin>
</plugins>
</build>
</project>
Of course you have to modify your global.xjb accordingly
<?xml version="1.0" encoding="UTF-8"?>
<!-- jaxb3 -->
<jaxb:bindings version="3.0"
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
jaxb:extensionBindingPrefixes="annox"
xmlns:annox="http://jvnet.org/basicjaxb/xjc/annox">
<!-- jaxb2 -->
<!-- <jaxb:bindings version="2.1"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
jaxb:extensionBindingPrefixes="annox"
xmlns:annox="http://jvnet.org/basicjaxb/xjc/annox"> -->
Remember also to use at least version 3.8.4 of maven
Federico, my forks of the JAXB2 projects, originally developed by the admirable Alexey Valikov (a.k.a. Highsource), support JAXB 3.0 and in particular the jakarta namespace.
This project is a fork of org.jvnet.annox:annox-project:
org.patrodyne.jvnet:hisrc-basicjaxb-annox-parser-project:2.0.0
This project is a fork of org.jvnet.jaxb2_commons:jaxb2-annotate-plugin-project:
org.patrodyne.jvnet:hisrc-hyperjaxb-annox-plugin-project:2.0.0
Note: Review my projects' readme for changes to package names and namespaces. Plus, each readme has links for my forks of other Highsource projects, including hisrc-basicjaxb to generate hashCode, equals, toString methods, etc.

I am getting this error while running my runner class for Cucumber project. Error : java.lang.TypeNotPresentException: Type Cucumber not present

i have been trying to solve this issue for more than 3 days now, but did not find any luck, i am getting this error saying java.lang.TypeNotPresentException: Type Cucumber not present, i have changed version of my dependencies and tried consistent version of all cucumber dependencies, can anyone please help me on this issue?
Here is my runner file:
package Runner;
import org.junit.runner.RunWith;
enter code here
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
#RunWith(Cucumber.class)
#CucumberOptions(
features="features"
.glue= {"stepDefinition"}
)
public class TestRunner {
}
```
Here is my POM
<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>Freecrm.com</groupId>
<artifactId>Freecrm.com</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Freecrm.com</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<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>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-java -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.6</version>
<type>pom</type>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-core -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>1.2.6</version>
<type>pom</type>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-junit -->
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-junit -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.6</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-jvm -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<version>1.2.6</version>
<type>pom</type>
</dependency>
<!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting -->
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>1.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-jvm-deps -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm-deps</artifactId>
<version>1.0.5</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/gherkin -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.2</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven
defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>`enter code here`
</plugins>
</pluginManagement>
</build>
</project>
```
First of all, you are using really old versions of Cucumber; please use more recent versions so we can help you better. Second, you are using multiple different versions of Cucumber for different dependencies (Please don't do that as it will lead to unexpected problems). Third, you are adding dependencies that will be imported as transitive dependencies.
To help solve your problem:
Please check the Cucumber docs on how to install Cucumber-jvm for the dependencies you need and their latest version.
Make sure your dependencies are imported (you may have to refresh maven or enable auto-import in your IDE).

CDI error when attempting to create scaffold with JBoss Forge

I recently discovered this amazing tool Forge. Thanks to everybody involved in making it.I downloaded the latest version 3.7.2 and added the forge executable to my path.
All works very well apart from when I:
Want to setup JSF to use version 2.2, pressing tab after entering faces-setup yields no options at all. I would have hoped that it had an option like --version which could be set to 2.2 or 2.0 depending on the current code base requirement.
When I run scaffold-setup --provider Faces I get the following message:
[edsnext]$ scaffold-setup --provider Faces
***ERROR*** Could not install CDI.
***SUCCESS*** Scaffold was setup successfully.
Running cdi-setup gives exactly the same error.
What do I need to do to remedy this please?
EDIT: Below is the output from addon-list ran inside forge
Currently installed addons:
org.jboss.forge.addon:addon-manager,3.7.2.Final
org.jboss.forge.addon:addon-manager-spi,3.7.2.Final
org.jboss.forge.addon:addons,3.7.2.Final
org.jboss.forge.addon:angularjs,2.1.7.Final
org.jboss.forge.addon:bean-validation,3.7.2.Final
org.jboss.forge.addon:configuration,3.7.2.Final
org.jboss.forge.addon:convert,3.7.2.Final
org.jboss.forge.addon:core,3.7.2.Final
org.jboss.forge.addon:database-tools,3.7.2.Final
org.jboss.forge.addon:dependencies,3.7.2.Final
org.jboss.forge.addon:dev-tools-java,3.7.2.Final
org.jboss.forge.addon:environment,3.7.2.Final
org.jboss.forge.addon:facets,3.7.2.Final
org.jboss.forge.addon:git,3.7.2.Final
org.jboss.forge.addon:javaee,3.7.2.Final
org.jboss.forge.addon:javaee-spi,3.7.2.Final
org.jboss.forge.addon:maven,3.7.2.Final
org.jboss.forge.addon:parser-java,3.7.2.Final
org.jboss.forge.addon:parser-json,3.7.2.Final
org.jboss.forge.addon:parser-xml,3.7.2.Final
org.jboss.forge.addon:parser-yaml,3.7.2.Final
org.jboss.forge.addon:projects,3.7.2.Final
org.jboss.forge.addon:projects-generic,3.7.2.Final
org.jboss.forge.addon:resources,3.7.2.Final
org.jboss.forge.addon:rest-client,3.7.2.Final
org.jboss.forge.addon:scaffold,3.7.2.Final
org.jboss.forge.addon:scaffold-faces,3.7.2.Final
org.jboss.forge.addon:scaffold-spi,3.7.2.Final
org.jboss.forge.addon:script,3.7.2.Final
org.jboss.forge.addon:shell,3.7.2.Final
org.jboss.forge.addon:shell-spi,3.7.2.Final
org.jboss.forge.addon:slf4j,1.7.13
org.jboss.forge.addon:templates,3.7.2.Final
org.jboss.forge.addon:templates-spi,3.7.2.Final
org.jboss.forge.addon:testing,3.7.2.Final
org.jboss.forge.addon:text,3.7.2.Final
org.jboss.forge.addon:ui,3.7.2.Final
org.jboss.forge.addon:ui-spi,3.7.2.Final
org.jboss.forge.furnace.container:cdi,2.26.2.Final
org.jboss.forge.furnace.container:simple,2.26.2.Final
org.primefaces.forge:primefaces-forge-addon,1.0.0-SNAPSHOT
EDIT 2: POM file added.
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.megchemsa</groupId>
<artifactId>edsnext</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>${project.artifactId}</name>
<description>EDSNext</description>
<url>http://jsf-spec.java.net/</url>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<spec.snapshot.version>2.2</spec.snapshot.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.10.Final</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces.themes/all-themes -->
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.faces/jsf-api -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.faces/jsf-impl -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax/javaee-api -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.enterprise/cdi-api -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.el/javax.el-api -->
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.1-b04</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp.jstl/jstl-api -->
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.omnifaces/omnifaces -->
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>2.6.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.weld/weld-api -->
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-api</artifactId>
<version>3.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.weld/weld-core-impl -->
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-impl</artifactId>
<version>3.0.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.42</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>java.net-maven2-SNAPSHOT-repository</id>
<name>Java.net SNAPSHOT-Repository for Maven</name>
<url>https://maven.java.net/content/repositories/snapshots/</url>
<layout>default</layout>
</repository>
<repository>
<id>java.net-maven2-repository</id>
<name>Java.net Repository for Maven</name>
<url>https://maven.java.net/content/repositories/releases/</url>
<layout>default</layout>
</repository>
</repositories>
</project>
Here is the last portion of the log file:
22:23:49,032 WARNING [org.jboss.forge.addon.facets.FacetFactoryImpl] (AeshProcess: 1) Could not install Facet of type [class org.jboss.forge.addon.facets.AbstractFacet_$$_javassist_504eb0fa-7ec8-42a0-a843-69b4bf92ecc0], due to exception: : java.lang.NullPointerException
at org.jboss.forge.addon.javaee.cdi.CDIFacetImpl_1_1.isInstalled(CDIFacetImpl_1_1.java:78)
at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source) [:1.8.0_141]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_141]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_141]
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87) [furnace-proxy-2.26.2.Final.jar:2.26.2.Final]
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42) [furnace-api-2.26.2.Final.jar:2.26.2.Final]
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103) [furnace-proxy-2.26.2.Final.jar:2.26.2.Final]
at org.jboss.forge.addon.facets.AbstractFacet_$$_javassist_504eb0fa-7ec8-42a0-a843-69b4bf92ecc0.isInstalled(AbstractFacet_$$_javassist_504eb0fa-7ec8-42a0-a843-69b4bf92ecc0.java)
at org.jboss.forge.addon.facets.AbstractFaceted.install(AbstractFaceted.java:88) [facets-api-3.7.2.Final.jar:3.7.2.Final]
at org.jboss.forge.addon.facets.FacetFactoryImpl.install(FacetFactoryImpl.java:218) [facets-impl-3.7.2.Final.jar:3.7.2.Final]
at org.jboss.forge.addon.facets.FacetFactoryImpl.install(FacetFactoryImpl.java:145) [facets-impl-3.7.2.Final.jar:3.7.2.Final]
at org.jboss.forge.addon.facets.FacetFactoryImpl.install(FacetFactoryImpl.java:134) [facets-impl-3.7.2.Final.jar:3.7.2.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_141]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_141]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_141]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_141]
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87) [furnace-proxy-2.26.2.Final.jar:2.26.2.Final]
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42) [furnace-api-2.26.2.Final.jar:2.26.2.Final]
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103) [furnace-proxy-2.26.2.Final.jar:2.26.2.Final]
at org.jboss.forge.addon.facets.FacetFactoryImpl_$$_javassist_10c1990e-8260-440c-a497-def4fea52b20.install(FacetFactoryImpl_$$_javassist_10c1990e-8260-440c-a497-def4fea52b20.java) [facets-impl-3.7.2.Final.jar:3.7.2.Final]
at org.jboss.forge.addon.javaee.cdi.ui.CDISetupCommandImpl.execute(CDISetupCommandImpl.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_141]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_141]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_141]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_141]
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87) [furnace-proxy-2.26.2.Final.jar:2.26.2.Final]
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42) [furnace-api-2.26.2.Final.jar:2.26.2.Final]
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103) [furnace-proxy-2.26.2.Final.jar:2.26.2.Final]
at org.jboss.forge.addon.javaee.cdi.ui.CDISetupCommandImpl_$$_javassist_b78a036f-215f-4b81-ba53-6f3412fc1a6d.execute(CDISetupCommandImpl_$$_javassist_b78a036f-215f-4b81-ba53-6f3412fc1a6d.java)
at org.jboss.forge.addon.ui.impl.controller.SingleCommandControllerImpl.execute(SingleCommandControllerImpl.java:94)
at org.jboss.forge.addon.shell.aesh.CommandAdapter.execute(CommandAdapter.java:97)
at org.jboss.forge.addon.shell.aesh.ForgeCommandContainer.executeCommand(ForgeCommandContainer.java:88)
at org.jboss.aesh.console.AeshConsoleImpl$AeshConsoleCallbackImpl.execute(AeshConsoleImpl.java:311)
at org.jboss.aesh.console.AeshProcess.run(AeshProcess.java:53)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_141]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_141]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_141]
22:23:49,035 SEVERE [org.jboss.forge.addon.shell.aesh.CommandAdapter] (AeshProcess: 1) Could not install CDI.
Well, I set up a bare project via project-new using your group/artifact ids
then copied in your pom.xml. After running cdi-setup successfully, I've got a new version of the pom.
4 new dependencies are added:
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.interceptor</groupId>
<artifactId>jboss-interceptors-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
And a dependencyManagement section as well:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>3.0.3.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
Full, new pom.xml, post cdi-setup:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.megchemsa</groupId>
<artifactId>edsnext</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>${project.artifactId}</name>
<description>EDSNext</description>
<url>http://jsf-spec.java.net/</url>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<spec.snapshot.version>2.2</spec.snapshot.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.10.Final</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces.themes/all-themes -->
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.faces/jsf-api -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.faces/jsf-impl -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax/javaee-api -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.enterprise/cdi-api -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.1-b04</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.el/javax.el-api -->
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp.jstl/jstl-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>2.6.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.omnifaces/omnifaces -->
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-api</artifactId>
<version>3.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.weld/weld-api -->
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-impl</artifactId>
<version>3.0.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.weld/weld-core-impl -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.42</version>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.interceptor</groupId>
<artifactId>jboss-interceptors-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>java.net-maven2-SNAPSHOT-repository</id>
<name>Java.net SNAPSHOT-Repository for Maven</name>
<url>https://maven.java.net/content/repositories/snapshots/</url>
<layout>default</layout>
</repository>
<repository>
<id>java.net-maven2-repository</id>
<name>Java.net Repository for Maven</name>
<url>https://maven.java.net/content/repositories/releases/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>3.0.3.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
I suppose I'm unlikely to reproduce the issue as it would seem to be related to a previous operation forge has performed on your project. My bare project simply has the advantage of starting from scratch (and without code at that).
As mentioned in the comments above, we both have the same addons installed. I did a second run through project setup with my network interface down to ensure that cdi-setup wasn't reaching out over the network to fetch something that was blocked from your location - that said, it may have done so previously and cached it in my maven repository.
Hopefully this gets your across the hump or at least a little closer to figuring out the source of the problem. I haven't been able to dig up any similar issues to yours.
EDIT #1:
Well, org.jboss.forge.addon.javaee.cdi.CDIFacetImpl_1_1 hasn't changed since 2016, so I assume this code it to blame:
#Override
public boolean isInstalled()
{
boolean installed = super.isInstalled();
if (installed)
{
try
{
XMLResource xmlResource = (XMLResource) getConfigFile();
line 78-> installed = "1.1".equals(xmlResource.getXmlSource().getAttribute("version"));
}
catch (FileNotFoundException e)
{
installed = false;
}
}
return installed;
}
I don't know which config file is being fed down here, but it seems like your installation must be damaged somehow, or your Maven repository has a corrupt file. I haven't been able to remove any addons, so I can't suggest you try to reinstall the javaee plugin.
Maybe try to download the distribution again, unzip it in another directory and try running forge from there? I would also rename your ~/.forge to ~/.forge.bak. Also rm -r ~/.m2/repository/* for completeness.
Beyond that I'm out of ideas. Your next step would be to head over to the Forge Issues site, register, and repost there.

Exception in thread "main" java.lang.NoSuchMethodError: org.junit

I am trying to set up a cucumber framework for my project.
I am getting following error.Not sure if this is related to Junit versioning upgrade.
Exception in thread "main"``java.lang.NoSuchMethodError:org.junit.runner.Description.createSuiteDescription(Ljava/lang/String;Ljava/io/Serializable;[Ljava/lang/annotation/Annotation;)Lorg/junit/runner/Description;
at cucumber.runtime.junit.FeatureRunner.getDescription(FeatureRunner.java:43)
at cucumber.api.junit.Cucumber.describeChild(Cucumber.java:88)
My PoM.xml file looks like this
<?xml version="1.0" encoding="UTF-8"?>
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>Salesforce_CloudinIT</groupId>
<artifactId>SCIT</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-junit -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-java -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.4</version>
</dependency>
</dependencies>
enter code here
</project>

How to use CDI and JSF on Tomcat 8.5

I thought that it would be easy to replace JSF bean by CDI bean. But it's being a slow start. Very slow.
I'm using Tomcat 8.5 and JSF 2.2, and I'm trying to use CDI. I tried different configurations, with different results but nothing works, so, I follow the orientation in http://balusc.omnifaces.org/2013/10/how-to-install-cdi-in-tomcat.html and that's what I got.
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Workflow]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
My configurations are:
\META-INF\Context.xml
<!-- language: lang-html -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<Context reloadable="true">
<Resources cachingAllowed="true" cacheMaxSize="20000" />
<Resource
name="jdbc/FlowDB"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="xxxx"
password="xxxxxxxxxxx"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/flow?autoReconnect=true" />
<Resource
name="mail/Session"
auth="Container"
type="javax.mail.Session"
mail.smtp.host="localhost"
mail.smtp.port="25"
mail.smtp.auth="true"
mail.smtp.user="xxxxx#localhost"
mail.smtp.password="123456" />
<!-- Binding BeanManager to JNDI -->
<Resource
name="BeanManager"
auth="Container"
type="javax.enterprise.inject.spi.BeanManager"
factory="org.jboss.weld.resources.ManagerObjectFactory"/>
<!-- -->
</Context>
\WEB-INF\beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="annotated"
>
</beans>
Pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.2.10</version>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.4.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.3.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-validator -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<!-- <version>4.3.2.Final</version> -->
<version>5.2.4.Final</version>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
<scope>provided</scope>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- SPRING DATA JPA - https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.10.2.RELEASE</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.enterprise/cdi-api 'INFO: CDI #ViewScoped bean functionality unavailable' http://weld.cdi-spec.org/
-->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>2.3.5.Final</version>
</dependency>
<!-- Primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.3</version>
</dependency>
<!-- Primefaces Theme -->
<!-- https://mvnrepository.com/artifact/org.primefaces.extensions/all-themes -->
<dependency>
<groupId>org.primefaces.themes</groupId>
<!-- <artifactId>all-themes</artifactId> -->
<artifactId>bootstrap</artifactId>
<version>1.0.8</version>
</dependency>
<!-- Email -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>1.3.3</version>
</dependency>
<!-- JUnit ยป 4.12 -->
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<!-- slf4j-log4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.6.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars/font-awesome -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>4.6.3</version>
</dependency>
</dependencies>
I suspect that something may be wrong in my pom.xml, or with Tomcat 8.5, or with something else. But there is not much left...
Thank in advance.
SOLUTION
Seems that a library was missing, Java Annotation Indexer or Jandex, which I already tried before, but not at the right way obviously. Not the right set of libraries and/or not the right scope.
after apply this configurations
plus the dependency below
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>1.2.4.Final</version>
</dependency>
Seems to start working fine.
So, the relevant section of my POM.XML was:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>2.3.5.Final</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>1.2.4.Final</version>
</dependency>

Resources