2017-06-13 5 views
0

Ich habe meine Webanwendung [CourseWebApplication.war] mit Wildfly 9.0.2 unter Eclipse bereitgestellt.java.lang.ClassNotFoundException: org.hibernate.criterion.Criterion

In dem Ordner: ...\wildfly-9.0.2.Final\standalone\deployments\CourseWebProject.war\WEB-INF\lib gibt es ein jar [CourseProject.jar], das Dao der verschiedenen Tabellen enthält, die in der db und mehreren Servlets zugeordnet sind (zugeordnet in CourseWebProjects web.xml). Sowohl Jar als auch War sind mit Maven verbunden und haben Abhängigkeiten in ihrer pom.xml: hibernate-core, hibernate-commons-annotations und hibernate-jpa-2.0-api.

Exception handling request to /CourseWebProject/home: java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion wird jedes Mal ausgelöst, wenn ich mein HomeServlet Servlet ausführen. Ich habe (in debug), dass die obige Ausnahme wird ausgelöst, wenn es versucht, ein neues DaoImpl Objekt istance aber ich verstehe nicht, warum:

CourseProject/HomeServlet.java

public class HomeServlet extends HttpServlet 
{ 
    private static final long serialVersionUID = 1L; 

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
    { 
     doPost(request,response); 
    } 

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
    { 
     String username = request.getParameter("userName"); 
     String password = request.getParameter("password"); 
     if(username!=null && !username.isEmpty() && password!=null && !password.isEmpty()) 
     { 
      Users user = new Users(); 
      user.setUsername(username); 
      user.setPassword(password); 
      **DaoInterface dao = new DaoImpl();** 

Log-Server

2017-06-12 10:45:15,358 INFO [org.jboss.modules] (main) JBoss Modules version 1.4.3.Final 
2017-06-12 10:45:15,629 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final 
2017-06-12 10:45:15,705 INFO [org.jboss.as] (MSC service thread 1-6) WFLYSRV0049: WildFly Full 9.0.2.Final (WildFly Core 1.0.2.Final) starting 
2017-06-12 10:45:15,707 DEBUG [org.jboss.as.config] (MSC service thread 1-6) Configured system properties: 
    awt.toolkit = sun.awt.windows.WToolkit 
    file.encoding = Cp1252 
    file.encoding.pkg = sun.io 
    file.separator = \ 
    java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment 
    java.awt.headless = true 
    java.awt.printerjob = sun.awt.windows.WPrinterJob 
    java.class.path = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\jboss-modules.jar 
    java.class.version = 52.0 
    java.endorsed.dirs = C:\Program Files\Java\jdk1.8.0_131\jre\lib\endorsed 
    java.ext.dirs = C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext;C:\windows\Sun\Java\lib\ext 
    java.home = C:\Program Files\Java\jdk1.8.0_131\jre 
    java.io.tmpdir = C:\Users\Riccardo\AppData\Local\Temp\ 
    java.library.path = C:\Program Files\Java\jdk1.8.0_131\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;native;C:/Program Files/Java/jdk1.8.0_131/bin/../jre/bin/server;C:/Program Files/Java/jdk1.8.0_131/bin/../jre/bin;C:/Program Files/Java/jdk1.8.0_131/bin/../jre/lib/amd64;C:\Program Files\PostgreSQL\9.4\bin;C:\Program Files\Java\jdk1.8.0_131\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Lenovo\FusionEngine;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\syswow64;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\Program Files\PuTTY\;C:\Program Files (x86)\Skype\Phone\;C:\Users\Riccardo\Downloads\eclipse;;. 
    java.net.preferIPv4Stack = true 
    java.runtime.name = Java(TM) SE Runtime Environment 
    java.runtime.version = 1.8.0_131-b11 
    java.specification.name = Java Platform API Specification 
    java.specification.vendor = Oracle Corporation 
    java.specification.version = 1.8 
    java.util.logging.manager = org.jboss.logmanager.LogManager 
    java.vendor = Oracle Corporation 
    java.vendor.url = http://java.oracle.com/ 
    java.vendor.url.bug = http://bugreport.sun.com/bugreport/ 
    java.version = 1.8.0_131 
    java.vm.info = mixed mode 
    java.vm.name = Java HotSpot(TM) 64-Bit Server VM 
    java.vm.specification.name = Java Virtual Machine Specification 
    java.vm.specification.vendor = Oracle Corporation 
    java.vm.specification.version = 1.8 
    java.vm.vendor = Oracle Corporation 
    java.vm.version = 25.131-b11 
    javax.management.builder.initial = org.jboss.as.jmx.PluggableMBeanServerBuilder 
    javax.xml.datatype.DatatypeFactory = __redirected.__DatatypeFactory 
    javax.xml.parsers.DocumentBuilderFactory = __redirected.__DocumentBuilderFactory 
    javax.xml.parsers.SAXParserFactory = __redirected.__SAXParserFactory 
    javax.xml.stream.XMLEventFactory = __redirected.__XMLEventFactory 
    javax.xml.stream.XMLInputFactory = __redirected.__XMLInputFactory 
    javax.xml.stream.XMLOutputFactory = __redirected.__XMLOutputFactory 
    javax.xml.transform.TransformerFactory = __redirected.__TransformerFactory 
    javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema = __redirected.__SchemaFactory 
    javax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom = __redirected.__XPathFactory 
    jboss.bind.address = localhost 
    jboss.bind.address.management = localhost 
    jboss.home.dir = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final 
    jboss.host.name = arm-pc 
    jboss.modules.dir = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\modules 
    jboss.modules.system.pkgs = org.jboss.byteman 
    jboss.node.name = arm-pc 
    jboss.qualified.host.name = arm-pc 
    jboss.server.base.dir = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\standalone 
    jboss.server.config.dir = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\standalone\configuration 
    jboss.server.data.dir = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\standalone\data 
    jboss.server.deploy.dir = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\standalone\data\content 
    jboss.server.log.dir = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\standalone\log 
    jboss.server.name = arm-pc 
    jboss.server.persist.config = true 
    jboss.server.temp.dir = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\standalone\tmp 
    line.separator = 

    logging.configuration = file:/C:/Users/Riccardo/Downloads/wildfly-9.0.2.Final/standalone/configuration/logging.properties 
    module.path = C:/Users/Riccardo/Downloads/wildfly-9.0.2.Final/modules 
    org.jboss.boot.log.file = C:/Users/Riccardo/Downloads/wildfly-9.0.2.Final/standalone/log/boot.log 
    org.jboss.logmanager.nocolor = true 
    org.jboss.resolver.warning = true 
    org.xml.sax.driver = __redirected.__XMLReaderFactory 
    os.arch = amd64 
    os.name = Windows 8.1 
    os.version = 6.3 
    path.separator = ; 
    program.name = JBossTools: WildFly 9.x 
    sun.arch.data.model = 64 
    sun.boot.class.path = C:\Program Files\Java\jdk1.8.0_131\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_131\jre\classes 
    sun.boot.library.path = C:\Program Files\Java\jdk1.8.0_131\jre\bin 
    sun.cpu.endian = little 
    sun.cpu.isalist = amd64 
    sun.desktop = windows 
    sun.io.unicode.encoding = UnicodeLittle 
    sun.java.command = org.jboss.modules.Main -mp C:/Users/Riccardo/Downloads/wildfly-9.0.2.Final/modules -jaxpmodule javax.xml.jaxp-provider -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -b localhost --server-config=standalone.xml -Djboss.server.base.dir=C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\standalone 
    sun.java.launcher = SUN_STANDARD 
    sun.jnu.encoding = Cp1252 
    sun.management.compiler = HotSpot 64-Bit Tiered Compilers 
    sun.os.patch.level = 
    sun.rmi.dgc.client.gcInterval = 3600000 
    sun.rmi.dgc.server.gcInterval = 3600000 
    user.country = US 
    user.country.format = IT 
    user.dir = C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\bin 
    user.home = C:\Users\Riccardo 
    user.language = en 
    user.language.format = it 
    user.name = Riccardo 
    user.script = 
    user.timezone = Europe/Berlin 
    user.variant = 
2017-06-12 10:45:15,710 DEBUG [org.jboss.as.config] (MSC service thread 1-6) VM Arguments: -Dprogram.name=JBossTools: WildFly 9.x -Xms64m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=C:/Users/Riccardo/Downloads/wildfly-9.0.2.Final/standalone/log/boot.log -Dlogging.configuration=file:/C:/Users/Riccardo/Downloads/wildfly-9.0.2.Final/standalone/configuration/logging.properties -Djboss.home.dir=C:/Users/Riccardo/Downloads/wildfly-9.0.2.Final -Dorg.jboss.logmanager.nocolor=true -Djboss.bind.address.management=localhost -Dfile.encoding=Cp1252 
2017-06-12 10:45:17,535 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 21) WFLYCTL0028: Attribute 'job-repository-type' in the resource at address '/subsystem=batch' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation. 
2017-06-12 10:45:17,540 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 10) WFLYCTL0028: Attribute 'enabled' in the resource at address '/subsystem=datasources/data-source=ExampleDS' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation. 
2017-06-12 10:45:17,634 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found CourseWebProject.war in deployment directory. To trigger deployment create a file called CourseWebProject.war.dodeploy 
2017-06-12 10:45:17,635 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found HelloWeb.war in deployment directory. To trigger deployment create a file called HelloWeb.war.dodeploy 
2017-06-12 10:45:17,677 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http) 
2017-06-12 10:45:17,706 INFO [org.xnio] (MSC service thread 1-6) XNIO version 3.3.1.Final 
2017-06-12 10:45:17,720 INFO [org.xnio.nio] (MSC service thread 1-6) XNIO NIO Implementation Version 3.3.1.Final 
2017-06-12 10:45:17,796 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 37) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors 
2017-06-12 10:45:17,850 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 44) WFLYJSF0007: Activated the following JSF Implementations: [main] 
2017-06-12 10:45:17,891 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 46) WFLYNAM0001: Activating Naming Subsystem 
2017-06-12 10:45:17,914 INFO [org.jboss.as.naming] (MSC service thread 1-3) WFLYNAM0003: Starting Naming Service 
2017-06-12 10:45:17,923 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3) 
2017-06-12 10:45:17,936 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 38) WFLYCLINF0001: Activating Infinispan subsystem. 
2017-06-12 10:45:17,949 INFO [org.jboss.as.security] (ServerService Thread Pool -- 53) WFLYSEC0002: Activating Security Subsystem 
2017-06-12 10:45:17,954 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 56) WFLYWS0002: Activating WebServices Extension 
2017-06-12 10:45:17,962 INFO [org.jboss.as.security] (MSC service thread 1-1) WFLYSEC0001: Current PicketBox version=4.9.2.Final 
2017-06-12 10:45:17,963 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique. 
2017-06-12 10:45:17,975 INFO [org.jboss.as.connector] (MSC service thread 1-7) WFLYJCA0009: Starting JCA Subsystem (IronJacamar 1.2.5.Final) 
2017-06-12 10:45:17,993 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0018: Started Driver service with driver-name = h2 
2017-06-12 10:45:18,188 INFO [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default] 
2017-06-12 10:45:18,278 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0003: Undertow 1.2.9.Final starting 
2017-06-12 10:45:18,289 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0003: Undertow 1.2.9.Final starting 
2017-06-12 10:45:18,573 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0014: Creating file handler for path C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final/welcome-content 
2017-06-12 10:45:19,589 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "CourseWebProject.war" (runtime-name: "CourseWebProject.war") 
2017-06-12 10:45:19,594 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Users\Riccardo\Downloads\wildfly-9.0.2.Final\standalone\deployments 
2017-06-12 10:45:19,595 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0027: Starting deployment of "HelloWeb.war" (runtime-name: "HelloWeb.war") 
2017-06-12 10:45:19,618 INFO [org.jboss.remoting] (MSC service thread 1-6) JBoss Remoting version 4.0.9.Final 
2017-06-12 10:45:19,658 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server. 
2017-06-12 10:45:19,678 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0018: Host default-host starting 
2017-06-12 10:45:19,949 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTP listener default listening on localhost/127.0.0.1:8080 
2017-06-12 10:45:20,139 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS] 
2017-06-12 10:45:20,482 INFO [org.jboss.ws.common.management] (MSC service thread 1-1) JBWS022052: Starting JBoss Web Services - Stack CXF Server 5.0.0.Final 
2017-06-12 10:45:24,837 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 59) WFLYUT0021: Registered web context: /CourseWebProject 
2017-06-12 10:45:24,837 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 68) WFLYUT0021: Registered web context: /HelloWeb 
2017-06-12 10:45:24,883 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "HelloWeb.war" (runtime-name : "HelloWeb.war") 
2017-06-12 10:45:24,884 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "CourseWebProject.war" (runtime-name : "CourseWebProject.war") 
2017-06-12 10:45:25,257 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management 
2017-06-12 10:45:25,258 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990 
2017-06-12 10:45:25,259 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 9.0.2.Final (WildFly Core 1.0.2.Final) started in 10260ms - Started 352 of 539 services (232 services are lazy, passive or on-demand) 
2017-06-12 10:48:05,056 ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /CourseWebProject/home: java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion 
    at com.arm.course.ui.HomeServlet.doPost(HomeServlet.java:32) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86) 
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) 
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) 
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78) 
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) 
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) 
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) 
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) 
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) 
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) 
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) 
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72) 
    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) 
    at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) 
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) 
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) 
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) 
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) 
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282) 
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261) 
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80) 
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172) 
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) 
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774) 
    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.ClassNotFoundException: org.hibernate.criterion.Criterion from [Module "deployment.CourseWebProject.war:main" from Service Module Loader] 
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455) 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404) 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385) 
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130) 
    ... 30 more 

