2016-06-01 22 views
2

Ich Migration ein Projekt, das xml für die Zuordnung zu Federverschluß(.java-Datei) verwendetändern Konfiguration xml zum Frühling Boot

Wie soll ich vorgehen? Unten ist die hase XML-Konfiguration ...

<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

Kleine int 'class' verweist auf eine Klasse ... Diese Dinge können Sie mit' new' erstellen. Fang damit an. –

Antwort

2

Zuerst Sie eine Konfigurationsklassendatei erstellen sollte @Configuration und importieren Sie Ihre XML-Datei mit @ImportResource wie folgt aus: -

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

} 

Dann müssen Sie Ihren Ressourceninhalt in der Datei server.xml aufbewahren, da er in Ihrer aktuellen XML-Datei nicht funktioniert. Danach ist die Konfiguration von JackRabbit abgeschlossen. Dann tun, was Sie in DMS tun möchten.