I'm having trouble with adding Richfaces to my Maven project, which is deploying to JBoss AS 6. Here 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>WyreBase</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Wyre Base</name>
<url>http://maven.apache.org</url>
<properties>
<jbossHome>/home/drew/Development/Servers/jboss/</jbossHome>
<arquillian.version>1.0.0.Alpha2</arquillian.version>
<org.richfaces.ui.version>4.0.0.20100715-M1</org.richfaces.ui.version>
</properties>
<repositories>
<repository>
<id>java.net2</id>
<name>Repository hosting the jee6 artifacts</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-bom</artifactId>
<version>${org.richfaces.ui.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Beta5</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Beta1</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.12</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-junit</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<jbossHome>${jbossHome}</jbossHome>
<serverName>default</serverName>
<fileName>target/${project.artifactId}.war</fileName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
<profiles>
<profile>
<id>jbossas-local-60</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-jbossas-local-60</artifactId>
<version>1.0.0.Alpha2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-server-manager</artifactId>
<version>1.0.3.GA</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<version>6.0.0.20100429-M3</version>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Here are the, hopefully, more relevant portions of the stack trace (too big to put it all in here.)
02:30:57,314 INFO [javax.enterprise.resource.webcontainer.jsf.config] Initializing Mojarra 2.0.2 (FCS b10) for context '/WyreBase'
02:30:57,831 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] Unable to process annotations for url, vfs:/home/drew/Development/Servers/jboss-6.0.0.20100429-M3/server/default/deploy/WyreBase.war/WEB-INF/lib/richfaces-core-impl-4.0.0.20100715-M1.jar/META-INF/initialization-listener.faces-config.xml. Reason: java.util.zip.ZipException: error in opening zip file
02:30:57,831 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] : java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method) [:1.6.0_18]
at java.util.zip.ZipFile.<init>(ZipFile.java:131) [:1.6.0_18]
at java.util.jar.JarFile.<init>(JarFile.java:150) [:1.6.0_18]
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:85) [:1.6.0_18]
at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:232) [:1.6.0_18]
at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_18]
at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:216) [:1.6.0_18]
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:68) [:1.6.0_18]
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:86) [:1.6.0_18]
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) [:1.6.0_18]
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) [:1.6.0_18]
at com.sun.faces.config.AnnotationScanner.processClasspath(AnnotationScanner.java:290) [:2.0.2-FCS]
at com.sun.faces.config.AnnotationScanner.getAnnotatedClasses(AnnotationScanner.java:215) [:2.0.2-FCS]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:765) [:2.0.2-FCS]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:736) [:2.0.2-FCS]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [:1.6.0_18]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [:1.6.0_18]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:329) [:2.0.2-FCS]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [:2.0.2-FCS]
at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:72) [:6.0.0.20100429-M3]
...more
02:30:57,842 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] Unable to process annotations for url, vfs:/home/drew/Development/Servers/jboss-6.0.0.20100429-M3/server/default/deploy/WyreBase.war/WEB-INF/lib/richfaces-components-ui-4.0.0.20100715-M1.jar/META-INF/behaviors-handler-delegate.faces-config.xml. Reason: java.util.zip.ZipException: error in opening zip file
02:30:57,843 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] : java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method) [:1.6.0_18]
at java.util.zip.ZipFile.<init>(ZipFile.java:131) [:1.6.0_18]
at java.util.jar.JarFile.<init>(JarFile.java:150) [:1.6.0_18]
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:85) [:1.6.0_18]
at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:232) [:1.6.0_18]
at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_18]
at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:216) [:1.6.0_18]
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:68) [:1.6.0_18]
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:86) [:1.6.0_18]
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) [:1.6.0_18]
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) [:1.6.0_18]
at com.sun.faces.config.AnnotationScanner.processClasspath(AnnotationScanner.java:290) [:2.0.2-FCS]
at com.sun.faces.config.AnnotationScanner.getAnnotatedClasses(AnnotationScanner.java:215) [:2.0.2-FCS]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:765) [:2.0.2-FCS]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:736) [:2.0.2-FCS]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [:1.6.0_18]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [:1.6.0_18]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:329) [:2.0.2-FCS]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [:2.0.2-FCS]
at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:72) [:6.0.0.20100429-M3]
...more
02:30:57,849 INFO [javax.enterprise.resource.webcontainer.jsf.config] Unsanitized stacktrace from failed start...: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305) [:2.0.2-FCS]
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:220) [:2.0.2-FCS]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:335) [:2.0.2-FCS]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [:2.0.2-FCS]
at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:72) [:6.0.0.20100429-M3]
...more
Caused by: javax.faces.FacesException: org.jboss.weld.integration.webtier.jsf.WeldApplicationFactory
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:593) [:2.0.2-FCS]
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:472) [:2.0.2-FCS]
at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139) [:2.0.2-FCS]
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:796) [:2.0.2-FCS]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306) [:2.0.2-FCS]
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [:2.0.2-FCS]
... 70 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_18]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [:1.6.0_18]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [:1.6.0_18]
at java.lang.reflect.Constructor.newInstance(Constructor.java:532) [:1.6.0_18]
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:586) [:2.0.2-FCS]
... 75 more
02:30:57,854 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WyreBase]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! argument type mismatch
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:354) [:2.0.2-FCS]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [:2.0.2-FCS]
at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:72) [:6.0.0.20100429-M3]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3733) [:6.0.0.20100429-M3]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4197) [:6.0.0.20100429-M3]
...more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_18]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [:1.6.0_18]
... more
02:30:57,858 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WyreBase]] Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.ClassCastException: com.sun.faces.config.WebConfiguration cannot be cast to com.sun.faces.config.WebConfiguration
at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:170) [:2.0.2-FCS]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:161) [:2.0.2-FCS]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3733) [:6.0.0.20100429-M3]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4197) [:6.0.0.20100429-M3]
... more
02:30:57,860 ERROR [org.apache.catalina.core.StandardContext] Error listenerStart
02:30:57,860 ERROR [org.apache.catalina.core.StandardContext] Context [/WyreBase] startup failed due to previous errors
02:30:57,863 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
You have several corrupted JARs that can't be opened, namely richfaces-core-impl-4.0.0.20100715-M1.jar and richfaces-components-ui-4.0.0.20100715-M1.jar. Try to delete them from your local repository and to redownload them.
Apparently this is a bug in JBossAS6.M3. https://jira.jboss.org/browse/JBAS-8024
Upgrading to JBossAS6.M4 solves the problem (but, naturally, introduces new ones. ;)
Related
Trying to run some tests on a Maven based project with Cucumber, Selenium and Java 8.
Launching o chrome works fine, but not in Firefox.
Throwing the following error when executing mvn clean install
io.github.bonigarcia.wdm.config.WebDriverManagerException: There was an error creating WebDriver object for Firefox
at io.github.bonigarcia.wdm.WebDriverManager.instantiateDriver(WebDriverManager.java:1774)
at io.github.bonigarcia.wdm.WebDriverManager.create(WebDriverManager.java:424)
at Hooks.WebDriverSingleton.Init(WebDriverSingleton.java:41)
at Hooks.Hooks.browserSetup(Hooks.java:16)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at io.github.bonigarcia.wdm.webdriver.WebDriverCreator.createLocalWebDriver(WebDriverCreator.java:64)
at io.github.bonigarcia.wdm.WebDriverManager.createLocalWebDriver(WebDriverManager.java:1948)
at io.github.bonigarcia.wdm.WebDriverManager.instantiateDriver(WebDriverManager.java:1763)
at io.github.bonigarcia.wdm.WebDriverManager.create(WebDriverManager.java:424)
at Hooks.WebDriverSingleton.Init(WebDriverSingleton.java:41)
at Hooks.Hooks.browserSetup(Hooks.java:16)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.cucumber.java.Invoker.doInvoke(Invoker.java:66)
at io.cucumber.java.Invoker.invokeStatic(Invoker.java:80)
at io.cucumber.java.AbstractGlueDefinition.invokeMethod(AbstractGlueDefinition.java:45)
at io.cucumber.java.JavaHookDefinition.execute(JavaHookDefinition.java:64)
at io.cucumber.core.runner.CoreHookDefinition.execute(CoreHookDefinition.java:46)
at io.cucumber.core.runner.HookDefinitionMatch.runStep(HookDefinitionMatch.java:21)
at io.cucumber.core.runner.ExecutionMode$1.execute(ExecutionMode.java:10)
at io.cucumber.core.runner.TestStep.executeStep(TestStep.java:85)
at io.cucumber.core.runner.TestStep.run(TestStep.java:57)
at io.cucumber.core.runner.TestCase.run(TestCase.java:78)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:75)
at io.cucumber.junit.PickleRunners$NoStepDescriptions.lambda$run$0(PickleRunners.java:151)
at io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:129)
at io.cucumber.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:148)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:144)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:28)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at io.cucumber.junit.FeatureRunner.run(FeatureRunner.java:137)
at io.cucumber.junit.Cucumber.runChild(Cucumber.java:196)
at io.cucumber.junit.Cucumber.runChild(Cucumber.java:89)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at io.cucumber.junit.Cucumber$RunBeforeAllHooks.evaluate(Cucumber.java:266)
at io.cucumber.junit.Cucumber$RunAfterAllHooks.evaluate(Cucumber.java:281)
at io.cucumber.junit.Cucumber$StartTestRun.evaluate(Cucumber.java:233)
at io.cucumber.junit.Cucumber$FinishTestRun.evaluate(Cucumber.java:248)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Root cause seem to be the following:
java.lang.NullPointerException
at Hooks.WebDriverSingleton.browserConfiguration(WebDriverSingleton.java:107)
at Hooks.WebDriverSingleton.Init(WebDriverSingleton.java:49)
at Hooks.Hooks.browserSetup(Hooks.java:16)
Where browser configuration is:
private static void browserConfiguration() {
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
}
This is where initialization of the driver is happening:
public static WebDriver Init(){
//browserOption = "CHROME";
browserOption = "FIREFOX";
if (driver == null) {
if(browserOption.equals("CHROME")){
// WebDriverManager.chromedriver().setup();
// driver = new ChromeDriver();
driver = WebDriverManager.chromedriver().create();
}
if(browserOption.equals("FIREFOX")){
driver = WebDriverManager.firefoxdriver().create();
}
else{
System.out.println("BROWSER NOT SUPPORTED");
}
}
browserConfiguration();
pageInitialization();
return driver;
}
And here is my pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>Testing-Demo1</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<username></username>
<password></password>
<browser></browser>
</properties>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
<dependencies>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.3.0</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java8 -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.8.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>7.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>
</project>
As mentioned, working perfectly fine with chromedriver but not with firefox driver. Have seen similar issues that were related with dependencies, but have been looking into it, and I can't find the cause.
Also tried with the following aproach, but getting a different error
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
but getting a different error
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:576)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:161)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:137)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:106)
at Hooks.WebDriverSingleton.Init(WebDriverSingleton.java:43)
at Hooks.Hooks.browserSetup(Hooks.java:16)
Caused by: org.openqa.selenium.WebDriverException: Driver server process died prematurely.
Build info: version: '4.1.2', revision: '9a5a329c5a'
System info: host: 'MRK-C02DP0Z6MD6V', ip: '192.168.1.103', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '12.6', java.version: '11.0.13'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:226)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:98)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:558)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:161)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:137)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:106)
at Hooks.WebDriverSingleton.Init(WebDriverSingleton.java:43)
at Hooks.Hooks.browserSetup(Hooks.java:16)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.cucumber.java.Invoker.doInvoke(Invoker.java:66)
at io.cucumber.java.Invoker.invokeStatic(Invoker.java:80)
at io.cucumber.java.AbstractGlueDefinition.invokeMethod(AbstractGlueDefinition.java:45)
at io.cucumber.java.JavaHookDefinition.execute(JavaHookDefinition.java:64)
at io.cucumber.core.runner.CoreHookDefinition.execute(CoreHookDefinition.java:46)
at io.cucumber.core.runner.HookDefinitionMatch.runStep(HookDefinitionMatch.java:21)
at io.cucumber.core.runner.ExecutionMode$1.execute(ExecutionMode.java:10)
at io.cucumber.core.runner.TestStep.executeStep(TestStep.java:85)
at io.cucumber.core.runner.TestStep.run(TestStep.java:57)
at io.cucumber.core.runner.TestCase.run(TestCase.java:78)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:75)
at io.cucumber.junit.PickleRunners$NoStepDescriptions.lambda$run$0(PickleRunners.java:151)
at io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:129)
at io.cucumber.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:148)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:144)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:28)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at io.cucumber.junit.FeatureRunner.run(FeatureRunner.java:137)
at io.cucumber.junit.Cucumber.runChild(Cucumber.java:196)
at io.cucumber.junit.Cucumber.runChild(Cucumber.java:89)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at io.cucumber.junit.Cucumber$RunBeforeAllHooks.evaluate(Cucumber.java:266)
at io.cucumber.junit.Cucumber$RunAfterAllHooks.evaluate(Cucumber.java:281)
at io.cucumber.junit.Cucumber$StartTestRun.evaluate(Cucumber.java:233)
at io.cucumber.junit.Cucumber$FinishTestRun.evaluate(Cucumber.java:248)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
I'm having troubles generating the initial changelog from the JPA Entities of my Spring-Boot project.
My pom.xml is as follows:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>eu.project</groupId>
<artifactId>organization</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>organization</name>
<description>Project Organization</description>
<properties>
<java.version>14</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--======================================== OAuth2 Resource Server ========================================-->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-jose</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-resource-server</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!--=============================================== Database ===============================================-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>3.8.9</version>
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate5</artifactId>
<version>3.8</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.8.9</version>
<configuration>
<propertyFile>./src/main/resources/database/liquibase/isolated/liquibase.properties</propertyFile>
</configuration>
<dependencies>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate5</artifactId>
<version>3.8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
and the following is the liquibase.properties file:
changeLogFile=src/main/resources/database/liquibase/isolated/master.xml
outputChangeLogFile=src/main/resources/database/liquibase/isolated/init.xml
url=hibernate:spring:eu.project.organization.domain.isolated?dialect=liquibase.ext.hibernate.database.HibernateGenericDialect
defaultSchemaName=public
driver=liquibase.ext.hibernate.database.connection.HibernateDriver
verbose=true
When I run the command
mvn liquibase:generateChangeLog -X
It keeps getting a NullPointerException on the catalogs of the DB [Full log on Pastebin]:
[DEBUG] com.datical.liquibase.ext.storedlogic.checkconstraint.postgres.PostgresCheckConstraintSnapshotGenerator matches liquibase.snapshot.SnapshotGenerator
[DEBUG] com.datical.liquibase.ext.storedlogic.trigger.postgres.PostgresTriggerSnapshotGenerator matches liquibase.snapshot.SnapshotGenerator
[DEBUG] Computed checksum for 1586893861875 as 5a982a4378e869d59b22108df3d2b645
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.192 s
[INFO] Finished at: 2020-04-14T21:51:01+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.8.9:generateChangeLog (default-cli) on project organization:
[ERROR] Error setting up or running Liquibase:
[ERROR] liquibase.command.CommandExecutionException: java.lang.NullPointerException
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.liquibase:liquibase-maven-plugin:3.8.9:generateChangeLog (default-cli) on project organization:
Error setting up or running Liquibase:
liquibase.command.CommandExecutionException: java.lang.NullPointerException
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException:
Error setting up or running Liquibase:
liquibase.command.CommandExecutionException: java.lang.NullPointerException
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute (AbstractLiquibaseMojo.java:405)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: java.lang.NullPointerException
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog (CommandLineUtils.java:289)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog (CommandLineUtils.java:258)
at org.liquibase.maven.plugins.LiquibaseGenerateChangeLogMojo.performLiquibaseTask (LiquibaseGenerateChangeLogMojo.java:122)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute (AbstractLiquibaseMojo.java:401)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: liquibase.command.CommandExecutionException: java.lang.NullPointerException
at liquibase.command.AbstractCommand.execute (AbstractCommand.java:24)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog (CommandLineUtils.java:287)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog (CommandLineUtils.java:258)
at org.liquibase.maven.plugins.LiquibaseGenerateChangeLogMojo.performLiquibaseTask (LiquibaseGenerateChangeLogMojo.java:122)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute (AbstractLiquibaseMojo.java:401)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.NullPointerException
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.getDatabaseCatalogNames (JdbcSnapshotGenerator.java:147)
at liquibase.snapshot.jvm.CatalogSnapshotGenerator.snapshotObject (CatalogSnapshotGenerator.java:35)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot (JdbcSnapshotGenerator.java:66)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot (SnapshotGeneratorChain.java:49)
at liquibase.snapshot.DatabaseSnapshot.include (DatabaseSnapshot.java:316)
at liquibase.snapshot.DatabaseSnapshot.init (DatabaseSnapshot.java:101)
at liquibase.snapshot.DatabaseSnapshot.<init> (DatabaseSnapshot.java:60)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init> (JdbcDatabaseSnapshot.java:39)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot (SnapshotGeneratorFactory.java:217)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot (SnapshotGeneratorFactory.java:190)
at liquibase.command.core.DiffCommand.createReferenceSnapshot (DiffCommand.java:229)
at liquibase.command.core.DiffCommand.createDiffResult (DiffCommand.java:151)
at liquibase.command.core.GenerateChangeLogCommand.run (GenerateChangeLogCommand.java:60)
at liquibase.command.AbstractCommand.execute (AbstractCommand.java:19)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog (CommandLineUtils.java:287)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog (CommandLineUtils.java:258)
at org.liquibase.maven.plugins.LiquibaseGenerateChangeLogMojo.performLiquibaseTask (LiquibaseGenerateChangeLogMojo.java:122)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute (AbstractLiquibaseMojo.java:401)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Apparently the changelog is being generated correcltly because it shows the computed checksum, but it fails in the end at
Caused by: java.lang.NullPointerException
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.getDatabaseCatalogNames (JdbcSnapshotGenerator.java:147)
How can I fix this problem in order to have it generating the changelog based on the JPA entities without having to use a real Database?
UPDATE
After adding
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
the error message changed and now it is:
Caused by: java.lang.ClassNotFoundException: Could not load requested class : eu.project.organization.domain.isolated.Employee
at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass (AggregatedClassLoader.java:210)
at java.lang.ClassLoader.loadClass (ClassLoader.java:588)
at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
at java.lang.Class.forName0 (Native Method)
at java.lang.Class.forName (Class.java:416)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName (ClassLoaderServiceImpl.java:130)
at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.<init> (AnnotationMetadataSourceProcessorImpl.java:109)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.<init> (MetadataBuildingProcess.java:155)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete (MetadataBuildingProcess.java:149)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata (EntityManagerFactoryBuilderImpl.java:900)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build (EntityManagerFactoryBuilderImpl.java:931)
at liquibase.ext.hibernate.database.HibernateEjb3Database.buildMetadataFromPath (HibernateEjb3Database.java:58)
at liquibase.ext.hibernate.database.HibernateDatabase.buildMetadata (HibernateDatabase.java:145)
at liquibase.ext.hibernate.database.HibernateDatabase.setConnection (HibernateDatabase.java:85)
at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation (DatabaseFactory.java:129)
at liquibase.database.DatabaseFactory.openDatabase (DatabaseFactory.java:149)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject (CommandLineUtils.java:97)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject (CommandLineUtils.java:67)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute (AbstractLiquibaseMojo.java:349)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Finally got it working by adding the Bean Validation API & Javassist dependencies to the liquibase plugin.
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.8.9</version>
<configuration>
<propertyFile>./src/main/resources/database/liquibase/isolated/liquibase.properties</propertyFile>
</configuration>
<dependencies>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate5</artifactId>
<version>3.8</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.27.0-GA</version>
</dependency>
</dependencies>
</plugin>
The liquibase.properties file is as follows:
changeLogFile=src/main/resources/database/liquibase/isolated/master.xml
outputChangeLogFile=src/main/resources/database/liquibase/isolated/init.xml
url=hibernate:spring:eu.project.organization.domain.isolated?dialect=liquibase.ext.hibernate.database.HibernateGenericDialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
driver=liquibase.ext.hibernate.database.connection.HibernateDriver
Now, running the command mvn liquibase:generateChangeLog correctly generates the initial changelog in the init.xml file.
pom.xml
<cxf.core>3.1.8</cxf.core>
<cxf.version>3.1.8</cxf.version>
<jsr311.api.version>1.1.1</jsr311.api.version> <javax.ws.rs.api.version>2.0.1</javax.ws.rs.api.version>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1.14</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.1.14</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.1.14</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>${javax.ws.rs.api.version}</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>${jsr311.api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>${cxf.core}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
<exclusions>
<exclusion>
<artifactId>cxf-common-utilities</artifactId>
<groupId>org.apache.cxf</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
<exclusions>
<exclusion>
<artifactId>cxf-common-utilities</artifactId>
<groupId>org.apache.cxf</groupId>
</exclusion>
</exclusions>
</dependency>
Exception is :
WARN:2017-07-27 17:19:37.903:localhost-startStop-1:"Exception encountered during context initialization - cancelling refresh attempt":org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'caServiceClient' defined in URL [jar:file:/Users/vn0kt7d/Documents/workspace-checkout1/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/checkoutservice/WEB-INF/lib/checkout-adapter-1.0.0.75-SNAPSHOT.jar!/environmentConfig/default/customer-account-client.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'caServiceClient' defined in URL [jar:file:/Users/vn0kt7d/Documents/workspace-checkout1/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/checkoutservice/WEB-INF/lib/checkout-adapter-1.0.0.75-SNAPSHOT.jar!/environmentConfig/default/customer-account-client.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at com.walmart.platform.scm.client.execution.ScmServletContextListener.configureAndRefreshWebApplicationContext(ScmServletContextListener.java:87)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
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:748)
Caused by java.lang.NoClassDefFoundError: org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean
at com.walmart.platform.soa.client.AbstractJAXRSClient.getJAXRSBean(AbstractJAXRSClient.java:360)
at com.walmart.platform.soa.client.AbstractJAXRSClient.getProxy(AbstractJAXRSClient.java:275)
at com.walmart.platform.soa.client.annotation.SOAClientAnnotationProcessor.wireJAXRSClient(SOAClientAnnotationProcessor.java:464)
at com.walmart.platform.soa.client.annotation.SOAClientAnnotationProcessor.wireSOAClient(SOAClientAnnotationProcessor.java:89)
at com.walmart.platform.soa.client.annotation.SOAClientAnnotationProcessor.access$000(SOAClientAnnotationProcessor.java:42)
at com.walmart.platform.soa.client.annotation.SOAClientAnnotationProcessor$1.doWith(SOAClientAnnotationProcessor.java:65)
at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:605)
at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:585)
at com.walmart.platform.soa.client.annotation.SOAClientAnnotationProcessor.postProcessAfterInstantiation(SOAClientAnnotationProcessor.java:58)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1172)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
... 20 more
Caused by java.lang.ClassNotFoundException: org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
... 31 more
FYI, I have added JaxB-Impl dependency explicitly because:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'example': Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: REFLECTION
What is the root cause for this issue?
You should add cxf-rt-rs-client as dependency.
Moreover I would drop the jsr311 api and use the 2.0 one instead.
I am trying using Hibernate-Search for add full text search capabilities but when i try deploy the ear proyect on glashfish application server i get the Lucene40PostingsFormat classCastException.
here it is the complete server log:
Información: HHH000412: Hibernate Core {[WORKING]}
Información: HHH000206: hibernate.properties not found
Información: HHH000021: Bytecode provider name : javassist
Información: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
Información: HHH000400: Using dialect: org.hibernate.dialect.DerbyDialect
WARN: HHH000430: The DerbyDialect dialect has been deprecated; use one of the version-specific dialects instead
Información: HSEARCH000034: Hibernate Search 5.5.4.Final
Información: HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl#50ae9aef'
Grave: java.lang.ExceptionInInitializerError
at org.apache.lucene.codecs.PostingsFormat.forName(PostingsFormat.java:112)
at org.apache.lucene.codecs.lucene40.Lucene40Codec.<init>(Lucene40Codec.java:115)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:67)
at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:45)
at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:37)
at org.apache.lucene.codecs.Codec$Holder.<clinit>(Codec.java:47)
at org.apache.lucene.codecs.Codec.getDefault(Codec.java:140)
at org.apache.lucene.index.LiveIndexWriterConfig.<init>(LiveIndexWriterConfig.java:120)
at org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:140)
at org.hibernate.search.store.spi.DirectoryHelper.initializeIndexIfNeeded(DirectoryHelper.java:54)
at org.hibernate.search.store.impl.DirectoryProviderHelper.createFSIndex(DirectoryProviderHelper.java:128)
at org.hibernate.search.store.impl.FSDirectoryProvider.initialize(FSDirectoryProvider.java:53)
at org.hibernate.search.store.spi.BaseDirectoryProviderService.initialize(BaseDirectoryProviderService.java:64)
at org.hibernate.search.store.spi.BaseDirectoryProviderService.create(BaseDirectoryProviderService.java:52)
at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.createDirectoryProvider(DirectoryBasedIndexManager.java:230)
at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:90)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:256)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:513)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:482)
at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:91)
at org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchIntegratorBuilder.java:358)
at org.hibernate.search.spi.SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:199)
at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:117)
at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:75)
at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:364)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:490)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:878)
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:151)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)
at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:309)
at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:88)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:155)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:152)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:232)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:241)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:267)
at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:152)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(Abstra
Grave: ctThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: class org.apache.lucene.codecs.lucene40.Lucene40PostingsFormat
at java.lang.Class.asSubclass(Class.java:3404)
at org.apache.lucene.util.SPIClassIterator.next(SPIClassIterator.java:141)
at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:65)
at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:47)
at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:37)
at org.apache.lucene.codecs.PostingsFormat$Holder.<clinit>(PostingsFormat.java:49)
... 89 more
Grave: Exception while preparing the app
Grave: Exception during lifecycle processing
java.lang.ExceptionInInitializerError
at org.apache.lucene.codecs.PostingsFormat.forName(PostingsFormat.java:112)
at org.apache.lucene.codecs.lucene40.Lucene40Codec.<init>(Lucene40Codec.java:115)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:67)
at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:45)
at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:37)
at org.apache.lucene.codecs.Codec$Holder.<clinit>(Codec.java:47)
at org.apache.lucene.codecs.Codec.getDefault(Codec.java:140)
at org.apache.lucene.index.LiveIndexWriterConfig.<init>(LiveIndexWriterConfig.java:120)
at org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:140)
at org.hibernate.search.store.spi.DirectoryHelper.initializeIndexIfNeeded(DirectoryHelper.java:54)
at org.hibernate.search.store.impl.DirectoryProviderHelper.createFSIndex(DirectoryProviderHelper.java:128)
at org.hibernate.search.store.impl.FSDirectoryProvider.initialize(FSDirectoryProvider.java:53)
at org.hibernate.search.store.spi.BaseDirectoryProviderService.initialize(BaseDirectoryProviderService.java:64)
at org.hibernate.search.store.spi.BaseDirectoryProviderService.create(BaseDirectoryProviderService.java:52)
at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.createDirectoryProvider(DirectoryBasedIndexManager.java:230)
at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:90)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:256)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:513)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:482)
at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:91)
at org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchIntegratorBuilder.java:358)
at org.hibernate.search.spi.SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:199)
at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:117)
at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:75)
at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:364)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:490)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:878)
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:151)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)
at org.glassfish.javaee.full.deployment.EarDeployer.prepare
the dependencies on the pom file for ejb modules are the following:
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.2.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
<version>5.5.4.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.0.9.Final</version>
</dependency>
</dependencies>
if I exclude the artifact lucene-backward-codecs on hibernate-search artifact I get the error:
java.lang.ClassCastException: class org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
<version>${hibernate.search.version}</version>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-backward-codecs</artifactId>
</exclusion>
</exclusions>
</dependency>
The persistence unit configuration is the following:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="ejercicio4_PU" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/books</jta-data-source>
<class>models.Book</class>
<class>models.Author</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.search.lucene_version" value="LUCENE_CURRENT"/>
<property name="hibernate.search.default.directory_provider" value="filesystem"/>
<property name="hibernate.search.default.indexBase" value="./lucene/indexes"/>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.SunOneJtaPlatform"/>
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
</properties>
</persistence-unit>
</persistence>
I used the plugin-finder duplicate-maven-plugin
to find to find possible diferent versions of lucene
<plugin>
<groupId>com.ning.maven.plugins</groupId>
<artifactId>maven-duplicate-finder-plugin</artifactId>
<version>1.0.8</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
This is an excerpt of the result obtained to build the project:
Checking compile classpath
Found duplicate and different classes in [javax:javaee-api:7.0,org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final] :
javax.persistence.Access
javax.persistence.AccessType
javax.persistence.AssociationOverride
javax.persistence.AssociationOverrides
javax.persistence.AttributeConverter
javax.persistence.AttributeNode
javax.persistence.AttributeOverride
javax.persistence.AttributeOverrides
javax.persistence.Basic
javax.persistence.Cache
javax.persistence.CacheRetrieveMode
javax.persistence.CacheStoreMode
javax.persistence.Cacheable
javax.persistence.CascadeType
javax.persistence.CollectionTable
javax.persistence.Column
javax.persistence.ColumnResult
javax.persistence.ConstraintMode
javax.persistence.ConstructorResult
javax.persistence.Convert
javax.persistence.Converter
javax.persistence.Converts
javax.persistence.DiscriminatorColumn
javax.persistence.DiscriminatorType
javax.persistence.DiscriminatorValue
javax.persistence.ElementCollection
javax.persistence.Embeddable
javax.persistence.Embedded
javax.persistence.EmbeddedId
javax.persistence.Entity
javax.persistence.EntityExistsException
javax.persistence.EntityGraph
javax.persistence.EntityListeners
javax.persistence.EntityManager
javax.persistence.EntityManagerFactory
javax.persistence.EntityNotFoundException
javax.persistence.EntityResult
javax.persistence.EntityTransaction
javax.persistence.EnumType
javax.persistence.Enumerated
javax.persistence.ExcludeDefaultListeners
javax.persistence.ExcludeSuperclassListeners
javax.persistence.FetchType
javax.persistence.FieldResult
javax.persistence.FlushModeType
javax.persistence.ForeignKey
javax.persistence.GeneratedValue
javax.persistence.GenerationType
javax.persistence.Id
javax.persistence.IdClass
javax.persistence.Index
javax.persistence.Inheritance
javax.persistence.InheritanceType
javax.persistence.JoinColumn
javax.persistence.JoinColumns
javax.persistence.JoinTable
javax.persistence.Lob
javax.persistence.LockModeType
javax.persistence.LockTimeoutException
javax.persistence.ManyToMany
javax.persistence.ManyToOne
javax.persistence.MapKey
javax.persistence.MapKeyClass
javax.persistence.MapKeyColumn
javax.persistence.MapKeyEnumerated
javax.persistence.MapKeyJoinColumn
javax.persistence.MapKeyJoinColumns
javax.persistence.MapKeyTemporal
javax.persistence.MappedSuperclass
javax.persistence.MapsId
javax.persistence.NamedAttributeNode
javax.persistence.NamedEntityGraph
javax.persistence.NamedEntityGraphs
javax.persistence.NamedNativeQueries
javax.persistence.NamedNativeQuery
javax.persistence.NamedQueries
javax.persistence.NamedQuery
javax.persistence.NamedStoredProcedureQueries
javax.persistence.NamedStoredProcedureQuery
javax.persistence.NamedSubgraph
javax.persistence.NoResultException
javax.persistence.NonUniqueResultException
javax.persistence.OneToMany
javax.persistence.OneToOne
javax.persistence.OptimisticLockException
javax.persistence.OrderBy
javax.persistence.OrderColumn
javax.persistence.Parameter
javax.persistence.ParameterMode
javax.persistence.Persistence
javax.persistence.PersistenceContext
javax.persistence.PersistenceContextType
javax.persistence.PersistenceContexts
javax.persistence.PersistenceException
javax.persistence.PersistenceProperty
javax.persistence.PersistenceUnit
javax.persistence.PersistenceUnitUtil
javax.persistence.PersistenceUnits
javax.persistence.PersistenceUtil
javax.persistence.PessimisticLockException
javax.persistence.PessimisticLockScope
javax.persistence.PostLoad
javax.persistence.PostPersist
javax.persistence.PostRemove
javax.persistence.PostUpdate
javax.persistence.PrePersist
javax.persistence.PreRemove
javax.persistence.PreUpdate
javax.persistence.PrimaryKeyJoinColumn
javax.persistence.PrimaryKeyJoinColumns
javax.persistence.Query
javax.persistence.QueryHint
javax.persistence.QueryTimeoutException
javax.persistence.RollbackException
javax.persistence.SecondaryTable
javax.persistence.SecondaryTables
javax.persistence.SequenceGenerator
javax.persistence.SharedCacheMode
javax.persistence.SqlResultSetMapping
javax.persistence.SqlResultSetMappings
javax.persistence.StoredProcedureParameter
javax.persistence.StoredProcedureQuery
javax.persistence.Subgraph
javax.persistence.SynchronizationType
javax.persistence.Table
javax.persistence.TableGenerator
javax.persistence.Temporal
javax.persistence.TemporalType
javax.persistence.TransactionRequiredException
javax.persistence.Transient
javax.persistence.Tuple
javax.persistence.TupleElement
javax.persistence.TypedQuery
javax.persistence.UniqueConstraint
javax.persistence.ValidationMode
javax.persistence.Version
javax.persistence.criteria.AbstractQuery
javax.persistence.criteria.CollectionJoin
javax.persistence.criteria.CommonAbstractCriteria
javax.persistence.criteria.CompoundSelection
javax.persistence.criteria.CriteriaBuilder
javax.persistence.criteria.CriteriaDelete
javax.persistence.criteria.CriteriaQuery
javax.persistence.criteria.CriteriaUpdate
javax.persistence.criteria.Expression
javax.persistence.criteria.Fetch
javax.persistence.criteria.FetchParent
javax.persistence.criteria.From
javax.persistence.criteria.Join
javax.persistence.criteria.JoinType
javax.persistence.criteria.ListJoin
javax.persistence.criteria.MapJoin
javax.persistence.criteria.Order
javax.persistence.criteria.ParameterExpression
javax.persistence.criteria.Path
javax.persistence.criteria.PluralJoin
javax.persistence.criteria.Predicate
javax.persistence.criteria.Root
javax.persistence.criteria.Selection
javax.persistence.criteria.SetJoin
javax.persistence.criteria.Subquery
javax.persistence.metamodel.Attribute
javax.persistence.metamodel.BasicType
javax.persistence.metamodel.Bindable
javax.persistence.metamodel.CollectionAttribute
javax.persistence.metamodel.EmbeddableType
javax.persistence.metamodel.EntityType
javax.persistence.metamodel.IdentifiableType
javax.persistence.metamodel.ListAttribute
javax.persistence.metamodel.ManagedType
javax.persistence.metamodel.MapAttribute
javax.persistence.metamodel.MappedSuperclassType
javax.persistence.metamodel.Metamodel
javax.persistence.metamodel.PluralAttribute
javax.persistence.metamodel.SetAttribute
javax.persistence.metamodel.SingularAttribute
javax.persistence.metamodel.StaticMetamodel
javax.persistence.metamodel.Type
javax.persistence.spi.ClassTransformer
javax.persistence.spi.LoadState
javax.persistence.spi.PersistenceProvider
javax.persistence.spi.PersistenceProviderResolver
javax.persistence.spi.PersistenceProviderResolverHolder
javax.persistence.spi.PersistenceUnitInfo
javax.persistence.spi.PersistenceUnitTransactionType
javax.persistence.spi.ProviderUtil
I am using Glassfish server 4.1 and Netbeans 8.0.2.
I hope someone can help me, thanks.
The error you have is the result of attempting to open a Lucene index written by Apache Lucene version 4.0.x.
If you are migrating an application using an older version of Hibernate Search which was using Lucene 4, then I'd suggest to delete the index and rebuild it using the MassIndexer.
If you need to read the old index format for any reason, you can add the following dependency to your application to be able to read it:
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-backward-codecs</artifactId>
<version>5.3.1</version>
</dependency>
Also - unrelated but will cause you trouble - I see you have set hibernate-core and hibernate-entitymanager to two different versions: never do this!
Since Hibernate Search is not yet compatible with Hibernate ORM 5.2.x, I'd suggest to set both versions to 5.1.1.Final, which are compatible with Hibernate Search 5.5.4.Final.
Getting a com.thoughtworks.qdox.parser.ParseException when building my project. This error first occurred when I changed:
<packaging>jar</packaging>
to:
<packaging>maven-plugin</packaging>
Before that, the entire project built and ran cleanly. maven-plugin-api is the newest version available in maven, so upgrading per "GWT, Maven, Spring - Getting com.thoughtworks.qdox.parser.ParseException: syntax error on Maven Build" won't work. I've also tried downgrading; no change.
The exception:
com.thoughtworks.qdox.parser.ParseException: syntax error #[38,1] in file:/home/blablahbla/MyClass.java
at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:716)
at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:826)
at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:697)
at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:300)
at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:316)
at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:312)
at com.thoughtworks.qdox.JavaDocBuilder$1.visitFile(JavaDocBuilder.java:369)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:43)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:52)
at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:366)
at org.apache.maven.tools.plugin.extractor.java.JavaMojoDescriptorExtractor.discoverClasses(JavaMojoDescriptorExtractor.java:628)
at org.apache.maven.tools.plugin.extractor.java.JavaMojoDescriptorExtractor.execute(JavaMojoDescriptorExtractor.java:592)
at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:105)
at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:171)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
The pom file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo.bar</groupId>
<artifactId>foobar</artifactId>
<packaging>maven-plugin</packaging>
<version>1.0.1</version>
<name>foobar</name>
<properties>
<org.springframework.version>3.1.0.M1</org.springframework.version>
<org.hibernate.version>3.6.0.Final</org.hibernate.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${org.hibernate.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.1.0.7.0</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.0-801.jdbc4</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>foo.bar.internal</groupId>
<artifactId>internal-artifact</artifactId>
<version>0.1.9-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
</project>
The class in question:
import javax.persistence.*;
#Table(name = "MY_TABLE")
#SecondaryTables({
#SecondaryTable(name = "MY_TABLE2"),
#SecondaryTable(name = "MY_TABLE3"),
#SecondaryTable(name = "MY_TABLE4")
})
#Entity
#NamedQueries({
...
})
#AttributeOverrides({ // line 37
// #AttributeOverride( //line 38
// name = "metadataCheckOutFlag",
// column = #Column(
// name = "COMMENTED_OUT_FIELD",
// table = "MY_TABLE2"
// )
// ),
})
public class MyClass extends SimpleMyClass {
}
All JPA annotations have previously functioned without issue.
Well, it turns out I had an older version of another maven plugin, the maven-compiler-plugin. When I upgraded it to versino 2.3.2, a new version of the qdox library was downloaded and my problems disappeared, even when I tested downgrading to 2.0.2 again. Relevant section of pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>