Monday, 9 May 2011

weblogic.xml Versions in your Webapp

Using the wrong version of weblogic.xml in your Weblogic webapp causes eclipse to shout about a whole bunch of errors. For example, using the following schemata:
<wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/920/weblogic-web-app.xsd">
causes the following error:


...which, if you can't read it says: "The errors below were detected when validating the file "j2ee_1_4.xsd" via the file "weblogic.xml". In most cases these errors can be detected by validating "j2ee_1_4.xsd" directly. However it is possible that errors will only occur when j2ee_1_4.xsd is validated in the context of weblogic.xml".

… and I guess that it’s because you’re trying to mix different versions of Java Enterprise Editions

The fix is to ensure that that you use the latest versions of the schemata in your weblogic.xml and these are currently:
<wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-web-app" 
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_2_5.xsd http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
for Weblogic version 10.3.

No comments: