9 Replies Latest reply on Jan 22, 2008 3:07 PM by anil.saldhana

    jboss-structure help needed

    anil.saldhana

      The ejb jar looks as follows:

      jar tvf jca-securedejb.jar
       0 Sat Dec 08 12:05:56 CST 2007 META-INF/
       106 Sat Dec 08 12:05:54 CST 2007 META-INF/MANIFEST.MF
       0 Sat Dec 08 12:04:18 CST 2007 org/
       0 Sat Dec 08 12:04:00 CST 2007 org/jboss/
       0 Sat Dec 08 12:04:18 CST 2007 org/jboss/test/
       0 Sat Dec 08 12:04:12 CST 2007 org/jboss/test/jca/
       0 Sat Dec 08 12:04:12 CST 2007 org/jboss/test/jca/securedejb/
       369 Sat Dec 08 12:04:12 CST 2007 org/jboss/test/jca/securedejb/CallerIdentity.class
       6472 Sat Dec 08 12:04:12 CST 2007 org/jboss/test/jca/securedejb/CallerIdentityBean.class
       326 Sat Dec 08 12:04:12 CST 2007 org/jboss/test/jca/securedejb/CallerIdentityHome.class
       13042 Sat Dec 08 12:05:54 CST 2007 notxfs.rar
       4244 Sat Dec 08 12:02:52 CST 2007 META-INF/ejb-jar.xml
       2320 Sat Dec 08 12:02:32 CST 2007 META-INF/jboss.xml
       2150 Sat Dec 08 12:02:46 CST 2007 calleridentity-ds.xml
       3730 Sat Dec 08 12:02:26 CST 2007 login-config.xml
       631 Sat Dec 08 12:02:28 CST 2007 notxfs-ds.xml
      


      There are two DS files and a login-config.xml in the deployment.

      I tried a jboss-structure.xml as follows:
      <structure>
       <context>
       <path name=""/>
       <metaDataPath>
       <path name="META-INF"/>
       <path name="calleridentity-ds.xml"/>
       <path name="login-config.xml"/>
       <path name="notxfs-ds.xml"/>
       </metaDataPath>
       <classpath>
       <path name=""/>
       </classpath>
       </context>
      </structure>
      


      I saw errors such as:
      2008-01-21 14:31:44,953 DEBUG [org.jboss.deployers.vfs.plugins.structure.Abstrac
      tVFSDeploymentContext] Error retrieving meta data: name=null suffix=-beans.xml^M
      java.lang.IllegalStateException: File cannot contain children: JarEntryHandler@3
      1854819[path=calleridentity-ds.xml context=file:/C:/cygwin/home/asaldhana/jboss-
      5.0/jboss-head/testsuite/output/lib/jca-securedejb.jar real=jar:file:/C:/cygwin/
      home/asaldhana/jboss-5.0/jboss-head/testsuite/output/lib/jca-securedejb.jar!/cal
      leridentity-ds.xml]^M
       at org.jboss.virtual.VirtualFile.getChildren(VirtualFile.java:305)^M
       at org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentContex
      t.getMetaDataFiles(AbstractVFSDeploymentContext.java:238)^M
       at org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentUnit.g
      


      I tried the .xml files outside the METADataPath in the structure file in vain.

      Can you please give me some examples of jboss-structure files?

      The test in question is:
      org.jboss.test.jca.test.SecurityContextUnitTestCase
      


        • 1. Re: jboss-structure help needed
          starksm64

          Looks like the same problem I'm working on for http://jira.jboss.org/jira/browse/JBAS-5151. The root of the deployment is in the classpath and resources under it should be found. I'm working on a test in the mc project for this.

          • 2. Re: jboss-structure help needed
            alesj

             

            "anil.saldhana@jboss.com" wrote:

            I tried the .xml files outside the METADataPath in the structure file in vain.

            Can you try this:
            <metaDataPath>
             <path name="META-INF"/>
             <path name=""/>
            </metaDataPath>
            


            • 3. Re: jboss-structure help needed
              anil.saldhana

               

              org.jboss.deployers.spi.DeploymentException: Only one file is allowed, found=[Ja
              rEntryHandler@29129210[path=calleridentity-ds.xml context=file:/C:/cygwin/home/a
              saldhana/jboss-5.0/jboss-head/testsuite/output/lib/jca-securedejb.jar real=jar:f
              ile:/C:/cygwin/home/asaldhana/jboss-5.0/jboss-head/testsuite/output/lib/jca-secu
              redejb.jar!/calleridentity-ds.xml], JarEntryHandler@15480059[path=notxfs-ds.xml
              context=file:/C:/cygwin/home/asaldhana/jboss-5.0/jboss-head/testsuite/output/lib
              /jca-securedejb.jar real=jar:file:/C:/cygwin/home/asaldhana/jboss-5.0/jboss-head
              /testsuite/output/lib/jca-securedejb.jar!/notxfs-ds.xml]]
               at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse
              (AbstractVFSParsingDeployer.java:108)
               at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
              utput.createMetaData(AbstractParsingDeployerWithOutput.java:225)
               at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
              utput.createMetaData(AbstractParsingDeployerWithOutput.java:199)
               at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
              utput.deploy(AbstractParsingDeployerWithOutput.java:162)
              


              • 4. Re: jboss-structure help needed
                starksm64

                A jboss-structure.xml should not be needed. The problem is that the local login-config.xml resource is not being found preferentially over the conf/login-config.xml. The DynamicLoginConfig service is loading that url:

                vfsfile:/home/svn/JBossHead/jboss-head/build/output/jboss-5.0.0.Beta4/server/default/conf/login-config.xml


                and so the custom login config names are all mapping to the default login config, and there are no users/roles.properties found.

                • 5. Re: jboss-structure help needed
                  alesj

                   

                  "anil.saldhana@jboss.com" wrote:
                  org.jboss.deployers.spi.DeploymentException: Only one file is allowed, found=[Ja
                  rEntryHandler@29129210[path=calleridentity-ds.xml context=file:/C:/cygwin/home/a
                  saldhana/jboss-5.0/jboss-head/testsuite/output/lib/jca-securedejb.jar real=jar:f
                  ile:/C:/cygwin/home/asaldhana/jboss-5.0/jboss-head/testsuite/output/lib/jca-secu
                  redejb.jar!/calleridentity-ds.xml], JarEntryHandler@15480059[path=notxfs-ds.xml
                  context=file:/C:/cygwin/home/asaldhana/jboss-5.0/jboss-head/testsuite/output/lib
                  /jca-securedejb.jar real=jar:file:/C:/cygwin/home/asaldhana/jboss-5.0/jboss-head
                  /testsuite/output/lib/jca-securedejb.jar!/notxfs-ds.xml]]
                   at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse
                  (AbstractVFSParsingDeployer.java:108)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
                  utput.createMetaData(AbstractParsingDeployerWithOutput.java:225)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
                  utput.createMetaData(AbstractParsingDeployerWithOutput.java:199)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
                  utput.deploy(AbstractParsingDeployerWithOutput.java:162)
                  

                  Ah, yes, JBMICROCONT-184.
                  Need to touch on that subject asap.

                  • 6. Re: jboss-structure help needed
                    anil.saldhana

                     

                    "scott.stark@jboss.org" wrote:
                    A jboss-structure.xml should not be needed. The problem is that the local login-config.xml resource is not being found preferentially over the conf/login-config.xml. The DynamicLoginConfig service is loading that url:

                    vfsfile:/home/svn/JBossHead/jboss-head/build/output/jboss-5.0.0.Beta4/server/default/conf/login-config.xml


                    and so the custom login config names are all mapping to the default login config, and there are no users/roles.properties found.


                    Scott, I understand that the custom application policies are not being found, hence it is defaulting to "other". But what I do not understand is from where is the DynamicLoginConfigService kicking in, for this test case? It is neither explicitly defined in this test deployment nor anything is done from the test case.




                    • 7. Re: jboss-structure help needed

                       

                      "alesj" wrote:
                      "anil.saldhana@jboss.com" wrote:

                      I tried the .xml files outside the METADataPath in the structure file in vain.

                      Can you try this:
                      <metaDataPath>
                       <path name="META-INF"/>
                       <path name=""/>
                      </metaDataPath>
                      


                      What on earth are you doing?

                      The -ds.xml files in the root are subdeployments and the login-config.xml
                      is a resource. None of these are metadata (unless you are going to write
                      a new securty deployer that creates policies from META-INF/login-config.xml).

                      Can you please give me some examples of jboss-structure files?
                      


                      Have you tried looking the testsuite?

                      For future reference, the jboss-structure.xml should have looked
                      something like this:

                      <structure>
                       <!-- Here I define the root context name="" -->
                       <context>
                       <path name=""/>
                      
                       <!-- metadata is in META-INF -->
                       <metaDataPath>
                       <path name="META-INF"/>
                       </metaDataPath>
                      
                       <!-- Classpath is the root -->
                       <classpath>
                       <path name=""/>
                       </classpath>
                       </context>
                      
                       <!-- Here I define a subdeployment, it has not metadata or classpath since it is just a file-->
                       <context name="notxfs-ds.xml"/>
                      
                       <!-- etc -->
                      </structure>
                      


                      But these should be the default rules anyway.

                      • 8. Re: jboss-structure help needed

                         

                        "anil.saldhana@jboss.com" wrote:

                        Scott, I understand that the custom application policies are not being found, hence it is defaulting to "other". But what I do not understand is from where is the DynamicLoginConfigService kicking in, for this test case? It is neither explicitly defined in this test deployment nor anything is done from the test case.


                        From calleridentity-ds.xml

                         <local-tx-datasource>
                         <jndi-name>RunAsIdentityDS</jndi-name>
                         <connection-url>jdbc:hsqldb:mem:RunAsIdentityDB</connection-url>
                         <driver-class>org.hsqldb.jdbcDriver</driver-class>
                         <!-- The default login and password used for run-as -->
                         <user-name>sa</user-name>
                         <password></password>
                         <security-domain-and-application>RunAsIdentityDSRealm</security-domain-and-application>
                         <metadata>
                         <type-mapping>Hypersonic SQL</type-mapping>
                         </metadata>
                         </local-tx-datasource>
                        
                         <mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
                         name="jboss.security.tests:service=SecuritySpecLoginConfig">
                         <attribute name="AuthConfig">login-config.xml</attribute>
                         <depends optional-attribute-name="LoginConfigService">
                         jboss.security:service=XMLLoginConfig
                         </depends>
                         <depends optional-attribute-name="SecurityManagerService">
                         jboss.security:service=JaasSecurityManager
                         </depends>
                         </mbean>
                        


                        Which also contains a further known bug (FAQ), in that the security MBean is deployed
                        after the datasource (they are deployed in file order).


                        • 9. Re: jboss-structure help needed
                          anil.saldhana

                          Thanks Adrian. I had forgotten that -ds.xml can also define the mbean defs.