]
George Gastaldi closed FORGE-1723.
----------------------------------
Resolution: Out of Date
Fixed in Forge 2.x
Incorrect web.xml generated for REST
------------------------------------
Key: FORGE-1723
URL:
https://issues.jboss.org/browse/FORGE-1723
Project: Forge
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Java EE
Affects Versions: 1.4.4.Final
Reporter: Arun Gupta
Create a project using Forge 1.4.4 as:
[no project] tmp $ new-project --named basic-javaee-forge --topLevelPackage
org.forge.samples.javaee --type war
? Use [/Users/arungupta/tmp/basic-javaee-forge] as project directory? [Y/n] y
***SUCCESS*** Created project [basic-javaee-forge] in new working directory
[/Users/arungupta/tmp/basic-javaee-forge]
Wrote /Users/arungupta/tmp/basic-javaee-forge
Wrote /Users/arungupta/tmp/basic-javaee-forge/pom.xml
Wrote /Users/arungupta/tmp/basic-javaee-forge/src/main/webapp
Wrote /Users/arungupta/tmp/basic-javaee-forge/src/main/java
Wrote /Users/arungupta/tmp/basic-javaee-forge/src/test/java
Wrote /Users/arungupta/tmp/basic-javaee-forge/src/main/resources
Wrote /Users/arungupta/tmp/basic-javaee-forge/src/test/resources
Wrote /Users/arungupta/tmp/basic-javaee-forge/src/main/java/org/forge/samples/javaee
[basic-javaee-forge] basic-javaee-forge $ rest setup
Use which version of 'jboss-javaee-6.0' ?
1 - [org.jboss.spec:jboss-javaee-6.0:pom::1.0.0.Beta4]
2 - [org.jboss.spec:jboss-javaee-6.0:pom::1.0.0.Beta5]
3 - [org.jboss.spec:jboss-javaee-6.0:pom::1.0.0.Beta6]
4 - [org.jboss.spec:jboss-javaee-6.0:pom::1.0.0.Beta7]
5 - [org.jboss.spec:jboss-javaee-6.0:pom::1.0.0.CR1]
6 - [org.jboss.spec:jboss-javaee-6.0:pom::1.0.0.Final]
7 - [org.jboss.spec:jboss-javaee-6.0:pom::2.0.0.Beta1]
8 - [org.jboss.spec:jboss-javaee-6.0:pom::2.0.0.CR1]
9 - [org.jboss.spec:jboss-javaee-6.0:pom::2.0.0.Final]
10 - [org.jboss.spec:jboss-javaee-6.0:pom::2.1.0.Beta1]
11 - [org.jboss.spec:jboss-javaee-6.0:pom::3.0.0.Beta1]
12 - [org.jboss.spec:jboss-javaee-6.0:pom::3.0.0.Final]
13 - [org.jboss.spec:jboss-javaee-6.0:pom::3.0.1.Final]
14 - [org.jboss.spec:jboss-javaee-6.0:pom::3.0.2.Final]*
? Choose an option by typing the number of the selection [*-default] [0]
***SUCCESS*** Installed [forge.spec.servlet] successfully.
? What root path do you want to use for your resources? [/rest]
***SUCCESS*** Installed [forge.spec.jaxrs.webxml] successfully.
***SUCCESS*** Installed [forge.spec.jaxrs] successfully.
***SUCCESS*** Rest Web Services (JAX-RS) is installed.
Wrote /Users/arungupta/tmp/basic-javaee-forge/pom.xml
Wrote /Users/arungupta/tmp/basic-javaee-forge/src/main/webapp/WEB-INF/web.xml
Generated web.xml is shown below:
<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>basic-javaee-forge</display-name>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<servlet>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
Deploying this project in JBoss EAP 6.2 gives the error:
17:34:18,770 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/basic-javaee-forge]]
(ServerService Thread Pool -- 126) JBWEB000289: Servlet javax.ws.rs.core.Application threw
load() exception: javax.servlet.ServletException: JBWEB000260: No servlet class has been
specified for servlet javax.ws.rs.core.Application
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1147)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3591)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3798)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at
org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156)
[jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at
org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
[jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
[jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[rt.jar:1.8.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[rt.jar:1.8.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[rt.jar:1.8.0]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
This is because javax.ws.rs.core.Application is not a Servlet. There is even no need to
generated web.xml, a combination of Application and ApplicationPath will be sufficient.