CourseWebProject/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>org.arm.coursewebapp</groupId> 
    <artifactId>CourseWebProject</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>CourseWebProject Maven Webapp</name> 
    <url>http://maven.apache.org</url> 

    <repositories> 
    <repository> 
    <id>java.net2</id> 
    <name>Repository hosting the jee6 artifacts</name> 
    <url>http://download.java.net/maven/2</url> 
    </repository> 
</repositories> 

    <dependencies> 

    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
    <groupId>javax</groupId> 
    <artifactId>javaee-web-api</artifactId> 
    <version>6.0</version> 
    <scope>provided</scope> 
    </dependency> 

    <!-- HIBERNATE FRAMEWORK AND DEPENDENCY --> 
    <dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate-core</artifactId> 
    <version>5.2.10.Final</version> 
    </dependency> 

    <dependency> 
    <groupId>org.antlr</groupId> 
    <artifactId>antlr-runtime</artifactId> 
    <version>3.5.2</version> 
    </dependency> 

    <dependency> 
    <groupId>dom4j</groupId> 
    <artifactId>dom4j</artifactId> 
    <version>1.6.1</version> 
    </dependency> 

    <dependency> 
    <groupId>org.apache.geronimo.specs</groupId> 
    <artifactId>geronimo-jta_1.1_spec</artifactId> 
    <version>1.1.1</version> 
    </dependency> 

    <dependency> 
    <groupId>org.hibernate.common</groupId> 
    <artifactId>hibernate-commons-annotations</artifactId> 
    <version>5.0.0.Final</version> 
    </dependency> 

    <dependency> 
    <groupId>org.hibernate.javax.persistence</groupId> 
    <artifactId>hibernate-jpa-2.0-api</artifactId> 
    <version>1.0.1.Final</version> 
    </dependency> 

    <dependency> 
    <groupId>org.jboss</groupId> 
    <artifactId>jandex</artifactId> 
    <version>2.0.3.Final</version> 
    </dependency> 

    <dependency> 
    <groupId>javassist</groupId> 
    <artifactId>javassist</artifactId> 
    <version>3.12.1.GA</version> 
    </dependency> 

    <dependency> 
    <groupId>org.jboss.logging</groupId> 
    <artifactId>jboss-logging</artifactId> 
    <version>3.3.1.Final</version> 
    </dependency> 

    <dependency> 
    <groupId>xml-apis</groupId> 
    <artifactId>xml-apis</artifactId> 
    <version>2.0.2</version> 
    </dependency> 


    </dependencies> 
    <build> 
    <finalName>CourseWebProject</finalName> 
    </build> 
