3 Replies Latest reply on Jun 25, 2009 10:12 AM by specter

    Please help Seam 2.1.2

    specter

      Hello I am sorry if i am not supposed to put here this but I have no idea where to ask help.I searched google I tried various sites and nothing. I have a project that was made using seamgen in eclipse.I am using jboss-4.2.3.GA as a server.Imediately after creating the project I added identity management using this tutorial http://seamframework.org/Documentation/AddIdentityManagementToASeamgenProject and then generated the entity. My problem is that the project does not deploy. I get the error :



      ERROR [[/anpa]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.persistentPermissionResolver 
      




      My components.xml is like this:




      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:drools="http://jboss.com/products/seam/drools"
                  xmlns:bpm="http://jboss.com/products/seam/bpm"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:mail="http://jboss.com/products/seam/mail"
                  xmlns:web="http://jboss.com/products/seam/web"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
      
         <core:init debug="true" jndi-pattern="@jndiPattern@"/>
      
         <core:manager concurrent-request-timeout="500"
                       conversation-timeout="120000"
                       conversation-id-parameter="cid"
                       parent-conversation-id-parameter="pid"/>
      
         <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
         <web:hot-deploy-filter url-pattern="*.seam"/>
      
         <persistence:entity-manager-factory name="entityManagerFactory"
                            persistence-unit-name="anpa"/>
      
         <persistence:managed-persistence-context name="entityManager" auto-create="true"
                                entity-manager-factory="#{entityManagerFactory}"/>
      
         <drools:rule-base name="securityRules">
            <drools:rule-files><value>/security.drl</value></drools:rule-files>
         </drools:rule-base>
      
         <security:rule-based-permission-resolver security-rules="#{securityRules}"/>
      
         <security:identity/>
         
      <security:remember-me enabled="true"/>
      
      <security:jpa-identity-store user-class="anpa.entity.UserAccount" role-class="anpa.entity.UserRole"/>
      
      <security:jpa-permission-store user-permission-class="anpa.entity.UserPermission"/>
      
         <event type="org.jboss.seam.security.notLoggedIn">
            <action execute="#{redirect.captureCurrentView}"/>
         </event>
         <event type="org.jboss.seam.security.loginSuccessful">
            <action execute="#{redirect.returnToCapturedView}"/>
         </event>
      
         <mail:mail-session host="localhost" port="25"/>
      
         <!-- For use with jBPM pageflow or process management -->
         <!--
         <bpm:jbpm>
            <bpm:process-definitions></bpm:process-definitions>
            <bpm:pageflow-definitions></bpm:pageflow-definitions>
         </bpm:jbpm>
         -->
      
      </components>
      




      The thing is that if I remove security:jpa-identity-store and security:jpa-permission-store the application deploys and work fine except i can not log in. I really need help, I will provide any info needed, I have a deadline on it so I need to finish as soon as posible.Thanks in advance.

        • 1. Re: Please help Seam 2.1.2
          swd847

          Can you post the full stacktrace?

          • 2. Re: Please help Seam 2.1.2
            jeanluc

            A log excerpt (perhaps at the DEBUG level) might be of help as well.


            Where I am now I only have the source of 2.1.1; I looked src\main\org\jboss\seam\security\permission\PersistentPermissionResolver.java and the creation of the component is simple:



               @Create
               public void create() {
                  initPermissionStore();
               }
               
               protected void initPermissionStore() {
                  if (permissionStore == null){
                     permissionStore = (PermissionStore) Component.getInstance(JpaPermissionStore.class, true);
                  }           
                  
                  if (permissionStore == null) {
                     log.warn("no permission store available - please install a PermissionStore with the name '" +
                           Seam.getComponentName(JpaPermissionStore.class) + "' if persistent permissions are required.");
                  }
               }



            Again, the above is for 2.1.1 so 2.1.2 might be different. Look in the source, put a breakpoint in the @Create method and see what happens.

            • 3. Re: Please help Seam 2.1.2
              specter

              Jean do you mean recompiling the source of seam and add the component? And how do I post here the full log because it is huge and does not allow me to post that many text here.