2016-06-01 2 views
2

봄에 나는 봄 부팅(된 .java 파일) 나는 그것에 대해 어떻게 변경 구성이 부팅

가야 에 매핑 XML을 사용하는 프로젝트를 마이그레이션하는 건가요? 다음은이 같은 @ImportResource를 사용 @Configuration를 사용하여 구성 클래스 파일을 생성하고 .xml 파일을 가져와야합니다

<bean id="repository" class="org.springframework.jndi.JndiObjectFactoryBean"> 
    <property name="jndiName" value="java:comp/env/jcr/myRepository"/> 
</bean> 

<bean id="jcrSessionFactory" class="org.springmodules.jcr.JcrSessionFactory"> 
    <property name="repository" ref="repository" /> 
    <property name="credentials"> 
     <bean class="javax.jcr.SimpleCredentials"> 
     <constructor-arg index="0" value="admin" /> 
     <!-- create the credentials using a bean factory --> 
     <constructor-arg index="1"> 
      <bean factory-bean="password" factory-method="toCharArray" /> 
     </constructor-arg> 
     </bean> 
    </property> 
</bean> 

    <!-- create the password to return it as a char[] --> 
    <bean id="password" class="java.lang.String"> 
    <constructor-arg index="0" value="admin" /> 
    </bean> 

    <bean id="jcrTemplate" class="org.springmodules.jcr.JcrTemplate"> 
    <property name="sessionFactory" ref="jcrSessionFactory" /> 
    <property name="allowCreate" value="true" /> 
    </bean> 

<Resource name="jcr/myRepository" 
    auth="Container" 
    type="javax.jcr.Repository" 
    factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory" 
    configFilePath="D:/DMSRepo/repositoryFactlive.xml" 
    repHomeDir="D:/DMSRepo/factlivetrialVersion2/repo"/> 
+0

작은 int'class'는 클래스를 참조합니다 ... 당신은'new'로 생성 할 수있는 것들. 그것부터 시작하십시오. –

답변

2

먼저 잭 래빗 XML 구성은 ...입니다 : -

@Configuration 
@ImportResource("classpath:dmsRepository.xml") 
public class JackRabbitRepository { 

} 

그러면 리소스를 server.xml 파일에 보관해야합니다. 현재 xml에서는 작동하지 않습니다. 이 후에 JackRabbit 구성이 완료됩니다. 그런 다음 DMS에서 수행 할 작업을 수행하십시오.