glassfish
  1. glassfish
  2. GLASSFISH-20267

Spurious warning about invalid beans.xml

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Works as designed
    • Affects Version/s: 4.0_b82_EE7MS7
    • Fix Version/s: None
    • Component/s: cdi
    • Labels:
      None

      Description

      When deploying a sample web application, I see the following warning in the server log:

      [2013-04-10T20:31:07.463+0200] [glassfish 4.0] [WARNING] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1365618667463] [levelValue: 900] [[
        WELD-001208 Error when validating jar:file:/home/hwellmann/gf/glassfish-4.0-b82/glassfish/domains/domain1/applications/pax-exam-sample7-web/WEB-INF/lib/pax-exam-sample7-service-3.1.0-SNAPSHOT.jar!/META-INF/beans.xml@18 against xsd. cvc-elt.1: Deklaration des Elements "beans" kann nicht gefunden werden.]]
      

      (Meaning: "Declaration of 'beans' element cannot be found)

      My beans.xml is valid. The warning disappears when setting user.language=en in domain.xml jvm-options.

        Activity

        Hide
        TangYong added a comment -

        hwellmann

        Whether your sample is PaxExam CDI integration? If possible, could you please tell me how to obtain your sample,
        I suggest putting your sample into your github repo.

        Thanks
        --Tang

        Show
        TangYong added a comment - hwellmann Whether your sample is PaxExam CDI integration? If possible, could you please tell me how to obtain your sample, I suggest putting your sample into your github repo. Thanks --Tang
        Show
        Harald Wellmann added a comment - You can find the sample here: https://github.com/ops4j/org.ops4j.pax.exam2/tree/master/samples/pax-exam-sample7-web
        Hide
        tlcksnyder added a comment -

        what locale & os are you using? Ran with LANG=de_DE.UTF-8, matching LC, & user.language. Could not reproduce on 4/17 GF nightly & build of pax-exam-sample7-web from 4/17.

        Show
        tlcksnyder added a comment - what locale & os are you using? Ran with LANG=de_DE.UTF-8, matching LC, & user.language. Could not reproduce on 4/17 GF nightly & build of pax-exam-sample7-web from 4/17.
        Hide
        Harald Wellmann added a comment -

        I'm using Ubuntu 12.04 LTS with de_DE.UTF-8.

        I'll attach a simple self-contained sample project: the message is caused by a beans.xml file containing nothing but <beans/>. The message disappears when you add the correct namespace definition.

        I don't know if the namespace is really required by the CDI spec, but it does make some sense for Weld to complain.

        What doesn't make sense to me is that the message disappears when changing the locale.

        I copied my sample WAR to domains/domain1/autodeploy and started GlassFish with

        LANG=de_DE.UTF-8 bin/asadmin start-domain --verbose

        In this case the error message appears. Using any of LANG=de_DE (without UTF-8) or LANG=C, LANG=en, LANG=en_US, LANG=en_US.UTF-8 the message does not appear.

        So my original problem description was incorrect, the warning is not spurious, but its presence should not depend on the locale, and there appears to be an issue with resource bundle lookup.

        Show
        Harald Wellmann added a comment - I'm using Ubuntu 12.04 LTS with de_DE.UTF-8. I'll attach a simple self-contained sample project: the message is caused by a beans.xml file containing nothing but <beans/>. The message disappears when you add the correct namespace definition. I don't know if the namespace is really required by the CDI spec, but it does make some sense for Weld to complain. What doesn't make sense to me is that the message disappears when changing the locale. I copied my sample WAR to domains/domain1/autodeploy and started GlassFish with LANG=de_DE.UTF-8 bin/asadmin start-domain --verbose In this case the error message appears. Using any of LANG=de_DE (without UTF-8) or LANG=C, LANG=en, LANG=en_US, LANG=en_US.UTF-8 the message does not appear. So my original problem description was incorrect, the warning is not spurious, but its presence should not depend on the locale, and there appears to be an issue with resource bundle lookup.
        Hide
        Harald Wellmann added a comment -

        Creating attachments seems to be forbidden (why?). I'm using a very trivial webapp with the following contents:

        package com.blogspot.hwellmann.gf20267;

        import javax.enterprise.inject.Model;

        @Model
        public class HelloBean {

        public String getMessage()

        { return "Glassfish!"; }

        }

        WEB-INF/beans.xml:

        <beans>
        </beans>

        /hello.xhtml

        <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets">
        <body>
        <h1>Hello #

        {helloBean.message}

        </h1>
        </body>
        </html>

        WEB-INF/faces-config.xml

        <?xml version="1.0" encoding="UTF-8"?>

        <faces-config
        xmlns="http://java.sun.com/xml/ns/javaee"
        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-facesconfig_2_0.xsd"
        version="2.0">

        </faces-config>

        Show
        Harald Wellmann added a comment - Creating attachments seems to be forbidden (why?). I'm using a very trivial webapp with the following contents: package com.blogspot.hwellmann.gf20267; import javax.enterprise.inject.Model; @Model public class HelloBean { public String getMessage() { return "Glassfish!"; } } WEB-INF/beans.xml: <beans> </beans> /hello.xhtml <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <body> <h1>Hello # {helloBean.message} </h1> </body> </html> WEB-INF/faces-config.xml <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" 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-facesconfig_2_0.xsd " version="2.0"> </faces-config>
        Hide
        jjsnyder83 added a comment -

        This is a weld issue. Please see https://issues.jboss.org/browse/WELD-1413

        Show
        jjsnyder83 added a comment - This is a weld issue. Please see https://issues.jboss.org/browse/WELD-1413

          People

          • Assignee:
            jjsnyder83
            Reporter:
            Harald Wellmann
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: