NoClassDefFoundError JPA休眠搜索-orm

时间:2018-12-19 10:07:51

标签: hibernate maven jpa noclassdeffounderror

我想在我的项目中使用hibernate-search-orm来获得更好/更快的搜索结果(抱歉,奇怪的一句话)。

但是在我的Maven中添加依赖项时,在部署过程中出现以下奇怪的错误。我没有在代码中添加任何其他内容,并且在删除依赖项时,一切都像以前一样工作。

09:17:54,126 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 11) MSC000001: Failed to start service jboss.persistenceunit.objektstamm#production: org.jboss.msc.service.StartException in service jboss.persistenceunit.objektstamm#production: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
    at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:73)
    at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:530)
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879)
    at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154)
    ... 7 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataProvider from [Module "deployment.objektstamm.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
    ... 14 more

09:17:54,129 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 3) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "objektstamm")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.objektstamm#production" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.objektstamm#production: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
    Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
    Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataProvider from [Module \"deployment.objektstamm.war:main\" from Service Module Loader]"}}
09:17:54,131 ERROR [org.jboss.as.server] (management-handler-thread - 3) WFLYSRV0021: Deploy of deployment "objektstamm.war" was rolled back with the following failure message: 
{"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.objektstamm#production" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.objektstamm#production: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
    Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
    Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataProvider from [Module \"deployment.objektstamm.war:main\" from Service Module Loader]"}}
09:17:54,139 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 11) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'objektstamm#production'
09:17:54,184 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment objektstamm (runtime-name: objektstamm.war) in 53ms
09:17:54,187 INFO  [org.jboss.as.controller] (management-handler-thread - 3) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.deployment.unit."objektstamm.war".WeldBootstrapService (missing) dependents: [service jboss.deployment.unit."objektstamm.war".component.TxtpopDao.WeldInstantiator, service jboss.deployment.unit."objektstamm.war".component."com.sun.faces.config.ConfigureListener".WeldInstantiator, service jboss.deployment.unit."objektstamm.war".component.ListapDao.WeldInstantiator, service jboss.deployment.unit."objektstamm.war".component.BogdapDao.WeldInstantiator, WFLYCTL0208: ... and 6 more ] 
      service jboss.deployment.unit."objektstamm.war".WeldStartService (missing) dependents: [service jboss.deployment.unit."objektstamm.war".component.TxtpopDao.WeldInstantiator, service jboss.deployment.unit."objektstamm.war".component.TobjepDao.WeldInstantiator, service jboss.deployment.unit."objektstamm.war".component."com.sun.faces.config.ConfigureListener".WeldInstantiator, service jboss.deployment.unit."objektstamm.war".component.ListapDao.WeldInstantiator, WFLYCTL0208: ... and 8 more ] 
      [...]
                service jboss.deployment.unit."objektstamm.war".moduleDeploymentRuntimeInformation (missing) dependents: [service jboss.deployment.unit."objektstamm.war".moduleDeploymentRuntimeInformationStart, service jboss.deployment.unit."objektstamm.war".component.ObhvwpDao.START, service jboss.deployment.unit."objektstamm.war".component.StfidpDao.START, service jboss.deployment.unit."objektstamm.war".component.ObjstatlavDao.START, WFLYCTL0208: ... and 2 more ] 
      service jboss.persistenceunit.objektstamm#production (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./objektstamm, service jboss.deployment.unit."objektstamm.war".component.ObfvwpDao.START, service jboss.deployment.unit."objektstamm.war".component."javax.faces.webapp.FacesServlet".START, service jboss.deployment.unit."objektstamm.war".component.ObjstabpDao.START, WFLYCTL0208: ... and 18 more ] 
      service jboss.undertow.deployment.default-server.default-host./objektstamm (missing) dependents: [service jboss.deployment.unit."objektstamm.war".deploymentCompleteService] 
      service jboss.undertow.deployment.default-server.default-host./objektstamm.codec (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./objektstamm.UndertowDeploymentInfoService] 
      service jboss.undertow.deployment.default-server.default-host./objektstamm.session (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./objektstamm.UndertowDeploymentInfoService] 
      service org.wildfly.request-controller.control-point."objektstamm.war".undertow (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./objektstamm.UndertowDeploymentInfoService] 
WFLYCTL0186:   Services which failed to start:      service jboss.persistenceunit.objektstamm#production
      service jboss.deployment.unit."versicherungsfaelle.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."versicherungsfaelle.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "versicherungsfaelle.war"

[2018-12-19 09:17:54,249] Artifact objektstamm:war exploded: Error during artifact deployment. See server log for details.
[2018-12-19 09:17:54,249] Artifact objektstamm:war exploded: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.objektstamm#production" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.objektstamm#production: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
    Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
    Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataProvider from [Module \"deployment.objektstamm.war:main\" from Service Module Loader]"}}

我的pom.xml看起来像这样:

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>at.domain.web</groupId>
    <artifactId>objektstamm</artifactId>
    <packaging>war</packaging>
    <version>1.0.0-SNAPSHOT</version>

    <name>objektstamm</name>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- project specific dependency versions -->
        <primefaces.version>6.1</primefaces.version>
        <log4j.version>1.2.14</log4j.version>
        <slf4j.version>1.7.2</slf4j.version>
        <omega.version>1.0.2</omega.version>
        <bootstrap.version>1.0.0</bootstrap.version>
        <hibernate.version>5.0.7.Final</hibernate.version>
    </properties>

    <build>
        <finalName>${project.artifactId}</finalName>

        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>

        <plugins>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>1.0.2.Final</version>
                <configuration>
                    <filename>${project.build.finalName}.war</filename>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <excludedGroups>at.immodat.utils.ManualTest</excludedGroups>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.hibernate.orm.tooling</groupId>
                <artifactId>hibernate-enhance-maven-plugin</artifactId>
                <version>${hibernate.version}</version>
                <executions>
                    <execution>
                        <configuration>
                            <failOnError>true</failOnError>
                            <enableLazyInitialization>true</enableLazyInitialization>
                        </configuration>
                        <goals>
                            <goal>enhance</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- JEE-STACK DEPENDENCIES -->
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>3.3.0.Final</version>
        </dependency>


        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.0.7.Final</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.2.4.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>5.0.7.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>5.0.1.Final</version>
            <scope>provided</scope>
        </dependency>


        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-engine</artifactId>
            <version>5.5.3.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-orm</artifactId>
            <version>5.5.3.Final</version>
        </dependency>

        <!-- PRIMEFACES -->
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>${primefaces.version}</version>
        </dependency>
        <dependency>
            <groupId>at.immodat.themes</groupId>
            <artifactId>omega-layout-immodat</artifactId>
            <version>${omega.version}</version>
        </dependency>
        <dependency>
            <groupId>at.immodat.themes</groupId>
            <artifactId>bootstrap4-immodat</artifactId>
            <version>${bootstrap.version}</version>
        </dependency>

        <dependency>
            <groupId>net.sf.jt400</groupId>
            <artifactId>jt400</artifactId>
            <version>6.7</version>
        </dependency>

        <!-- COMMON UTILITY DEPENDENCIES -->
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>net.sf.jt400</groupId>
            <artifactId>jt400</artifactId>
            <version>6.7</version>
            <scope>test</scope>
        </dependency>

        <!-- logging subsystem -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-to-slf4j</artifactId>
            <version>2.4.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.4.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>${slf4j.version}</version>
        </dependency>

        <!-- TEST DEPENDENCIES -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sf.jt400</groupId>
            <artifactId>jt400</artifactId>
            <version>6.7</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>

有人知道我做错了吗? 预先感谢

0 个答案:

没有答案