facebook

weblogic.xml (for WL 9.1) MyEclipse wrongly shows error

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #247159 Reply

    My weblogic.xml (of my web app) wrongly shows an error in MyEclipse (deploys OK but it is annoying to see error in IDE when there is no error
    cvc-elt.1: cannot find the declaration of element weblogic-web-app
    This file has the following content:
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <weblogic-web-app xmlns=”http://www.bea.com/ns/weblogic/90″&gt;
    <security-role-assignment>
    <role-name>MyMusicUser</role-name>
    <principal-name>MyMusicUser</principal-name>
    </security-role-assignment>
    </weblogic-web-app>

    #247169 Reply

    I imported the weblogic-web-app.xsd file (from weblogic.jar) into the XML Catalog of MyEclipse with the following properties:

    URI: file:/d:/opt/MyEclipse/XSD/schemacom_bea_xml/src/weblogic-web-app.xsd
    Key Type: Namespace Name
    Key: http://www.bea.com/ns/weblogic/90

    There are no error messages in the weblogic.xml file now but when I validate this file it says “The XML file is not valid. The message limit for the file has been exceeded please change and retry”

    #255566 Reply

    Riyad Kalla
    Member

    Hey guys is this working for everyone now? I installed WebLogic 9.2 and imported some of the sample weblogic.xml files as defined by the app server, like the following:

    
    <?xml version="1.0" encoding="UTF-8"?>
    
    <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
      <security-role-assignment>
        <role-name>PrivilegedUser</role-name>
        <principal-name>Administrators</principal-name>
      </security-role-assignment>
      <jsp-descriptor>
        <page-check-seconds>1</page-check-seconds>
        <verbose>true</verbose>
      </jsp-descriptor>
      <!--
      Use the virtual-directory-mapping element to specify document roots other
      than the default document root of the Web application for certain kinds of
      requests, such as image requests. All images for a set of Web applications
      can be stored in a single location, and need not be copied to the document
      root of each Web application that uses them. For an incoming request, if a
      virtual directory has been specified servlet container will search for the
      requested resource first in the virtual directory and then in the
      Web application's original document root.
      -->
      <virtual-directory-mapping>
        <local-path>/home/rkalla/Applications/bea-weblogic-9.2/weblogic92/samples</local-path>
        <url-pattern>server/*</url-pattern>
      </virtual-directory-mapping>
      <virtual-directory-mapping>
        <local-path>/home/rkalla/Applications/bea-weblogic-9.2/weblogic92/samples</local-path>
        <url-pattern>domains/*</url-pattern>
      </virtual-directory-mapping>
      <virtual-directory-mapping>
        <local-path>/home/rkalla/Applications/bea-weblogic-9.2/weblogic92/samples/server/</local-path>
        <url-pattern>/examples/*</url-pattern>
      </virtual-directory-mapping>
      <virtual-directory-mapping>
        <local-path>/home/rkalla/Applications/bea-weblogic-9.2/weblogic92/samples/server/</local-path>
        <url-pattern>docs/*</url-pattern>
      </virtual-directory-mapping>
      <virtual-directory-mapping>
        <local-path>/home/rkalla/Applications/bea-weblogic-9.2/weblogic92/samples/server/</local-path>
        <url-pattern>medrec/*</url-pattern>
      </virtual-directory-mapping>
      <virtual-directory-mapping>
        <local-path>/home/rkalla/Applications/bea-weblogic-9.2/weblogic92/samples/server/examples/build</local-path>
        <url-pattern>images/*</url-pattern>
      </virtual-directory-mapping>
    </weblogic-web-app>
    

    And validation and autocomplete worked fine because we ship the 9.0 schemas in our catalog. We had this as a bug in our database and I’m following up to make sure everything is working.

    #255604 Reply

    I used a bad tag and I do not get an error – jsp-descriptorw

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <weblogic-web-app xmlns=”http://www.bea.com/ns/weblogic/90″&gt;
    <security-role-assignment>
    <role-name>Users</role-name>
    <principal-name>Users</principal-name>
    </security-role-assignment>
    <security-role-assignment>
    <role-name>Administrators</role-name>
    <principal-name>weblogic</principal-name>
    </security-role-assignment>
    <jsp-descriptorw>
    <page-check-seconds>1</page-check-seconds>
    <verbose>true</verbose>
    </jsp-descriptorw>
    </weblogic-web-app>

    #255625 Reply

    Riyad Kalla
    Member

    Yea I see that too, will keep evaluating.

    #255626 Reply

    Riyad Kalla
    Member

    More notes. BEA docs reference the small header that provides no validation or autocomplete:
    http://e-docs.bea.com/wls/docs92/medrec_tutorials/webappdd.html

    And make no menson of it in their deployment descriptor doc:
    http://e-docs.bea.com/wls/docs90/webapp/weblogic_xml.html

    But then for their BeeHive app they give a full deployment descriptor:
    http://edocs.bea.com/wls/docs90/beehive/building_beehive.html

    And importing that one into MyEclipse, NetBeans and importing the schema and the sample weblogic.xml file into this online validator:
    http://tools.decisionsoft.com/schemaValidate/

    ALL show errors for the same reason:
    “src-resolve: Cannot resolve the name ‘j2ee:servlet-nameType’ to a(n) ‘type definition’ component.”

    and
    “src-resolve.4.2: Error resolving component ‘j2ee:emptyType’. It was detected that ‘j2ee:emptyType’ is in namespace ‘http://java.sun.com/xml/ns/j2ee&#8217;, but components from this namespace are not referenceable from schema document ‘http://www.bea.com/ns/weblogic/90/weblogic-application.xsd&#8217;. If this is the incorrect namespace, perhaps the prefix of ‘j2ee:emptyType’ needs to be changed. If this is the correct namespace, then an appropriate ‘import’ tag should be added to ‘http://www.bea.com/ns/weblogic/90/weblogic-application.xsd&#8217;.”

    So as far as I can tell, these sample docs from weblogic’s main docs that use the simple ns definition are correct and using the full definition does not work and is not valid for whatever reason.

    #255706 Reply

    😕

    #255717 Reply

    Riyad Kalla
    Member

    I know, tell me about it. This bug has been a personal pet peeve for a while, but now it seems it’s not a bug. Atleast the 3 tools I tried I cannot get the “Example” weblogic.xml file to validate, so it seems MyEclipse is not alone. Then I checked all the demo apps that ship with WL, and none of them use that long header, just the short one (wth the single namespace).

    I’m happy to keep investigating if I got something wrong, but so far things check out A-OK on our end.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: weblogic.xml (for WL 9.1) MyEclipse wrongly shows error

You must be logged in to post in the forum log in