Results 1 to 3 of 3

Thread: Problem with Spring javaConfig

  1. #1
    Join Date
    Jul 2006
    Posts
    9

    Default Problem with Spring javaConfig

    Hi,

    I have some problems with spring javaconfig and i don't understand why this error happens.

    I try to explain:

    The error is:

    Code:
    2008-03-26 09:10:15,504 main INFO  [org.springframework.config.java.process.ConfigurationProcessor$1] Refreshing org.springframework.config.java.process.ConfigurationProcessor$1@106bde8: display name [org.springframework.config.java.process.ConfigurationProcessor$1@106bde8]; startup date [Wed Mar 26 09:10:15 WET 2008]; parent: com.multicert.project.cc.ocsp.bsl
    
    2008-03-26 09:10:15,505 main ERROR  org.springframework.web.context.ContextLoader] Context initialization failed
    java.lang.IllegalStateException: GenericApplicationContext does not support multiple refresh attempts: just call 'refresh' once

    What i have is a Javaconfig class:

    Code:
    @Configuration
    public class HSMConfiguration{
    
    	@Bean(lazy = Lazy.TRUE)
    	public HsmManager hsmManager(){
    		 
    ...............................................
    		
    		return hmanager;
    	}
    	
    	@ExternalBean
    	public HSMInformation hsmInformation(){return null;}
    	
    	@ExternalBean
    	public String operateMode(){return null;}
    	
    	@ExternalBean
    	public KeyStoreElementRepository keyStoreElementRepository(){return null;}
    	
    	@ExternalBean
    	public GenericObjectPool pool(){return null;}
    }
    My Spring config of JavaConfig:

    Code:
           <!-- the configuration above -->
     	<bean class="com.multicert.project.cc.ocsp.bsl.configuration.HSMConfiguration"/>
    
     	<!-- Java Configuration post processor--> 
     	<bean class="org.springframework.config.java.process.ConfigurationPostProcessor"/>
     	
     	
     	<bean name="operateMode" class="java.lang.String">
     		<constructor-arg value="${operate.hsmmode}" />
     	</bean>
    Can anyone help me ?


    The only thing that my be influence this is that i'm using Singletons Spring applications context with:

    Code:
        <context-param>
    		<param-name>locatorFactorySelector</param-name>
    		<param-value>classpath*:beanRefFactory.xml</param-value>
        </context-param>
    But i have to use it, because i have to share some modules with other teams.

    This is a conflict between the Spring JavaConfig and Singleton Spring Context Application ?

    Thanks in Advance,
    Joćo Cerdeira

  2. #2
    Join Date
    Apr 2007
    Posts
    307

    Default

    Hi Joćo,

    Nothing wrong on your part - you just bumped into a known issue, SJC-60. I've just checked in the fix to this bug, and would very much appreciate your trying it out. It does mean you'll need to grab tonight's 1.0.0.m4-SNAPSHOT, or you can build from source if you like.

    Thanks!
    Chris Beams
    Spring Framework committer, VMware
    http://github.com/cbeams

  3. #3
    Join Date
    Jul 2006
    Posts
    9

    Default

    Hi Chris,

    Thanks for the response.

    I already have try the snapshot of the new version, and the firsts tests have pass OK

    Now i will have to wait for a stable release to release my application to production.

    Best Regards,
    Joćo Cerdeira

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •