13 Replies Latest reply on Feb 10, 2003 12:45 PM by aweissman

    JBoss 3.0.4, No method permissions assigned to method=create

    claude.glauser

      Hi,

      I get the following exception:

      No method permissions assigned to method=create,interface=HOME

      I wanted to test access permissions to
      a session bean. For this, I ve'modyfied the
      getting started example (JBoss 3.0.4 ) to grant
      access to the method getNewIdentityId() to a single
      role.

      The finder methods works, for example.
      lHome is of the class TestEntityHome (of the
      getting started sample, a local interface).

      Collection myy = lHome.findAll();


      But the call to create causes the mentioned
      exception:

      TestEntityData lData = new TestEntityData();
      lData.setFirstName( "Andy" );
      lData.setLastName( "Schaefer" );
      TestEntity lEntity = lHome.create( lData );


      I think that there is something wrong with my
      jboss.xml:

      <container-configurations>
      <container-configuration>
      <container-name>Standard Stateless SessionBean</container-name>
      <security-domain>java:/jaas/other</security-domain>
      </container-configuration>

      <container-configuration>
      <container-name>Standard Stateful SessionBean</container-name>
      <security-domain>java:/jaas/other</security-domain>
      </container-configuration>
      </container-configurations>


      Please help, ant thanks for any hints !!!!!!!!!!!!!!

        • 1. Re: JBoss 3.0.4, No method permissions assigned to method=cr
          mikefinn

          I think I have seen this error when the security stuff isn't correct {or present), for the bean in err, in <assembly-descriptor> in ejb-jar.xml. Post your descriptors.

          mike

          • 2. Re: JBoss 3.0.4, No method permissions assigned to method=cr
            claude.glauser

            Here is my assembly descriptor.
            If I get this to work, I intend
            to write a little turorial.
            I have attached the whole
            ejb-jar.xml if you need
            it.

            Thanks a lot for your hints
            or in advance.

            Claude



            <!-- Assembly Descriptor -->
            <assembly-descriptor >
            <security-role>
            Echo role
            <role-name>Echo</role-name>
            </security-role>

            <method-permission>
            <role-name>Echo</role-name>

            <ejb-name>test/TestSession</ejb-name>
            <method-name>*</method-name>

            </method-permission>

            <method-permission>
            <role-name>Echo</role-name>

            <ejb-name>TestEntity</ejb-name>
            <method-name>*</method-name>

            </method-permission>

            <!-- transactions -->
            <container-transaction >

            <ejb-name>test/SequenceGenerator</ejb-name>
            <method-intf>Remote</method-intf>
            <method-name>getNextNumber</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>

            <trans-attribute>Mandatory</trans-attribute>
            </container-transaction>

            <container-transaction >

            <ejb-name>test/TestBMPEntity</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>

            <container-transaction >

            <ejb-name>test/MyEntity</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>

            <container-transaction >

            <ejb-name>TestEntity</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Supports</trans-attribute>
            </container-transaction>

            </assembly-descriptor>

            • 3. Re: JBoss 3.0.4, No method permissions assigned to method=cr
              claude.glauser

              Here is my assembly descriptor.
              If I get this to work, I intend
              to write a little turorial.
              I have attached the whole
              ejb-jar.xml if you need
              it.

              Thanks for your hints in advance.



              <!-- Assembly Descriptor -->
              <assembly-descriptor >
              <security-role>
              Echo role
              <role-name>Echo</role-name>
              </security-role>

              <method-permission>
              <role-name>Echo</role-name>

              <ejb-name>test/TestSession</ejb-name>
              <method-name>*</method-name>

              </method-permission>

              <method-permission>
              <role-name>Echo</role-name>

              <ejb-name>TestEntity</ejb-name>
              <method-name>*</method-name>

              </method-permission>

              <!-- transactions -->
              <container-transaction >

              <ejb-name>test/SequenceGenerator</ejb-name>
              <method-intf>Remote</method-intf>
              <method-name>getNextNumber</method-name>
              <method-params>
              <method-param>java.lang.String</method-param>
              </method-params>

              <trans-attribute>Mandatory</trans-attribute>
              </container-transaction>

              <container-transaction >

              <ejb-name>test/TestBMPEntity</ejb-name>
              <method-name>*</method-name>

              <trans-attribute>Required</trans-attribute>
              </container-transaction>

              <container-transaction >

              <ejb-name>test/MyEntity</ejb-name>
              <method-name>*</method-name>

              <trans-attribute>Required</trans-attribute>
              </container-transaction>

              <container-transaction >

              <ejb-name>TestEntity</ejb-name>
              <method-name>*</method-name>

              <trans-attribute>Supports</trans-attribute>
              </container-transaction>

              </assembly-descriptor>

              • 4. Re: JBoss 3.0.4, No method permissions assigned to method=cr
                claude.glauser

                Here is my assembly descriptor.
                If I get this to work, I intend
                to write a little turorial.
                I have attached the whole
                ejb-jar.xml if you need
                it.

                Thanks for your hints in advance.



                <!-- Assembly Descriptor -->
                <assembly-descriptor >
                <security-role>
                Echo role
                <role-name>Echo</role-name>
                </security-role>

                <method-permission>
                <role-name>Echo</role-name>

                <ejb-name>test/TestSession</ejb-name>
                <method-name>*</method-name>

                </method-permission>

                <method-permission>
                <role-name>Echo</role-name>

                <ejb-name>TestEntity</ejb-name>
                <method-name>*</method-name>

                </method-permission>

                <!-- transactions -->
                <container-transaction >

                <ejb-name>test/SequenceGenerator</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>getNextNumber</method-name>
                <method-params>
                <method-param>java.lang.String</method-param>
                </method-params>

                <trans-attribute>Mandatory</trans-attribute>
                </container-transaction>

                <container-transaction >

                <ejb-name>test/TestBMPEntity</ejb-name>
                <method-name>*</method-name>

                <trans-attribute>Required</trans-attribute>
                </container-transaction>

                <container-transaction >

                <ejb-name>test/MyEntity</ejb-name>
                <method-name>*</method-name>

                <trans-attribute>Required</trans-attribute>
                </container-transaction>

                <container-transaction >

                <ejb-name>TestEntity</ejb-name>
                <method-name>*</method-name>

                <trans-attribute>Supports</trans-attribute>
                </container-transaction>

                </assembly-descriptor>

                • 5. Re: JBoss 3.0.4, No method permissions assigned to method=cr
                  claude.glauser

                  Here is my assembly descriptor.
                  If I get this to work, I intend
                  to write a little turorial.


                  Thanks for your hints in advance.



                  <!-- Assembly Descriptor -->
                  <assembly-descriptor >
                  <security-role>
                  Echo role
                  <role-name>Echo</role-name>
                  </security-role>

                  <method-permission>
                  <role-name>Echo</role-name>

                  <ejb-name>test/TestSession</ejb-name>
                  <method-name>*</method-name>

                  </method-permission>

                  <method-permission>
                  <role-name>Echo</role-name>

                  <ejb-name>TestEntity</ejb-name>
                  <method-name>*</method-name>

                  </method-permission>

                  <!-- transactions -->
                  <container-transaction >

                  <ejb-name>test/SequenceGenerator</ejb-name>
                  <method-intf>Remote</method-intf>
                  <method-name>getNextNumber</method-name>
                  <method-params>
                  <method-param>java.lang.String</method-param>
                  </method-params>

                  <trans-attribute>Mandatory</trans-attribute>
                  </container-transaction>

                  <container-transaction >

                  <ejb-name>test/TestBMPEntity</ejb-name>
                  <method-name>*</method-name>

                  <trans-attribute>Required</trans-attribute>
                  </container-transaction>

                  <container-transaction >

                  <ejb-name>test/MyEntity</ejb-name>
                  <method-name>*</method-name>

                  <trans-attribute>Required</trans-attribute>
                  </container-transaction>

                  <container-transaction >

                  <ejb-name>TestEntity</ejb-name>
                  <method-name>*</method-name>

                  <trans-attribute>Supports</trans-attribute>
                  </container-transaction>

                  </assembly-descriptor>

                  • 6. Re: JBoss 3.0.4, No method permissions assigned to method=cr
                    claude.glauser

                    Here is my assembly descriptor.
                    If I get this to work, I intend
                    to write a little turorial.


                    Thanks for your hints in advance.

                    Sorry if this message appears many times,
                    i had problems with posting. My posts
                    just didn' appear.



                    <!-- Assembly Descriptor -->
                    <assembly-descriptor >
                    <security-role>
                    Echo role
                    <role-name>Echo</role-name>
                    </security-role>

                    <method-permission>
                    <role-name>Echo</role-name>

                    <ejb-name>test/TestSession</ejb-name>
                    <method-name>*</method-name>

                    </method-permission>

                    <method-permission>
                    <role-name>Echo</role-name>

                    <ejb-name>TestEntity</ejb-name>
                    <method-name>*</method-name>

                    </method-permission>

                    <!-- transactions -->
                    <container-transaction >

                    <ejb-name>test/SequenceGenerator</ejb-name>
                    <method-intf>Remote</method-intf>
                    <method-name>getNextNumber</method-name>
                    <method-params>
                    <method-param>java.lang.String</method-param>
                    </method-params>

                    <trans-attribute>Mandatory</trans-attribute>
                    </container-transaction>

                    <container-transaction >

                    <ejb-name>test/TestBMPEntity</ejb-name>
                    <method-name>*</method-name>

                    <trans-attribute>Required</trans-attribute>
                    </container-transaction>

                    <container-transaction >

                    <ejb-name>test/MyEntity</ejb-name>
                    <method-name>*</method-name>

                    <trans-attribute>Required</trans-attribute>
                    </container-transaction>

                    <container-transaction >

                    <ejb-name>TestEntity</ejb-name>
                    <method-name>*</method-name>

                    <trans-attribute>Supports</trans-attribute>
                    </container-transaction>

                    </assembly-descriptor>

                    • 7. Re ReJBoss 3.0.4, No method permissions assigned to method=c
                      claude.glauser

                      Here is my assembly descriptor.
                      If I get this to work, I intend
                      to write a little turorial.
                      I have attached the whole
                      ejb-jar.xml if you need
                      it.

                      Thanks for your hints in advance.



                      <!-- Assembly Descriptor -->
                      <assembly-descriptor >
                      <security-role>
                      Echo role
                      <role-name>Echo</role-name>
                      </security-role>

                      <method-permission>
                      <role-name>Echo</role-name>

                      <ejb-name>test/TestSession</ejb-name>
                      <method-name>*</method-name>

                      </method-permission>

                      <method-permission>
                      <role-name>Echo</role-name>

                      <ejb-name>TestEntity</ejb-name>
                      <method-name>*</method-name>

                      </method-permission>

                      <!-- transactions -->
                      <container-transaction >

                      <ejb-name>test/SequenceGenerator</ejb-name>
                      <method-intf>Remote</method-intf>
                      <method-name>getNextNumber</method-name>
                      <method-params>
                      <method-param>java.lang.String</method-param>
                      </method-params>

                      <trans-attribute>Mandatory</trans-attribute>
                      </container-transaction>

                      <container-transaction >

                      <ejb-name>test/TestBMPEntity</ejb-name>
                      <method-name>*</method-name>

                      <trans-attribute>Required</trans-attribute>
                      </container-transaction>

                      <container-transaction >

                      <ejb-name>test/MyEntity</ejb-name>
                      <method-name>*</method-name>

                      <trans-attribute>Required</trans-attribute>
                      </container-transaction>

                      <container-transaction >

                      <ejb-name>TestEntity</ejb-name>
                      <method-name>*</method-name>

                      <trans-attribute>Supports</trans-attribute>
                      </container-transaction>

                      </assembly-descriptor>

                      • 8. Re: JBoss 3.0.4, No method permissions assigned to method=cr
                        sheckler

                        Hi,
                        I get exactely the same error "No method permissions assigned to method=create, interface=HOME", when I migrate my Beans from JBoss 3.00 to 3.04 or 3.06, which work fine with JBoss 3.00. I have no explanation by now.

                        Stefan

                        • 9. Re: JBoss 3.0.4, No method permissions assigned to method=cr
                          blowagie

                          Did anybody find a solution for this problem yet???

                          • 10. Re: JBoss 3.0.4, No method permissions assigned to method=cr
                            blowagie

                            Forget my previous post, I had a mistake in my XDoclet-tags.
                            This is what they should look like:
                            /**
                            * @ejb.create-method
                            * @ejb:permission role-name="myRole"
                            */

                            • 11. Re: JBoss 3.0.4, No method permissions assigned to method=cr
                              aweissman

                              Once you start declaring method permissions on an EJB, you have to do it for all methods. Try explicitly granting permissions to your ejbCreate method, even if its 'grant all'. This should fix it.

                              Alan

                              • 12. Re: Re ReJBoss 3.0.4, No method permissions assigned to meth
                                moraelin

                                Try explicitly granting a method permission to the "create" method. For some mysterious reason, having rights assigned to "*" does _not_ seem to cover the Home interface's "create" methods. (As if it made any sense to have all the rights to a bean's methods, but no right to connect to the bean in the first place. Or viceversa.)

                                • 13. Re: JBoss 3.0.4, No method permissions assigned to method=cr
                                  aweissman

                                  Once you start declaring ejb method permissions, you have to keep going and declare them for all methods. Try adding an entry for create().

                                  I apologize if this is a repeat posting, but my first post didn't appear after 3 hours

                                  Alan