1 Reply Latest reply on Oct 8, 2010 9:03 AM by Frank Knoll

    Hibernate filter problem: "No such filter configured"

    workrage Newbie

      Not sure if this is the right forum, please let me know.


      I'm trying to upgrade from JBoss 4.2.3 to 5.1.  At the same time, I'm trying to upgrade from Seam 2.0.2 to 2.2 (yeah, I'm a glutton for punishment).  My application is packaged as an ear, with one jar and one war.  I think I'm almost there, but have run into a real roadblock.


      My project declares a few Hibernate filters thus...


      @Entity
      @FilterDef(name="filterByStatus", parameters = {@ParamDef(name="status", type="string"})
      @Filter(name="filterByStatus", condition="status = :status")
      public class Organization {
        // etc...
      }



      When I start the container, I'm getting the following error...


      javax.el.ELException: org.hibernate.HibernateException: No such filter configured [filterByNonInactive]



      At first I thought I had a problem with my configuration, and that the entities weren't being scanned.  But I can see from the server log that the filters are in fact being processed...


      17:49:52,443 INFO  [AnnotationBinder] Binding entity from annotated class: mycompany.model.Organization
      17:49:52,445 INFO  [AnnotationBinder] Binding filter definition: filterByStatus




      I'm totally stumped.  I'm not seeing any deployment errors in the server log.  This code worked fine in 4.2.3.  I have however had to play around a bit with my persistence.xml and components.xml to get the app to deploy.  Anyone have any thoughts on what I might have missed, or messed up?  I've included my persistence.xml and components.xml below.  Thanks in advance for any help.


      <?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="myUnit">
          <provider>org.hibernate.ejb.HibernatePersistence</provider>
          <jta-data-source>java:/myDataSource</jta-data-source>
          <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
            <property name="hibernate.hbm2ddl.auto" value="none" />
            <property name="hibernate.show_sql" value="true" />
            <property name="hibernate.format_sql" value="true" />
            <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider" />
            <property name="hibernate.cache.use_query_cache" value="false" />
            <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
            <property name="jboss.entity.manager.factory.jndi.name" value="java:/myEntityManagerFactory" />
            <property name="SetBigStringTryClob" value="true" />
            <property name="batch_size" value="0" />
          </properties>
        </persistence-unit>
      
      </persistence>



      <?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:transaction="http://jboss.com/products/seam/transaction" 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.2.xsd 
                       ...etc... ">
      
        <core:init debug="false" jndi-pattern="my-app/#{ejbName}/local" />
      
        <!-- Define uploading documents properties -->
        <web:context-filter url-pattern="/render/*" />
      
        <web:exception-filter url-pattern="*.seam" />
      
        <core:manager concurrent-request-timeout="15000" conversation-timeout="120000" conversation-id-parameter="cid" parent-conversation-id-parameter="pid" />
      
        <persistence:entity-manager-factory name="entityManagerFactory" persistence-unit-name="myUnit" />
      
        <persistence:managed-persistence-context 
              name="entityManager" 
              entity-manager-factory="#{entityManagerFactory}" 
              auto-create="true" 
              persistence-unit-jndi-name="java:/myEntityManagerFactory" />
      
        <transaction:ejb-transaction />
      
        <drools:rule-base name="securityRules">
          <drools:rule-files>
            <value>/security.drl</value>
          </drools:rule-files>
        </drools:rule-base>
        <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true" />
      
        <security:rule-based-permission-resolver security-rules="#{securityRules}" />
      
        <event type="org.jboss.seam.security.notLoggedIn">
          <action execute="#{redirect.captureCurrentView}" />
        </event>
        <event type="org.jboss.seam.postAuthenticate">
          <action execute="#{redirect.returnToCapturedView}" />
        </event>
        <event type="org.jboss.seam.security.loginSuccessful">
          <action execute="#{redirect.returnToCapturedView}" />
        </event>
        <mail:mail-session host="localhost" port="2525" username="x" password="x" />
      
        <bpm:jbpm>
          <bpm:process-definitions />
        </bpm:jbpm>
      
      </components>