Note that there are some explanatory texts on larger screens.

plurals
  1. POConfiguring a war file
    primarykey
    data
    text
    <p>My end goal is simple. I am building a website that has three components: a mobile interface, an admin web interface, and a web user interface. I plan to put each of these modules into separate WAR files and, together with an EJB module &amp; possibly a common library module, bundle them all into a EAR for deployment on JBoss AS 7.1.</p> <p>But first things first, can I deploy a very simple WAR file and get it to work - NO!</p> <p>My war file has the following structure:</p> <p>project-mobile.war:</p> <pre><code> META-INF/MANIFEST.MF WEB-INF/jboss-web.xml WEB-INF/classes/org/dobbo/project/mobile/Accounts.class index.html </code></pre> <p>The manifest.mf file as the following content:</p> <pre><code> Manifest-Version: 1.0 Ant-Version: Apache Ant 1.8.0 Created-By: 1.6.0_18-b18 (Sun Microsystems Inc.) Built-By: steve </code></pre> <p>The jboss-web.xml file's content are:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;jboss-web&gt; &lt;context-root&gt;/mobile&lt;/context-root&gt; &lt;/jboss-web&gt; </code></pre> <p>The Accounts.java file was based on the Library.java example from <a href="https://docs.jboss.org/author/display/AS71/Java+API+for+RESTful+Web+Services+%28JAX-RS%29" rel="nofollow">https://docs.jboss.org/author/display/AS71/Java+API+for+RESTful+Web+Services+(JAX-RS)</a> I did make some changes, added the Application subclassing and the AppicationPath annotation as this got me a little further in getting the deployment to work.</p> <pre><code>package org.dobbo.&lt;project&gt;.mobile; import javax.ws.rs.*; import javax.ws.rs.core.Application; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @ApplicationPath("/accounts") @Consumes({"application/xml"}) @Produces({"application/xml"}) public class Accounts extends Application { ... @GET @Path("/list") public Collection&lt;UUID&gt; getAccounts() { Collection&lt;UUID&gt; list = uuids.values(); log.info("getAccounts: " + list); return list; } ... } </code></pre> <p>So far so good.</p> <p>When I deploy I get the following logged to the JBoss console (timestamp &amp; log level INFO removed):</p> <pre><code>[org.jboss.as.repository] (management-handler-thread - 12) JBAS014900: Content added at location /home/jboss/jboss-7.1.1/standalone/data/content/11/e8cdaea9dfa4e984ada3e22b0c890970f0ba75/content [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment sokoban-mobile.war in 60ms [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "project-mobile.war" [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering web context: /mobile [org.jboss.as.server] (management-handler-thread - 12) JBAS018565: Replaced deployment "project-mobile.war" with deployment "project-mobile.war" </code></pre> <p>So far all seems well. But when I point my browser at jboss-server:8080/mobile/accounts/list I get a:</p> <pre><code>HTTP Status 404 - Could not find resource for relative : /list of full path: http://jboss-server:8080/mobile/accounts/list type Status report message Could not find resource for relative : /list of full path: http://jboss-server:8080/mobile/accounts/list description The requested resource (Could not find resource for relative : /list of full path: http://jboss-server:8080/mobile/accounts/list) is not available. </code></pre> <p>However, something is working because pointing the broswer at jboss-server:8080/mobile/ successfully returns the index.html file also included in the WAR file.</p> <p>It's probably just a simple configuration error on my part, but I can't work it out for the life of me. Many thanks to all that take the trouble to read this issue and even more thanks for posting any ideas you have.</p> <p>Steve</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload