Softwares used :
Java Version : "1.7.0_21"
Eclipse Version : Kepler
Application Server : wildfly-8.1.0.Final(with RESTeasy bundle)
My try :
I want to implement REST web service. My resources is university.
package com.nagarro.university;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
#ApplicationPath("/university") //??? OR #Path("/university")???
public class University extends Application{
#GET
#Produces(MediaType.TEXT_HTML)
public String getHTMLUniversityInfo(){
return "<html> "
+ "<title>"
+ "University Information"
+ "</title>"
+ "<body>"
+ "<h1>"
+ "NAME- IIIT"
+ "</h1>"
+ "</body>"
+ "</html>";
}
#GET
#Produces(MediaType.TEXT_PLAIN)
public String getXMLUniversityInfo() {
return "NAME-IIITA";
}
#PUT
#Path("{studentRollNo}")
#Produces(MediaType.TEXT_PLAIN)
public String updateUniversityInfo(#PathParam("studentRollNo") String studentRollNo) {
// CODE TO UPDATE STUDENT
return "Done SUccessfully!!!";
}
}
web.xml which I created after reading from sources: [1] [2] [3]
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<display-name>UniversityRESTful-WS</display-name>
<listener>
<listener-class>
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
</listener-class>
</listener>
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.nagarro.university.University</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Now, I right click on my Project to "Run on Server" but following error comes as
19:12:23,467 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-10) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./UniversityRESTful-WS: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./UniversityRESTful-WS: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.nagarro.university.University from [Module "deployment.UniversityRESTful-WSEAR.ear.UniversityRESTful-WS.war:main" from Service Module Loader]
at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:292)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:95)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:214)
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:119)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:505)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:88)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
... 3 more
Caused by: java.lang.ClassNotFoundException: com.nagarro.university.University from [Module "deployment.UniversityRESTful-WSEAR.ear.UniversityRESTful-WS.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:288)
... 12 more
19:12:23,473 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "UniversityRESTful-WSEAR.ear")]) - failure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./UniversityRESTful-WS" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./UniversityRESTful-WS: Failed to start service
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.nagarro.university.University from [Module \"deployment.UniversityRESTful-WSEAR.ear.UniversityRESTful-WS.war:main\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: com.nagarro.university.University from [Module \"deployment.UniversityRESTful-WSEAR.ear.UniversityRESTful-WS.war:main\" from Service Module Loader]"}}
19:12:23,839 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "UniversityRESTful-WSEAR.ear" (runtime-name : "UniversityRESTful-WSEAR.ear")
19:12:23,840 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./UniversityRESTful-WS: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./UniversityRESTful-WS: Failed to start service
19:12:23,906 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
19:12:23,907 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
19:12:23,907 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: WildFly 8.1.0.Final "Kenny" started (with errors) in 3239ms - Started 286 of 350 services (3 services failed or missing dependencies, 99 services are lazy, passive or on-demand)
19:12:24,100 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-5) HV000001: Hibernate Validator 5.1.0.Final
19:12:24,143 INFO [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015974: Stopped subdeployment (runtime-name: UniversityRESTful-WS.war) in 63ms
19:12:24,144 INFO [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015877: Stopped deployment UniversityRESTful-WSEAR.ear (runtime-name: UniversityRESTful-WSEAR.ear) in 65ms
19:12:24,221 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018558: Undeployed "UniversityRESTful-WSEAR.ear" (runtime-name: "UniversityRESTful-WSEAR.ear")
19:12:24,224 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.deployment.subunit."UniversityRESTful-WSEAR.ear"."UniversityRESTful-WS.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.deployment.subunit."UniversityRESTful-WSEAR.ear"."UniversityRESTful-WS.war".deploymentCompleteService]
service jboss.deployment.subunit."UniversityRESTful-WSEAR.ear"."UniversityRESTful-WS.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START (missing) dependents: [service jboss.deployment.subunit."UniversityRESTful-WSEAR.ear"."UniversityRESTful-WS.war".deploymentCompleteService]
service jboss.deployment.subunit."UniversityRESTful-WSEAR.ear"."UniversityRESTful-WS.war".component."org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher".START (missing) dependents: [service jboss.deployment.subunit."UniversityRESTful-WSEAR.ear"."UniversityRESTful-WS.war".deploymentCompleteService]
service jboss.deployment.subunit."UniversityRESTful-WSEAR.ear"."UniversityRESTful-WS.war".deploymentCompleteService (missing) dependents: [service jboss.deployment.unit."UniversityRESTful-WSEAR.ear".deploymentCompleteService]
service jboss.undertow.deployment.default-server.default-host./UniversityRESTful-WS (missing) dependents: [service jboss.deployment.subunit."UniversityRESTful-WSEAR.ear"."UniversityRESTful-WS.war".deploymentCompleteService]
JBAS014777: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./UniversityRESTful-WS
19:12:28,856 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) JBAS015003: Found UniversityRESTful-WSEAR.ear in deployment directory. To trigger deployment create a file called UniversityRESTful-WSEAR.ear.dodeploy
Why am I getting ClassNotFoundException error? Do I need to add any extra dependencies in my pom.xml(so far none added because RESTeasy states no extra dependencies requires to be added)?
I downloaded JBoss quick-start guide and observed given hellowrld-rs example. It's web.xml which was very minimally configured as given below:
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
I then noted the sources I referenced earlier were guide for older JBoss(6/7) and not WildFly.
Related
I'm new in the company and they were helping me while I setup the enviroment, I got this error when I started WildFly server (they gave me their wildfly 18):
`
09:47:20,106 INFO [org.jboss.as.ejb3] (MSC service thread 1-4) WFLYEJB0493: EJB subsystem suspension complete
09:47:20,124 INFO [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-5) IJ020018: Enabling <validate-on-match> for java:/goljagen
09:47:20,124 INFO [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-8) IJ020018: Enabling <validate-on-match> for java:/goljagra
09:47:20,129 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:/agepos]
09:47:20,129 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:/goljagen]
09:47:20,130 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0001: Bound data source [java:/goljagra]
09:47:22,425 INFO [org.jboss.as.patching] (MSC service thread 1-1) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
09:47:22,439 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Program Files\wildfly-18.0.0.Final\standalone\deployments
09:47:22,458 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "archiconEar.ear" (runtime-name: "archiconEar.ear")
09:47:22,760 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
09:47:23,436 INFO [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.3)
09:47:25,221 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."archiconEar.ear".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."archiconEar.ear".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "archiconEar.ear"
at org.jboss.as.server#10.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
at org.jboss.msc#1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc#1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc#1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment archiconWeb.war in jboss-deployment-structure.xml was not found. Available sub deployments: archiconWeb
at org.jboss.as.server#10.0.0.Final//org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:327)
at org.jboss.as.server#10.0.0.Final//org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:221)
at org.jboss.as.server#10.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
... 8 more
09:47:25,728 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "archiconEar.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"archiconEar.ear\".STRUCTURE" => "WFLYSRV0153: Failed to process phase STRUCTURE of deployment \"archiconEar.ear\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment archiconWeb.war in jboss-deployment-structure.xml was not found. Available sub deployments: archiconWeb"}}
09:47:25,747 INFO [org.jboss.as.server] (ServerService Thread Pool -- 44) WFLYSRV0010: Deployed "archiconEar.ear" (runtime-name : "archiconEar.ear")
09:47:25,748 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."archiconEar.ear".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "archiconEar.ear"
09:47:25,820 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
09:47:25,823 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
09:47:25,824 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
09:47:25,824 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 18.0.0.Final (WildFly Core 10.0.0.Final) started (with errors) in 18868ms - Started 597 of 859 services (1 services failed or missing dependencies, 408 services are lazy, passive or on-demand)
`
We whatched in the jboss-deployment-structur and we have this:
`
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<sub-deployment name="archiconWeb.war">
<dependencies>
<!-- <module name="org.apache.poi" /> -->
<module name="org.apache.commons.codec" />
</dependencies>
</sub-deployment>
</jboss-deployment-structure>
`
this is the 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>it.sisal</groupId>
<artifactId>archicon</artifactId>
<version>0.0.39-SNAPSHOT</version>
</parent>
<artifactId>archiconEar</artifactId>
<packaging>ear</packaging>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>${version.ear.plugin}</version>
<configuration>
<wtpContextName>archicon</wtpContextName>
<!-- Tell Maven we are using Java EE 7 -->
<version>7</version>
<!-- Use Java EE ear libraries as needed. Java EE ear libraries
are in easy way to package any libraries needed in the ear, and automatically
have any modules (EJB-JARs and WARs) use them -->
<defaultLibBundleDir>lib</defaultLibBundleDir>
<outputFileNameMapping>#{artifactId}#</outputFileNameMapping>
<contextRoot>/archicon</contextRoot>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>it.sisal</groupId>
<artifactId>archiconWeb</artifactId>
<version>0.0.39-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
</project>
Everyone else got the same file, Do you have any Idea which file should I check and how I can solve this problem.
Thanks to all!!!!
They told me to do:
mvn build, on eclipse do:
mvn update;
Project -> clean;
Project -> build All;
On the right click on the server I selected: clean than Publish.
i work in maven project, I created a pom maven project and 2 maven module
A module for the business layer (Ejb) and the other for the web layer (war maven project)
my problem is when i run a simple servlet wildfly show me 404 - Not Found
this is my Console output
18:53:18,813 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./BanquePPWeb.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./BanquePPWeb.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: test.Test1 from [Module "deployment.BanquePPWeb.war:main" from Service Module Loader]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:1079)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:284)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: test.Test1 from [Module "deployment.BanquePPWeb.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)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:723)
... 6 more
18:53:18,992 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "BanquePPWeb.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./BanquePPWeb.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./BanquePPWeb.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: test.Test1 from [Module \"deployment.BanquePPWeb.war:main\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: test.Test1 from [Module \"deployment.BanquePPWeb.war:main\" from Service Module Loader]"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host./BanquePPWeb.UndertowDeploymentInfoService"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
18:53:19,056 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0010: Deployed "BanquePPWeb.war" (runtime-name : "BanquePPWeb.war")
18:53:19,057 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./BanquePPWeb.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./BanquePPWeb.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: test.Test1 from [Module "deployment.BanquePPWeb.war:main" from Service Module Loader]
and this is my web.xml
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" id="WebApp_ID">
<display-name>BanquePPWeb</display-name>
<servlet>
<description>
</description>
<display-name>Test1</display-name>
<servlet-name>Test1</servlet-name>
<servlet-class>test.Test1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Test1</servlet-name>
<url-pattern>/Test1</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
The error:
2016-04-12 12:32:04,399 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 62) HHH000230: Schema export complete
2016-04-12 12:32:04,753 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.BanqueEE.ear.BanqueEEWeb.war:main" from Service Module Loader]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:870)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:242)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_66]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_66]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_66]
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.BanqueEE.ear.BanqueEEWeb.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.addListener(UndertowDeploymentInfoService.java:1145)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:734)
... 6 more
2016-04-12 12:32:05,109 INFO [org.jboss.weld.Bootstrap] (weld-worker-4) WELD-000119: Not generating any bean definitions from org.apache.struts2.tiles.StrutsTilesListener because of underlying class loading error: Type org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.BanqueEE.ear.BanqueEEWeb.war:main" from Service Module Loader] not found. If this is unexpected, enable DEBUG logging to see the full error.
2016-04-12 12:32:07,323 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "BanqueEE.ear")]) - failure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module \"deployment.BanqueEE.ear.BanqueEEWeb.war:main\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module \"deployment.BanqueEE.ear.BanqueEEWeb.war:main\" from Service Module Loader]"}}
2016-04-12 12:32:07,408 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) JBAS018559: Deployed "BanqueEE.ear" (runtime-name : "BanqueEE.ear")
2016-04-12 12:32:07,410 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.BanqueEE.ear.BanqueEEWeb.war:main" from Service Module Loader]
How to debug this error in Struts 2?
You have missed a library struts2-tiles-plugin-x.x.x.x.jar and probably their dependencies.
What you need is to add these libraries to the Deployment Assembly. It will help you to archive ear project and include dependencies that have equivalent manifest settings in their classpath.
If you want to know what is a Deployment Assembly you can read this article Eclipse : Java EE Module Dependencies is replaced by Web Deployment Assembly.
“Web Deployment Assembly“, which provide more powerful and flexible ways to configure the project packaging structure.
There's also a page that describes the process of linking external resources with the ear application: Web Application Development: Configuring Projects with External Resources.
Do you have some javaee api jar in your war ? Maybe a servlet.jar ? Please remove it, and check after that.
I'm getting below error while starting the jboss the server.
Just i installed the JBPM 6.1.0 and trying to start the server and deployment also getting fail.
Please advise...
2014-09-16 12:16:54,008 ERROR
[org.jboss.as.controller.management-operation]
(DeploymentScanner-threads - 2) JBAS014613: Operation
("full-replace-deployment") failed - address: ([]) - failure
description: {
"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"jbpm-console.war\".weld.weldClassIntrospector
is missing [jboss.deployment.unit.\"jbpm-console.war\".beanmanager]"],
"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => ["jboss.deployment.unit.\"jbpm-console.war\".INSTALL"],
"Services that may be the cause:" => [
"jboss.deployment.unit.\"jbpm-console.war\".beanmanager",
"jboss.http-upgrade-registry.default",
"jboss.remoting.remotingConnectorInfoService.http-remoting-connector"
]
} }
2014-09-16 12:16:54,046 INFO [org.jboss.as.server]
(DeploymentScanner-threads - 2) JBAS018565: Replaced deployment
"jbpm-console.war" with deployment "jbpm-console.war" 2014-09-16
12:16:54,048 INFO [org.jboss.as.controller]
(DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.app.jbpm-console (unavailable) dependents: [service jboss.deployment.unit."jbpm-console.war".INSTALL]
service jboss.naming.context.java.module.jbpm-console.jbpm-console
(unavailable) dependents: [service
jboss.deployment.unit."jbpm-console.war".INSTALL] JBAS014777:
Services which failed to start: service
jboss.serverManagement.controller.management.http:
org.jboss.msc.service.StartException in service
jboss.serverManagement.controller.management.http: JBAS015811: Failed
to start the http-interface service
service jboss.jacorb.poa-service.rootpoa: org.jboss.msc.service.StartException in service
jboss.jacorb.poa-service.rootpoa: JBAS016490: Failed to resolve
initial reference RootPOA
service jboss.undertow.listener.default: org.jboss.msc.service.StartException in service
jboss.undertow.listener.default: Could not start http listener
This means that there is another server in the same port that jboss is using:
"org.jboss.msc.service.StartException in service jboss.undertow.listener.default: Could not start http listener", if that's not the issue, please provide the full stack trace.
Regards
I'm new in java web developing. i'm adapt the project to working in server jboss 7.1.1. I write empty carcass servlet. Copy project.war to server. New file present project.war.deployed. Ok, but if i declare variable:
private org.h2.tools.Server server;
after copy project.war to server, present file project.war.failed. In the file pom.xml contains the library. Help me please.
log file:
09:00:39,380 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "project.war"
09:00:42,054 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jaxb-api.jar in "/c:/jbpm-installer/content/project.war/WEB-INF/lib/jaxb-impl-2.2.4-1.jar" does not point to a valid jar for a Class-Path reference.
09:00:42,055 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry activation.jar in "/c:/jbpm-installer/content/project.war/WEB-INF/lib/jaxb-impl-2.2.4-1.jar" does not point to a valid jar for a Class-Path reference.
09:00:42,056 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jsr173_1.0_api.jar in "/c:/jbpm-installer/content/project.war/WEB-INF/lib/jaxb-impl-2.2.4-1.jar" does not point to a valid jar for a Class-Path reference.
09:00:42,057 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jaxb1-impl.jar in "/c:/jbpm-installer/content/project.war/WEB-INF/lib/jaxb-impl-2.2.4-1.jar" does not point to a valid jar for a Class-Path reference.
09:00:42,058 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jaxb-api.jar in "/c:/jbpm-installer/content/project.war/WEB-INF/lib/jaxb-xjc-2.2.4-1.jar" does not point to a valid jar for a Class-Path reference.
09:00:42,059 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jaxb-impl.jar in "/c:/jbpm-installer/content/project.war/WEB-INF/lib/jaxb-xjc-2.2.4-1.jar" does not point to a valid jar for a Class-Path reference.
09:00:42,061 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jsr173_1.0_api.jar in "/c:/jbpm-installer/content/project.war/WEB-INF/lib/jaxb-xjc-2.2.4-1.jar" does not point to a valid jar for a Class-Path reference.
09:00:42,062 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry activation.jar in "/c:/jbpm-installer/content/project.war/WEB-INF/lib/jaxb-xjc-2.2.4-1.jar" does not point to a valid jar for a Class-Path reference.
09:00:42,077 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015893: Encountered invalid class name 'org.springframework.context.ApplicationContext,org.springframework.beans.BeansException' for service type 'org.apache.cxf.bus.factory'
09:00:42,078 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015893: Encountered invalid class name 'org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer' for service type 'org.xmlpull.v1.XmlPullParserFactory'
09:00:42,079 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015893: Encountered invalid class name 'org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer' for service type 'org.xmlpull.v1.XmlPullParserFactory'
09:00:42,089 INFO [org.jboss.as.jpa] (MSC service thread 1-4) JBAS011401: Read persistence.xml for jbpm
09:00:42,090 INFO [org.jboss.as.jpa] (MSC service thread 1-4) JBAS011401: Read persistence.xml for org.jbpm.task
09:00:42,243 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."project.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."project.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "project.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: java.lang.RuntimeException: Error getting reflective information for class org.jboss.jbpm.webapp.servelet.HumanTaskStartupServlet with ClassLoader ModuleClassLoader for Module "deployment.project.war:main" from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: java.lang.NoClassDefFoundError: Lorg/h2/tools/Server;
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_25]
at java.lang.Class.privateGetDeclaredFields(Class.java:2387) [rt.jar:1.7.0_25]
at java.lang.Class.getDeclaredFields(Class.java:1796) [rt.jar:1.7.0_25]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 10 more
Caused by: java.lang.ClassNotFoundException: org.h2.tools.Server from [Module "deployment.project.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 15 more
09:00:42,256 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "project.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"project.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"project.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"project.war\""}}
09:00:42,458 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment project.war in 202ms
09:00:42,461 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."project.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."project.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "project.war"
09:00:42,463 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"project.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"project.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"project.war\""}}}}
Vladimir,
Apparently it seems the the ClassLoader which loaded the servlet is unable to find the class org.h2.tools.Server.
From the conversation you had with Nambari, it seems h2.jar is not copied to WEB-INF/lib folder. It make sense that you dont want to copy the file. Because, i believe Jboss AS 7.1.1 already comes with this jar as a module.
For non implicit dependencies (https://docs.jboss.org/author/display/AS7/Implicit+module+dependencies+for+deployments), i guess you need to provide an explicit dependency for this jar in your .war META-INF like below.
Dependencies: com.h2database.h2
For more info on this please take a look at "Explicit dependencies" section at http://www.mastertheboss.com/jboss-as-7/jboss-as-7-classloading
Good Luck.