1 2 Previous Next 15 Replies Latest reply on Oct 14, 2005 8:41 AM by aloubyansky

    how to get rid of these warnings?

    bill.burke

      I'm running outside of jboss and getting these warning. Please exuse my ignorance of XML parsing.

       [java] WARN 14-09 13:47:55,939 (JBossEntityResolver.java:getLocalEntityName:201) -Entity is not registered, publicId=null systemId=file:/home/wburke/jboss/jboss-head/ejb3/conf/bean-deployer_1_0.xsd
       [java] WARN 14-09 13:47:55,951 (SaxJBossXBParser.java:warning:226) -schema_reference.4: Failed to read schema document 'bean-deployer_1_0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. @ file:/home/wburke/jboss/jboss-head/ejb3/conf/embedded-jboss-beans.xml[5,45]
      


      This is what my MC XML looks like:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
       xmlns="urn:jboss:bean-deployer">
       <bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>
      


      Thanks


        • 1. Re: how to get rid of these warnings?

          I think that is really a question for JBossXB?

          I could hack around it since I know it uses the JBossEntityResolver
          http://docs.jboss.org/jbossas/javadoc/4.0.2/org/jboss/util/xml/JBossEntityResolver.html#registerEntity(java.lang.String,%20java.lang.String)

          But that isn't going to solve the problem when we introduce "ANY" processing.

          Actually, you just reminded me of something I missed/forgot :-(
          http://jira.jboss.com/jira/browse/JBAS-2257

          • 2. Re: how to get rid of these warnings?
            starksm64

            I have a thread on entity/schema resolution in JBossXB that has not gotten too far. The only registry that exists today is the JBossEntityResolver, but its configuration is lacking. The catch all resolution notion that it current has is something like this logic:

             String uri = ...;
             ClassLoader loader = ...;
             URL schemaOrDtdURL = null;
             if( uri.endsWith(".dtd") )
             schemaOrDtdURL = loader.findResource("dtd/"+uri);
             else if( uri.endsWith(".xsd") )
             schemaOrDtdURL = loader.findResource("schema/"+uri);
            
            


            so if the dtds/xsds reside somewhere on the classpath under the correct directory they should be found. The JBossEntityResolver also has a registry of well known public names and dtd/schema names that allow for explicit matching.


            • 3. Re: how to get rid of these warnings?

              So this is just a problem of location within the jar file:

              adrian@adrian-srv01:~/jboss-4.0/workspace/thirdparty/jboss/microcontainer/lib> jar -tf jboss-microcontainer.jar | grep xsd
              bean-deployer_1_0.xsd
              


              At least until something better comes along.

              • 4. Re: how to get rid of these warnings?
                starksm64

                Yes, I think so. We need to have consistent packaging/naming conventions in line with whatever the JBossEntityResolver logic is. Ultimately this needs to be an xmlcatalog like thing with flexible namespace to dtd/xsd resolution via classpath or codebase.

                • 5. Re: how to get rid of these warnings?

                  Argh!

                  Now that it is finding the schema properly, it shows the schema is invalid.
                  There are some minOccurs that should be zero.

                  I can't fix it at the moment:
                  http://www.jboss.org/index.html?module=bb&op=viewtopic&t=69265

                  There is still this coming from somewhere, still to investigate...
                  "2437 WARN [org.xml.sax.EntityResolver] Entity is not registered, publicId=null systemId=file:/home/adrian/jboss-head/workspace/kernel/src/r
                  esources/xml-test/org/jboss/test/kernel/config/test/bean-deployer_1_0.xsd"

                  • 6. Re: how to get rid of these warnings?
                    starksm64

                    How do I test this?

                    • 7. Re: how to get rid of these warnings?
                      • 8. Re: how to get rid of these warnings?
                        bill.burke

                         

                        "adrian@jboss.org" wrote:
                        Argh!

                        Now that it is finding the schema properly, it shows the schema is invalid.
                        There are some minOccurs that should be zero.

                        I can't fix it at the moment:
                        http://www.jboss.org/index.html?module=bb&op=viewtopic&t=69265

                        There is still this coming from somewhere, still to investigate...
                        "2437 WARN [org.xml.sax.EntityResolver] Entity is not registered, publicId=null systemId=file:/home/adrian/jboss-head/workspace/kernel/src/r
                        esources/xml-test/org/jboss/test/kernel/config/test/bean-deployer_1_0.xsd"


                        As a hack, I added the following to JBossEntityResolver.

                        registerEntity("urn:jboss:bean-deployer bean-deployer_1_0.xsd", "bean-deployer_1_0.xsd");


                        Unfortunately, I get the following specified in this forum post.
                        http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3895024#3895024

                        Intellij posts the same error for me.



                        • 9. Re: how to get rid of these warnings?

                          The links are a bit circular :-)
                          Can you confirm the current problem?
                          Are you using the xsd I committed last night in jboss-head?

                          • 10. Re: how to get rid of these warnings?
                            bill.burke

                            Ok, problem is solved with latest from CVS. Thanks for fixing the schema.

                            • 11. Re: how to get rid of these warnings?

                               

                              "adrian@jboss.org" wrote:

                              There is still this coming from somewhere, still to investigate...
                              "2437 WARN [org.xml.sax.EntityResolver] Entity is not registered, publicId=null systemId=file:/home/adrian/jboss-head/workspace/kernel/src/r
                              esources/xml-test/org/jboss/test/kernel/config/test/bean-deployer_1_0.xsd"


                              This was just stupid. It logs the warning even though it is going to use
                              bean-deployer_1_0.xsd anyway.

                              It is just telling you it wasn't explicitly registered with the resolver.

                              I moved this logging to TRACE level and added some more TRACE logging
                              to help debug entity resolution problems in future.

                              • 12. Re: how to get rid of these warnings?
                                bill.burke

                                FYI, I changed JBossEntityResolve to register the bean xsd

                                • 13. Re: how to get rid of these warnings?
                                  starksm64

                                  There still are spurious warnings even with the removal of the warnings at the DefaultSchemaResolver level because the JBossEntityResolver does not try to load systemIDs that are valid URLs. One example is:

                                  <jaas:policy
                                   xsi:schemaLocation="urn:jboss:security-config resource:security-config_4_1.xsd"
                                   xmlns:jaas="urn:jboss:security-config"
                                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                   >
                                  
                                  


                                  2005-09-22 08:08:58,859 WARN [org.jboss.xb.binding.parser.sax.SaxJBossXBParser]
                                   schema_reference.4: Failed to read schema document 'resource:security-config_4_1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. @ *unknown*[8,5]
                                  


                                  I create a http://jira.jboss.com/jira/browse/JBAS-2282 issue for this. It seems that the logic for the JBossEntityResolver.resolveEntity(String publicId, String systemId) method should be:

                                  ...
                                   // Try to resolve the publicID against the registered IDs
                                   InputSource inputSource = resolvePublicID(publicId);
                                  
                                   if( inputSource == null )
                                   {
                                   // Try to resolve the systemID as a absolute URL
                                   inputSource = resolveSystemID(systemId);
                                   }
                                  
                                   if( inputSource == null )
                                   {
                                   // Try to resolve the systemID as as a classpath reference under dtd or schema
                                   inputSource = resolveClasspathName(systemId);
                                   }
                                  
                                  



                                  • 14. Re: how to get rid of these warnings?

                                    We have acquired a new warning:

                                    1585 WARN [XsdBinder] NOT HANDLED WILDCARD IN GLOBAL MODEL GROUP
                                    


                                    1 2 Previous Next