2

I have a struts2/spring project on JBoss EAP 5.x, while starting server, it gives me such error message :

Failed to parse source: Failed to resolve schema nsURI=http://java.sun.com/xml/ns/javaee location=http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd

The only xml file used web-app_3_0.xsd is my web.xml, as below.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
        id="WebApp_ID" version="3.0">
  <display-name>XXXXXX</display-name>
  <jsp-config>
    <taglib>
          <taglib-uri>HTTP://java.sun.com/jsp/jstl/core</taglib-uri>
          <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
    </taglib>
  </jsp-config>
  <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>

I did tried to access URL as below, all are accessible.

How is it happen ? What means failed to resolve, Is that means I can't get access to that remote file ?

RRTW
  • 3,160
  • 1
  • 35
  • 54
  • Has your server access to the internet? I think using one of the schemas in `$JBOSS_INSTALL/docs/schemas/` as location could be a solution, but the newest version of web_app.xsd I find as of JBoss EAP 5.1.2 is 2.5. – Aaron Dec 08 '16 at 10:04
  • BTW you should consider upgrading to JBoss EAP 6.x or 7.x, it would probably solve your problem and 5.x is not supported by RedHat anymore since last month – Aaron Dec 08 '16 at 10:06
  • I'll try to put web-app_3_0.xsd over there to see how it going... – RRTW Dec 08 '16 at 10:06
  • That could be a solution, I think JBoss should resolve the namespace without the help of any location hint. It probably can't since it doesn't know the schema. – Aaron Dec 08 '16 at 10:07
  • I'm able to access internet(Server still in my laptop), and JBoss EAP 5.x is my office demand to use it... :-( – RRTW Dec 08 '16 at 10:08
  • :-( put web-app_3_0.xsd over there didn't make it work... – RRTW Dec 08 '16 at 10:15
  • Oh wait I should have thought a little bit more about it. `web-app_3_0.xsd` is JavaEE 6, while [JBoss EAP 5.x only supports JavaEE 5](https://access.redhat.com/articles/113373#EE), so there's no chance this is going to work. Either use a JavaEE6 compliant application server, or downgrade your application to JavaEE5 (you can try just changing the web-app location to version 2.5, but it is probable that your app use other JavaEE6 features) – Aaron Dec 08 '16 at 10:22
  • Since you've told me your office only supports JBoss EAP 5.x, what you probably need is to change the settings of your IDE to recreate your application in JavaEE 5. It depends on your IDE of course, but with Eclipse JEE, I'd only have to change the project facet "Dynamic Web Module" to 2.5 level – Aaron Dec 08 '16 at 10:30
  • I don't know why, eclipse just told my can't change version of project facet Dynamic Web Project to 2.5, and with no any description...... – RRTW Dec 09 '16 at 02:32
  • Do you use maven? It looks like it can be a problem. Check this [SO question](http://stackoverflow.com/questions/18122336/cannot-change-version-of-project-facet-dynamic-web-module-to-3-0) – Aaron Dec 09 '16 at 10:01

1 Answers1

0

web-app_3_0.xsd is the schema of JavaEE 6 applications' deployment descriptor, and JBoss EAP 5.x is only JavaEE 5 compliant, so you won't be able to deploy your JavaEE 6 application to it.

You should either downgrade your application to JavaEE 5 or deploy it to a JavaEE 6 compliant application server.

Aaron
  • 24,009
  • 2
  • 33
  • 57