error running default servlet - java

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>

Related

Jakarta EE with Apache Shiro

I am using Wildfly webserver, and trying to implement Apache Shiro within Jakarta EE application, unfortunately I am getting this error:
16:49:36,189 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "testjee8-1.0-SNAPSHOT")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testjee8-1.0-SNAPSHOT.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/shiro/web/servlet/ShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/OncePerRequestFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/NameableFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): javax/servlet/Filter"}}
16:49:36,190 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "testjee8-1.0-SNAPSHOT")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testjee8-1.0-SNAPSHOT.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/shiro/web/servlet/ShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/OncePerRequestFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/NameableFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): javax/servlet/Filter"}}
16:49:36,190 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "testjee8-1.0-SNAPSHOT.war" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testjee8-1.0-SNAPSHOT.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/shiro/web/servlet/ShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/OncePerRequestFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/NameableFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): javax/servlet/Filter"}}
16:49:36,214 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment testjee8-1.0-SNAPSHOT (runtime-name: testjee8-1.0-SNAPSHOT.war) in 23ms
[2023-01-02 04:49:36,249] Artifact testjee8:war exploded: Error during artifact deployment. See server log for details.
[2023-01-02 04:49:36,250] Artifact testjee8:war exploded: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testjee8-1.0-SNAPSHOT.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/shiro/web/servlet/ShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/OncePerRequestFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/NameableFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): javax/servlet/Filter"}}
looks like the class is not found...
The following web.xml and shiro.ini (placed in WEB-INF) as follows:
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
version="5.0">
<context-param>
<param-name>shiroConfigLocations</param-name>
<param-value>/WEB-INF/shiro.ini</param-value>
</context-param>
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ShiroFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
</web-app>
Shiro.ini:
[main]
[urls]
/** = noSessionCreation,authcJWT[permissive]
Forgot to add the pom.xml:
...
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>1.10.0</version>
</dependency>
...
Please help me how to address this issue!
Unfortunately, Apache Shiro is not compatible with Jarkarta namespace yet. According to Apache Shiro's [publication]: https://shiro.apache.org/blog/2022/06/30/jakarta-work.html, version 1.10.0 of Shiro was supposed to be shipped with jakarta but unfortunately as of this writing their latest version, being 1.10.1, does not come with the jakarta namespace yet.

Need assistance in migrating a SOAP service to Wildlfy 26 from Wildfly 10

We have a Java SOAP service running on Wildlfy & Java 8 currently. We are migrating from Wildfly 10 to 26, java-11-openjdk-11.0.12.0.7-0.el8_4.x86_64
Running into all kinds of issues.
Below is my web.xml
<display-name>SearchWS</display-name>
<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>
<!-- <listener><listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class></listener> -->
<servlet>
<servlet-name>SolrSearchWS</servlet-name>
<servlet-class>com.solr.service.SolrSearchWS</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>SolrSearchWS</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
when i try to deploy my web service, i get the following in my log file
2022-12-07 11:30:06,133 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."SearchWS-0.0.1-SNAPSHOT.war".undertow-deployment.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.deployment.unit."SearchWS-0.0.1-SNAPSHOT.war".undertow-deployment.UndertowDeploymentInfoService: Failed to start serviceorg.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)org.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
org.jboss.threads#2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.IllegalArgumentException: UT010009: Servlet SolrSearchWS of type class com.solr.service.SolrSearchWS does not implement javax.servlet.Servletio.undertow.servlet#2.2.19.Final//io.undertow.servlet.api.ServletInfo.(ServletInfo.java:98)
org.wildfly.extension.undertow#26.1.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:749)
org.wildfly.extension.undertow#26.1.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:312)
org.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
org.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
... 6 more
2022-12-07 11:30:06,141 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit."SearchWS-0.0.1-SNAPSHOT.war".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
Caused by: java.lang.IllegalArgumentException: UT010009: Servlet SolrSearchWS of type class com.solr.service.SolrSearchWS does not implement javax.servlet.Servlet"}}
Any help will be greatly appreciated.
regards
preet
We have tried many different combinations of files in POM. Nothing seems to help

How to debug ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener?

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.

error in simple RESTtful web service implementation

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.

deploy vaadin 7 with maven on jboos 7

Sorry about my bad question but I am trying to have a simple project with work maven with vaadin7,I have problem when deploy to jboss 7,
here is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">
<display-name>Student Manager Example</display-name>
<description>
This is example for research Maven work with Vaadin
</description>
<servlet>
<servlet-name>StudentManager</servlet-name>
<servlet-class>servlet.StudentManagerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>StudentManager</servlet-name>
<url-pattern>/student</url-pattern>
</servlet-mapping>
</web-app>
my Servlet
#Theme("mytheme")
public class StudentManagerServlet extends UI {
private static final long serialVersionUID = 1L;
#Override
protected void init(VaadinRequest request) {
VerticalLayout view = new VerticalLayout();
view.addComponent(new Label("Hello Vaadin!"));
setContent(view);
}
}
And here is my error when deploy jboos
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: servlet.StudentManagerServlet from [Module "deployment.StudentManager-0.0.1-SNAPSHOT.war:main" from Service Module Loader]
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.checkDeclaredApplicationClassAsServlet(JaxrsScanningProcessor.java:290)
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scanWebDeployment(JaxrsScanningProcessor.java:155)
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:104)
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
14:19:10,848 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.\"StudentManager-0.0.1-SNAPSHOT.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"StudentManager-0.0.1-SNAPSHOT.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"StudentManager-0.0.1-SNAPSHOT.war\""}}}}
thankyou very much
You should use full package name and Servlet name, while declaring it in web.xml. Is servlet.StudentManagerServlet the full path of your class?
<servlet>
<servlet-name>StudentManager</servlet-name>
<servlet-class>full.path.to.package.StudentManagerServlet</servlet-class>
</servlet>

Categories

Resources