</project> 

CourseProject/DaoImp.java

[public class DaoImpl implements DaoInterface 
{ 
    private Session session = null; 

    private void buildSessionFactory() 
    { 
     Configuration configuration = new Configuration(); 
     configuration.configure("/com/arm/course/model/hbm/hibernate.cfg.xml"); 
     SessionFactory sessionFactory = configuration.buildSessionFactory();  
     session = sessionFactory.openSession(); 
    } 

    public DaoImpl() 
    { 
     buildSessionFactory(); 
    } 

Baum Ordner über meine CourseWebProject.war

eingesetzt
wildfly-9.0.2.Final\standalone\deployments\CourseWebProject.war 
Folder PATH listing for volume Windows8_OS 
Volume serial number is BAAC-FBDE 
C:. 
³ Homepage.html 
³ tree.txt 
³ 
ÃÄÄÄcss 
ÃÄÄÄhtml 
³  Login.html 
³  loginError.html 
³  loginOk.html 
³  
ÃÄÄÄjs 
ÃÄÄÄMETA-INF 
³ ³ MANIFEST.MF 
³ ³ 
³ ÀÄÄÄmaven 
³  ÀÄÄÄorg.arm.coursewebapp 
³   ÀÄÄÄCourseWebProject 
³     pom.properties 
³     pom.xml 
³     
ÀÄÄÄWEB-INF 
    ³ web.xml 
    ³ 
    ÀÄÄÄlib 
     ÀÄÄÄCourseProject.jar 
      ÃÄÄÄcom 
      ³ ÀÄÄÄarm 
      ³  ÀÄÄÄcourse 
      ³   ÃÄÄÄdao 
      ³   ³  DaoImpl.class 
      ³   ³  DaoInterface.class 
      ³   ³  TestDao.class 
      ³   ³  
      ³   ÃÄÄÄmodel 
      ³   ³ ³ Classroom.class 
      ³   ³ ³ ClassroomId.class 
      ³   ³ ³ Course.class 
      ³   ³ ³ Location.class 
      ³   ³ ³ Person.class 
      ³   ³ ³ Subject.class 
      ³   ³ ³ SubjectId.class 
      ³   ³ ³ Users.class 
      ³   ³ ³ UsersId.class 
      ³   ³ ³ 
      ³   ³ ÀÄÄÄhbm 
      ³   ³   Classroom.hbm.xml 
      ³   ³   Course.hbm.xml 
      ³   ³   hibernate.cfg.xml 
      ³   ³   Location.hbm.xml 
      ³   ³   Person.hbm.xml 
      ³   ³   Subject.hbm.xml 
      ³   ³   Users.hbm.xml 
      ³   ³   
      ³   ÀÄÄÄui 
      ³     HomeServlet.class 
      ³     LoginFilter.class 
      ³     LoginHomepageServlet.class 
      ³     
      ÀÄÄÄMETA-INF 
       ³ MANIFEST.MF 
       ³ 
       ÀÄÄÄmaven 
        ÀÄÄÄcom.arm.course 
         ÀÄÄÄCourseProject 
           pom.properties 
           pom.xml 

Antwort

0

Ich bin nicht sehr in Wildfly/JBoss (Ich bin mehr in Tomcat/Frühjahr Boot), also bin ich nicht ganz sicher über die erwartete Form einer WAR für diesen JEE-Anwendungsserver.

Es scheint, dass der JBoss-Klassenlader versucht, die Criterion-Klasse zu laden, aber nicht im Klassenpfad findet. Für eine "klassische" WAR, die externen Bibliotheken sollen in WEB-INF/lib sein, gibt es irgendwelche Hibernate JARs, zusätzlich zu Ihrer CourseProject.jar? Es könnte auch im Lib-Verzeichnis des Servers sein, obwohl ich nicht sicher bin, ob es eine ziemlich gute Übung ist.

Wenn dies in Ihrer IDE funktioniert, überprüfen Sie, in welcher JAR-Klasse sich die Criterion-Klasse befindet, und überprüfen Sie, ob sich diese JAR in dem bereitgestellten Paket befindet. Wenn Sie aus Eclipse bereitstellen, überprüfen Sie, ob die Bindung ordnungsgemäß ausgeführt wurde, oder tun Sie das einfach nicht, weil Sie an etwas anderem arbeiten, das Sie schließlich verwenden werden: Erstellen Sie WAR mit Maven, um sicherzustellen, dass das Endergebnis korrekt erstellt wird Bereitstellen Sie es.

Hoffe, das hilft!

+0

Hallo sjahan! Nein in die 'WEB-INF/lib' habe ich nur meine 'CourseProject.jar' gefunden. Die externen Hibernate JARs nehme ich an, dass Maven zur Laufzeit geladen wird (ich irre mich ???) So bald wie möglich überprüfe ich, in welcher JAR die Criterion-Klasse lokalisiert ist und überprüfe, ob diese JAR im Paket ist Ich stell mich .. Wirklich, danke für den Moment –

+0

Maven führt die Kompilierung, die Tests und die Verpackung, aber es sollte nichts zur Laufzeit tun. Die "Criterion" -Klasse soll in einer der Hibernate-JARs sein. Wenn es in Ihrem Klassenpfad keine JARs im Hibernate-Modus gibt, ist das völlig normal. Wie auch immer, die JVM lügt selten: Am Ende vermisst man die Hibernate JARs. – sjahan

+0

Für das CourseWebProject sehe ich JARs (einschließlich denen über Hibernate) unter 'eclipse_workspace \ CourseWebProject \ target \ CourseWebProject \ WEB-INF \ lib' aber ich sehe das nicht (JARs im Klassenpfad des Projekts) für das CourseProject unter 'eclipse_workspace \ CourseProject \ target' .. Ist das ein Problem? –

Verwandte Themen