1 2 Previous Next 15 Replies Latest reply on Aug 29, 2008 4:29 PM by ceduardo.roque

    Identity Authentication problem

    ceduardo.roque
      Hi fellows,

      I'm trying to code my first identity authentication control and I'm having an error that must be usual to you. The error shown on JBoss Log is:

      = No authentication method defined - please define authenticate-method for <security:identity/> in components.xml =

      I've read the post below and did exactly as our friend Kenneth told, and it still doesn't work.


      http://www.seamframework.org/Community/SeamLoginModuleNoAuthenticationMethodDefined

      My EAR file is composed by an EJBJAR file and an EJBWAR file. The EAR File is composed like it's shown below:


      EAR file
           /lib
               jboss-el.jar
           /META-INF
               application.xml
               MANIFEST.MF
           jboss-seam.jar
           EJBJAR.jar
               <packages>+<classes>
               META-INF
                    ejb-jar.xml
                    MANIFEST.MF
               components.properties
               seam.properties
            APPWAR.war
               META-INF
                   MANIFEST.MF
               WEB-INF
                   /classes
                        <nothing>
                   /lib
                        axis.jar
                        commons-beanutils.jar
                        commons-digester.jar
                        commons-discovery-0.2.jar
                        commons-logging.jar
                        el-ri.jar
                        jaxrpc.jar
                        jboss-seam.jar
                        jsf-facelets.jar
                        richfaces-api-3.2.1.GA.jar
                        richfaces-impl-3.2.1.GA.jar
                        richfaces-ui-3.2.1.GA.jar
                        saaj.jar
                        wsdl4j-1.5.1.jar
                   components.xml
                   faces-config.xml
                   pages.xml
                   web.xml

      My components.xml file is listed below:

      `<core:init debug="true" jndi-pattern="@jndiPattern@"/>  
          <core:manager conversation-timeout="120000"
                        concurrent-request-timeout="500"
                        conversation-id-parameter="cid"/>

          <transaction:ejb-transaction/>

          <security:identity authenticate-method="#{Autenticador.autenticar}" remember-me="true"/>`

      My class that authenticates de user is here:


      `
      @Stateless
      @Name("Autenticador")
      public class AutenticadorBean implements Autenticador {
             
          @In
          private Identity identity;

             
              public boolean autenticar() {
                      return true;
              }
      }

      And the page form is here:

      |                                               <h:form id="Form">
                                                                      <br/>
                                                                      <br/>
                                                                      <br/>
                                                                      <br/>
                                                                      <br/>
                                                                      <h:panelGrid columns="4">
                                                                              <h:outputText style="font: Verdana; font-size: 14px; font-weight: bold; color: #000000;" value="* Hierarquia:" /><h:inputText style="width: 150px"/><h:inputText style="width: 300px"/><h:commandButton value="..."/>
                                                                              <h:outputText style="font: Verdana; font-size: 14px; font-weight: bold; color: #000000;" value="  * Usuário:" /><h:inputText value="#{identity.username}" style="width: 150px"/><h:inputText style="width: 300px"/><h:outputText value=""/>
                                                                              <h:outputText style="font: Verdana; font-size: 14px; font-weight: bold; color: #000000;" value="    * Senha:" /><h:inputText value="#{identity.password}" style="width: 150px"/>
                                                                      </h:panelGrid>
                                                                      <h:panelGrid columns="2">
                                                                              <h:commandButton value="OK" action="#{identity.login}"/>
                                                                              <h:commandButton value="Cancelar"/>
                                                                      </h:panelGrid>
                                                              </h:form>|


      Is anybody seeing something that I'm not?

      I hope somebody can help.

      Thank you in advance.

        • 1. Re: Identity Authentication problem
          diegocoronel

          is this method:


          public boolean autenticar();



          defined in interface Autenticador ?

          • 2. Re: Identity Authentication problem
            ceduardo.roque

            Yes, it is.


            Below follows the Local interface.


            @Local
            public interface Autenticador {


                 public boolean autenticar();
            }



            Thank you for the response.


            • 3. Re: Identity Authentication problem
              diegocoronel

              I dont think thats the problem but you are with 2 jboss-seam.jar in EAR and WEB-INF/lib, you should and only the EAR jar and declare it in application.xml

              • 4. Re: Identity Authentication problem
                tony.herstell1

                One of those richfaces jar files should also be in the EAR and defined in the application.xml (well at leat it is on my EAR project!)..



                Project not to hand otherwise I would say which one.

                • 5. Re: Identity Authentication problem
                  blabno

                  Totally wrong ! Richfaces should be in EAR only if you will be passing objects back and fourth between EJB module and Web module (i.e.:ui binding). If not then you don't need richfaces in EAR. And I do not know what do you need any richfaces in application.xml for ? You put there only EJB and Web modules.


                  BTW. It is not good idea to put UI binding in EJB module. It is better to make pojo in Web module that has injected EJB with business logic only.


                  The problem is, as you noticed, with double jboss-seam.jar. It is almost always bad idea do multi located jars in single EAR.


                  Carlos : I'm using axis too :) good luck.

                  • 6. Re: Identity Authentication problem
                    ceduardo.roque

                    Diego Coronel wrote on Aug 29, 2008 05:04:


                    I dont think thats the problem but you are with 2 jboss-seam.jar in EAR and WEB-INF/lib, you should and only the EAR jar and declare it in application.xml


                    Actually I followed the Seam Reference PDF to build this structure. On the beggining I was letting Eclipse build the EAR, WAR and EJB jar file, but, accorting the the post I've put above, our friend Kenneth I needed to put jboss-el.jar on the EAR lib directory, and my Eclipse wasn't doing that. So, I decided to build an ANT script to build it myself, and to build the EJB, WAR and EAR files on my own.


                    Even doing that it didn't work, so I decided to post it here.


                    :-(


                    I don't know if there is something wrong, but accordingly to Seam Reference PDF, on page 13, it's put only the jboss-seam.jar and jboss-el.jar on application.xml.


                    I'll try to take the jboss-seam.jar off the war file, and see if it works, but I don't think this is the main problem.


                    Thank you all in advance.


                    Best Regards,


                    Carlos Eduardo

                    • 7. Re: Identity Authentication problem
                      ceduardo.roque

                      Diego Coronel wrote on Aug 29, 2008 05:04:


                      I dont think thats the problem but you are with 2 jboss-seam.jar in EAR and WEB-INF/lib, you should and only the EAR jar and declare it in application.xml


                      Actually I followed the Seam Reference PDF to build this structure. On the beggining I was letting Eclipse build the EAR, WAR and EJB jar file, but, accorting the the post I've put above, our friend Kenneth I needed to put jboss-el.jar on the EAR lib directory, and my Eclipse wasn't doing that. So, I decided to build an ANT script to build it myself, and to build the EJB, WAR and EAR files on my own.


                      Even doing that it didn't work, so I decided to post it here.


                      :-(


                      I don't know if there is something wrong, but accordingly to Seam Reference PDF, on page 13, it's put only the jboss-seam.jar and jboss-el.jar on application.xml.


                      I'll try to take the jboss-seam.jar off the war file, and see if it works, but I don't think this is the main problem.


                      Thank you all in advance.


                      Best Regards,


                      Carlos Eduardo

                      • 8. Re: Identity Authentication problem
                        ceduardo.roque

                        Hi Tony.


                        I aggree with Bernard. I'm not using richfaces components on EJB module. So I don't have to put it on my application.xml.


                        Bu thank you for trying to help.


                        Carlos Eduardo

                        • 9. Re: Identity Authentication problem
                          ceduardo.roque

                          Hi Bernard,


                          As I have told before, I'll try to remove the jboss-seam.jar from my WAR file. I hope it works.


                          Thank you for the reply.


                          BTW, I forgot telling you all the environment I'm using:


                          JBoss 4.2.2 GA (I had problems with JBoss 4.2.3 GA.. something with the phase listener stuff... only by replacing the JBoss to 4.2.2 it worked... strange isn't it?
                          Eclipse Europa
                          JBoss Seam 2.0.2. SP1


                          Regards,


                          Carlos Eduardo

                          • 10. Re: Identity Authentication problem
                            blabno

                            I'm using 4.2.3GA without any problems. The only problem with phase listener was that it was loaded twice for my deployment was exploded and I had jboss-seam.jar on Class-Path in war/META-INF/MANIFEST.MF. I did not need jboss-seam.jar on that class path so I removed it and problem was gone. Problem disappeared also when depoyment was in form of packaged archive.

                            • 11. Re: Identity Authentication problem
                              blabno

                              Sorry for spreading panic. Problem was not in Class-Path attribute in MANIFEST.MF but the presence of jboss-seam.jar in WEB-INF/lib (while it was also in EAR/).

                              • 12. Re: Identity Authentication problem
                                ceduardo.roque

                                Hi Diego,


                                Yes, it worked. I took jboss-seam.jar off the WAR file LIB directory and it worked fine.


                                But I keep thinking why it hapenned. Probably during deployment, JBoss finds jboss-seam.jar inside the WAR file and loads it in a smaller class loader, what makes EJB container doesn't work properly as if it was using a libraly listed on the EAR file.


                                I don't know... but it worked. Thank you for help.

                                • 13. Re: Identity Authentication problem
                                  ceduardo.roque

                                  Hi Bernard.


                                  I aggree with you...


                                  Yes, it worked. I took jboss-seam.jar off the WAR file LIB directory and it worked fine. And it worked WITH JBoss 4.2.3...


                                  But like I said to Diego, I'm thinking:


                                  Why did it happen? Probably during deployment, JBoss finds jboss-seam.jar inside the WAR file and loads it in a smaller class loader, what makes EJB container doesn't work properly as if it was using a libraly listed on the EAR file.


                                  I still don't know... but thank you for the effort in helping me.


                                  Best Regards.


                                  Carlos Eduardo

                                  • 14. Re: Identity Authentication problem
                                    blabno
                                    1 2 Previous Next