1 2 3 Previous Next 40 Replies Latest reply on Jun 11, 2008 2:09 AM by starksm64 Go to original post
      • 30. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
        alrubinger

        That's odd, the "mvn install" from "testsuite" should be taking care of that (see the dependency plugin configuration in the POM).

        You will need to "export JBOSS_HOME=/path/to/as" as well, but that'd be a different error message.

        S,
        ALR

        • 31. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
          alrubinger

          What's odd here is that "persistence" is defined:

          @XmlRootElement(name="persistence", namespace=PersistenceMetaDataConstants.PERSISTENCE_NS)
          @JBossXmlSchema(namespace=PersistenceMetaDataConstants.PERSISTENCE_NS, elementFormDefault= XmlNsForm.QUALIFIED)
          @XmlType(
          name="persistenceType",
          namespace=PersistenceMetaDataConstants.PERSISTENCE_NS,
          propOrder={"persistenceUnits"}
          )
          public class PersistenceMetaData extends JBossObject implements Serializable


          And PersistenceMetaData is configured in metadata-deployers-beans.xml.

          S,
          ALR

          • 32. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
            starksm64

            I did the install from the trunk directory, not testsuite. After doing that the test is deploying and I am seeing the "persistence is not bound as a global element" error, even though the mapping is in the metadata-deployer-beans.xml. I'll track down why.

            • 33. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
              alrubinger

               

              "scott.stark@jboss.org" wrote:
              I did the install from the trunk directory, not testsuite.


              Figured. :)

              "testsuite" is not included in the Aggregator; no need to slow down the whole build to package the integration tests most times. :)

              S,
              ALR

              • 34. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
                starksm64

                Ok, the problem is that there is no schemaLocation to map to the persistence_1_0.xsd key, and I guess the persistence key is only being used if the descriptor declares a DTD.

                <?xml version="1.0" encoding="UTF-8"?>
                <persistence>
                 <persistence-unit name="tempdb">
                 <jta-data-source>java:/DefaultDS</jta-data-source>
                 <properties>
                 <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
                 </properties>
                 </persistence-unit>
                </persistence>
                


                If I change it to use the correct namespace:
                <?xml version="1.0" encoding="UTF-8"?>
                <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
                 http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                 version="1.0">
                 <persistence-unit name="tempdb">
                 <jta-data-source>java:/DefaultDS</jta-data-source>
                 <properties>
                 <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
                 </properties>
                 </persistence-unit>
                </persistence>
                


                it deploys without any errors, but still reports 6 errors, still related to the security NCDFE:

                Testcase: testOneToMany took 0.498 sec
                 Caused an ERROR
                org/jboss/security/plugins/SecurityContextAssociation
                java.lang.NoClassDefFoundError: org/jboss/security/plugins/SecurityContextAssociation
                 at org.jboss.ejb3.security.SecurityActions$4.run(SecurityActions.java:287)
                 at org.jboss.ejb3.security.SecurityActions$4.run(SecurityActions.java:285)
                 at java.security.AccessController.doPrivileged(Native Method)
                 at org.jboss.ejb3.security.SecurityActions.getSecurityContext(SecurityActions.java:283)
                
                



                • 35. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
                  alrubinger

                  Should it be a requirement that a DTD/XSD is specified? Great practice, but an imposition to place upon our users.

                  If yes, I'll fix all the tests and also the NCDFE.

                  S,
                  ALR

                  • 36. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
                    starksm64

                    Its definitely required for the previous javaee descriptors where there are multiple versions, so I don't see this as much of a requirement.

                    The reason the simple persistence key is not working is that when the PersistenceMetaData is resolved, its jaxb @XmlRootElement declares a namespace that does not match the empty namespace used by the descriptor. In general proper namespaces are needed.

                    • 37. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
                      alrubinger

                      EJB3 Persistence Spec 6.2.1 has samples that do not include a DTD or XSD declaration.

                      Section 7.1.1 is a bit vauge as to whether the descriptor requires this information:

                      When the container finds a persistence.xml file, it processes the persistence unit definitions that it contains. The container must validate the persistence.xml file against the persistence_1_0.xsd schema and report any validation errors.


                      In any case, we'll need a more friendly error message to give the bean provider some sense of why the deployment failed.

                      S,
                      ALR

                      • 38. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
                        starksm64

                        Since the persistence_1_0.xsd schema specifically declares a targetNamespace, the descriptors will have to match it to validate. The persistence_1_0.xsd docs say the persistence namespace must be used as well:

                        "persistence_1_0.xsd" wrote:

                        Persistence configuration files must indicate
                        the persistence schema by using the persistence namespace:

                        http://java.sun.com/xml/ns/persistence

                        and indicate the version of the schema by
                        using the version element as shown below:

                        <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
                        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                        version="1.0">
                        ...
                        </persistence>



                        • 39. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
                          alrubinger

                          That's the piece I was looking for, thanks.

                          Who should I talk to regarding a better error message (even something as simple as "Could not deploy; no XSD or DTD on [file] was declared" would do)?

                          S,
                          ALR

                          • 40. Re: trunk Ejb3Deployment is incompatible with jbossas trunk
                            starksm64

                            Its jbossxb that could be reporting more info like the element namespace or lack there of.

                            1 2 3 Previous Next