1
votes

I inherited a J2EE app written for deployment on Weblogic 10 and the developer primarily responsible for this application does not get this error when he opens the project in Eclipse.

I have the following very simple weblogic.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="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">   
    <container-descriptor>
        <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
</weblogic-web-app>

Eclipse generates a single XML validation problem for this file, which actually consists of a number of the same errors. The parent text of the XML problem is this:

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 an example of the child errors. They all read this way:

sch-props.correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://java.sun.com/xml/ns/j2ee,descriptionGroup'.

This is followed by a line number. There are about 50 of these errors, and only the quoted name at the end of the error changes.

I found the following bug in Sun's bug tracker which seemed to indicate a possible cause, but I'm not sure how I'd apply it to my project, if it's even relevant.

Impossible to create javax.xml.validation.Schema instance from "web-app_2_4.xsd"

I can't help but think that this is related to my Eclipse configuration, but at this point I'm at a loss.

Thanks for your time.

2

2 Answers

1
votes

I ran into the same issue. I found an article online about needing to update to the latest schema so I looked through Oracle for latest schemas versions here: http://www.oracle.com/webfolder/technetwork/weblogic/weblogic-web-app/index.html

I modified my weblogic.xml file with the following:

<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd">

...
</weblogic-web-app>

Regards, Jose

0
votes

You say this is written for WL 10.

My weblogic.xml begins as

<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app

http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"

xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">

while I can see yours points to the Weblogic 9 namespace

xmlns="http://www.bea.com/ns/weblogic/90"

Does changing this make a difference?