How to generate TOC - docx4j

My Version:jkd11
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-JAXB-MOXy</artifactId>
<version>11.4.5</version>
</dependency>
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-export-fo</artifactId>
<version>11.4.5</version>
</dependency>
I try below code but throw Docx4JException,but the github demo just that https://github.com/plutext/docx4j/blob/docx4j-parent-11.1.0/docx4j-samples-docx4j/src/main/java/org/docx4j/samples/TocAdd.java
TocGenerator tocGenerator = new TocGenerator(word);
tocGenerator.generateToc(0,"TOC \\o \"1-3\" \\h \\z \\u ",false);
org.docx4j.toc.TocException: Exception exporting package
at org.docx4j.toc.TocGenerator.getPageNumbersMapViaFOP(TocGenerator.java:792)
at org.docx4j.toc.TocGenerator.getPageNumbersMap(TocGenerator.java:651)
at org.docx4j.toc.TocGenerator.populateToc(TocGenerator.java:398)
at org.docx4j.toc.TocGenerator.generateToc(TocGenerator.java:262)
at org.docx4j.toc.TocGenerator.generateToc(TocGenerator.java:230)
at org.docx4j.toc.TocGenerator.generateToc(TocGenerator.java:190)
at com.erayt.studio.business.word.BusWordCreate.createWord(BusWordCreate.java:106)
at com.erayt.studio.test.WordTest.lambda$test$0(WordTest.java:66)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Exception exporting package
at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:108)
at org.docx4j.Docx4J.toFO(Docx4J.java:710)
at org.docx4j.toc.TocGenerator.getPageNumbersMapViaFOP(TocGenerator.java:764)
... 14 more
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: You must invoke FORendererApacheFOP.getFOUserAgent
at org.docx4j.convert.out.fo.renderers.FORendererApacheFOP.render(FORendererApacheFOP.java:124)
at org.docx4j.convert.out.fo.AbstractFOExporter.postprocess(AbstractFOExporter.java:168)
at org.docx4j.convert.out.fo.AbstractFOExporter.postprocess(AbstractFOExporter.java:47)
at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:83)
... 16 more

This was fixed at https://github.com/plutext/docx4j/commit/50cfa5cabe08ab133f28c54b59f73d082d3e80a4 and will be in v11.4.6
In the meantime you could try an earlier release such as 8.3.2 or 11.3.2.

Related

Intellij not running Mockito test

I'm trying to run a suite of mockito tests, but every time I try to run it I get the following:
Exception in thread "main" java.lang.NoSuchMethodError: org.junit.platform.launcher.Launcher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;)V
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:61)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Process finished with exit code 1
From my research on here, I think I've narrowed down the problem to either be due to my version of Intellij (2017.1), the versions of the Junit and Mockito dependencies I'm importing with Maven, or a combination. The dependencies in my pom file are:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>2.21.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>1.2.0</version>
<scope>test</scope>
</dependency>
So far, I've tried clearing Intellij's cache, which had no effect, and have been trying different versions of the dependencies. If anyone could provide insight, I would greatly appreciate it. This has put a complete halt on my project.
Edit: After upgrading to Intellij 2018.1, I now get the following error instead:
java.lang.NoSuchMethodError: org.mockito.session.MockitoSessionBuilder.initMocks([Ljava/lang/Object;)Lorg/mockito/session/MockitoSessionBuilder;
at org.mockito.junit.jupiter.MockitoExtension.beforeEach(MockitoExtension.java:163)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachCallbacks$0(TestMethodTestDescriptor.java:129)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$203/967160.execute(Unknown Source)
at org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeMethodsOrCallbacksUntilExceptionOccurs(TestMethodTestDescriptor.java:155)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeEachCallbacks(TestMethodTestDescriptor.java:128)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:107)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:58)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:113)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$153/17987266.execute(Unknown Source)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:121)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$156/18668938.accept(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:121)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$153/17987266.execute(Unknown Source)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:121)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$156/18668938.accept(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:121)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$153/17987266.execute(Unknown Source)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:55)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
at org.junit.platform.launcher.core.DefaultLauncher$$Lambda$142/1020913.accept(Unknown Source)
at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Suppressed: java.lang.NullPointerException
at org.mockito.junit.jupiter.MockitoExtension.afterEach(MockitoExtension.java:211)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAfterEachCallbacks$11(TestMethodTestDescriptor.java:217)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$207/29255023.execute(Unknown Source)
at org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$13(TestMethodTestDescriptor.java:229)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$206/24882643.accept(Unknown Source)
at java.util.ArrayList.forEach(ArrayList.java:1234)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAllAfterMethodsOrCallbacks(TestMethodTestDescriptor.java:227)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAfterEachCallbacks(TestMethodTestDescriptor.java:216)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:119)
... 52 more
Process finished with exit code -1
Well, this is embarrassing. I forgot to add in mockito-core as a dependency. This error was resolved after I added the dependency for 5.2 into the pom file. I'm still getting an error due to it not being able to mock JdbcTemplate, but that is unrelated to this. I'm sorry for wasting anyone's time.

Errors resulting from upgrading my CXF version from 2.7.7 to 3.1.8

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.

ClassCastException: Lucene40PostingsFormat on Hibernate Search

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.

MSF4J micoservice trying to communicate with a SOAP service

I am trying to develop a microservice using MSF4J. The service gets the header details of the input request and try to communicate with a SOAP service for further operations. This logic when written as a normal application works fine but when converted to a microservice it throws the following the exception
[org.apache.axis2.context.AbstractContext] : OnDemandLogger initialized for class org.apache.axis2.context.AbstractContext is:org.apache.commons.logging.internal.JclLogger#6b972f62
[org.apache.axis2.util.Loader] : Trying to find [org/apache/axis2/deployment/axis2_default.xml] using sun.misc.Launcher$AppClassLoader#73d16e93 class loader.
2016-07-21 17:45:48 ERROR ChannelChunkResponder:103 - Resource method threw an exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:95)
at org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:53)
at org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:31)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at org.wso2.msf4j.internal.router.RequestRouter.channelRead0(RequestRouter.java:83)
at org.wso2.msf4j.internal.router.RequestRouter.channelRead0(RequestRouter.java:44)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoSuchMethodError: org.apache.axiom.om.OMAbstractFactory.getMetaFactory()Lorg/apache/axiom/om/OMMetaFactory;
at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:87)
at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:73)
at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:590)
at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:575)
at org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:97)
at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:91)
at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:887)
at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:210)
at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:150)
at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:143)
at org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub.<init>(OAuth2TokenValidationServiceStub.java:103)
at org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub.<init>(OAuth2TokenValidationServiceStub.java:89)
at com.wipro.oauth.manager.IDManagementClient.validateToken(IDManagementClient.java:220)
at com.wipro.oauth.manager.IdentityServerRest.getOAuthToken(IdentityServerRest.java:126)
... 37 more
The SOAP service, the microservice tries to communicate with is the "OAuth2TokenValidationService" of the WSO2 Identity Server.
The method the incorporates the call to the SAOP service is as follows
public OAuth2TokenValidationResponseDTO validateToken(
String accessTokenIdentifier)
throws RemoteException, LoginAuthenticationExceptionException {
OAuth2TokenValidationServiceStub stub = new OAuth2TokenValidationServiceStub(
null, server
+ "/services/OAuth2TokenValidationService");
ServiceClient e3 = stub._getServiceClient();
Options option3 = e3.getOptions();
HttpTransportProperties.Authenticator auth1 = new HttpTransportProperties.Authenticator();
auth1.setUsername(utUsername);
auth1.setPassword(utPassword);
auth1.setPreemptiveAuthentication(true);
option3.setManageSession(true);
/*option2.setProperty(Constants.Configuration.MESSAGE_TYPE,HTTPConstants.MEDIA_TYPE_APPLICATION_ECHO_XML);
option2.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,Boolean.TRUE);*/
option3.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, auth1);
/*option2.setProperty("Cookie", authCookie);*/
e3.setOptions(option3);
OAuth2TokenValidationRequestDTO oauthReq = new OAuth2TokenValidationRequestDTO();
OAuth2TokenValidationRequestDTO_OAuth2AccessToken accessToken = new OAuth2TokenValidationRequestDTO_OAuth2AccessToken();
accessToken.setTokenType("Bearer");
accessToken.setIdentifier(accessTokenIdentifier);
oauthReq.setAccessToken(accessToken);
oauthReq.setRequiredClaimURIs(null);
OAuth2TokenValidationResponseDTO resp = stub.validate(oauthReq);
return resp;
}
The following dependency has been added while converting the normal application to microservice.
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.transport</artifactId>
<version>5.0.0-alpha</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
The dependencies related to the AXIOM are
<dependency>
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
<artifactId>axiom</artifactId>
<version>1.2.11.wso2v4</version>
</dependency>
<dependency>
<groupId>org.apache.woden</groupId>
<artifactId>woden-impl-dom</artifactId>
<version>1.0M8</version>
</dependency>
Any help for resolving this issue will be greatly appreciated.
Can you please try with the latest MSF4J 2.0 release?
The root cause of this issue is: Caused by: java.lang.NoSuchMethodError: org.apache.axiom.om.OMAbstractFactory.getMetaFactory()Lorg/apache/axiom/om/OMMetaFactory;
What this means is, in the dependency tree, most probably another version of Axiom is getting pulled in as a transitive dependency.
Run; mvn dependency:tree and find out what other versions of Axiom are getting pulled in and exclude those version from the Maven build.

Adding Richfaces to a Maven Project being Deployed to JBoss AS 6

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. ;)