title: Spring 3 integration testing - sessionFactory inicialization exception
body: <p>When i run my spring junit test i got this error message :</p>
  
  <pre><code>Caused by: 
  java.lang.NoSuchMethodError: org/slf4j/impl/StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
  </code></pre>
  
  <p>....</p>
  
  <pre><code>java.lang.ClassFormatError: JVMCFRE074 no Code attribute specified; class=javax/persistence/PersistenceException, method=&lt;init&gt;()V, pc=0
  </code></pre>
  
  <p><em>Could you help me to find a reason for that error message ? Seems i have some problems with dependencies of slf4j - but i have them in the project.</em></p>
  
  <p><strong>Test class :</strong></p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations={"/businessApplicationContextTest.xml"})
  @TransactionConfiguration(transactionManager="transactionManager", defaultRollback=true)
  @Transactional
  public class LogicHandlerTest {
  
      @SessionFactory
      SessionFactory sessionFactory;
  
  @Before
  public void setup() {System.out.println("@Before");}
  
  @Test
  public void testDummy() {
      System.out.println("testDummy");
      assert(true);
  }
  }
  </code></pre>
  
  <p><strong>Spring test context configuration :</strong></p>
  
  <pre><code>&lt;!-- DATASOURCE --&gt;
  &lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName"    value="org.hsqldb.jdbcDriver"/&gt;       
      &lt;property name="url"                value="jdbc:hsqldb:mem:test"/&gt;        
      &lt;property name="username"           value="sa"/&gt;          
      &lt;property name="password"           value=""/&gt;  
  &lt;/bean&gt; 
  
  &lt;!-- SESSION FACTORY --&gt;
  &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;property name="packagesToScan" value="com.test.dummyproject.entity"/&gt;
      &lt;property name="hibernateProperties"&gt;
        &lt;props&gt;
              &lt;prop key="hibernate.jdbc.batch_size"&gt;100&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.connection.autocommit"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.HSQLDialect&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;!-- TRANSACTION MANAGER --&gt;
  &lt;bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>DEPENDENCIES (versions from POM.XML) :</p>
  
  <pre><code>    hibernate                        3.2.3.ga
      hibernate-annotations            3.3.1.GA
      hibernate-commons-annotations    3.2.0.Final
      javaee-api                   6.0
      slf4j-api                        1.6.4
      slf4j-log4j12                    1.6.4
  </code></pre>