1
votes

I am migrating a legacy Java EE web application from orion server to WildFly.

The directory structure of the ear file is as below:

my_proj.ear
  |--META-INF/MANIFEST.MF
  |--META-INF/application.xml
  |--web/a_few_js/jsp_files
  |--web/WEB-INF/classes/a_few_java_classes
  |--web/WEB-INF/web.xml

The application.xml has the following:

<application>
    <display-name>my_proj</display-name>
    <module>
    <web>
        <web-uri>web</web-uri>
    </web>
    </module>
</application>


I am able to deploy the ear successfully in JBoss. However, when I hit the url "localhost:8080/my_proj", I get a 404.

I am able to hit the URLs for war files based deployment without any issues. Am I missing anything here?

I am relatively new to Java EE and JBoss.

Please let me know if you need any additional information.

2
To continue with my work, I've decided to repackage it as war. I am not sure why the legacy application was packaged as .ear to begin with. Thanks everyone for the answers. Still interested in knowing the solution to the above question. - prefetcher

2 Answers

1
votes

You configured web-uri as web and then try address http://localhost:8080/web if port is right.

0
votes

You could also add a jboss-web.xml in the WEB-INF dir.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "http://www.jboss.org/j2ee/dtd" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>
    <context-root>my_proj</context-root>
</jboss-web>

Your web.xml version should be version 3:

   <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0">