2015-09-04 68 views
0

我在測試Neo4j本地服務器(未嵌入)時使用空數據時遇到問題。 我基本上修改這個版本是完全註釋Spring配置:無法讓Neo4j和Spring數據在最新版本上工作

http://krams915.blogspot.sg/2012/03/spring-mvc-31-implement-crud-with.html 

恐怕這是關於版本,所以如果有人能幫助將是巨大的。 這裏是我的pom.xml

<?xml version="1.0" encoding="UTF-8"?> 
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>org.krams</groupId> 
<artifactId>spring-neo4j-tutorial</artifactId> 
<packaging>war</packaging> 
<version>0.0.1-SNAPSHOT</version> 
<name>spring-neo4j-tutorial Maven Webapp</name> 
<url>http://maven.apache.org</url> 
<properties> 
    <spring.core.version>4.2.0.RELEASE</spring.core.version> 
    <spring.data.neo4j.version>3.4.0.RELEASE</spring.data.neo4j.version> 
    <spring.boot.bersion>1.2.5.RELEASE</spring.boot.bersion> 

    <neo4j.kernel.version>2.2.3</neo4j.kernel.version> 
    <neo4j.cypher.version>2.2.3</neo4j.cypher.version> 
    <neo4j.cypher.dsl.version>2.0.1</neo4j.cypher.dsl.version> 

    <hibernate.validator.version>4.1.0.Final</hibernate.validator.version> 
    <scala.library.version>2.11.7</scala.library.version> 
    <cglib.version>3.1</cglib.version> 
    <aspectj.version>1.8.6</aspectj.version> 

    <javax.servlet-api.version>3.1.0</javax.servlet-api.version> 
    <javax.servlet.jsp-api.version>2.2</javax.servlet.jsp-api.version> 
    <javax.servlet.jstl.version>1.1.2</javax.servlet.jstl.version> 
    <javax.taglibs.standard.version>1.1.2</javax.taglibs.standard.version> 

    <slf4j.version>1.7.10</slf4j.version> 
    <log4j.version>1.2.14</log4j.version> 
    <jackson.version>1.9.3</jackson.version> 

    <!-- Testing --> 
    <mockito.version>1.10.19</mockito.version> 
    <junit.version>4.12</junit.version> 

    <!-- Plugins --> 
    <maven.compiler.plugin.version>2.5.1</maven.compiler.plugin.version> 
    <maven.plugin.version>2.6</maven.plugin.version> 
</properties> 
<dependencies> 
    <!-- Spring Core --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-core</artifactId> 
     <version>${spring.core.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
     <version>${spring.core.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-tx</artifactId> 
     <version>${spring.core.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-webmvc</artifactId> 
     <version>${spring.core.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-jdbc</artifactId> 
     <version>${spring.core.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-oxm</artifactId> 
     <version>${spring.core.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-aspects</artifactId> 
     <version>${spring.core.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.data</groupId> 
     <artifactId>spring-data-neo4j-rest</artifactId> 
     <version>${spring.data.neo4j.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-autoconfigure</artifactId> 
     <version>${spring.boot.bersion}</version> 
    </dependency> 
    <!-- A seamless aspect-oriented extension to the Java programming language --> 
    <dependency> 
     <groupId>org.aspectj</groupId> 
     <artifactId>aspectjrt</artifactId> 
     <version>${aspectj.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.aspectj</groupId> 
     <artifactId>aspectjweaver</artifactId> 
     <version>${aspectj.version}</version> 
    </dependency> 
    <!-- Cglib is a powerful, high performance and quality Code Generation Library, It is used to extend JAVA classes and implements interfaces at runtime. --> 
    <dependency> 
     <groupId>cglib</groupId> 
     <artifactId>cglib-nodep</artifactId> 
     <version>${cglib.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <!-- The JavaServer Pages Standard Tag Library (JSTL) encapsulates, as simple tags, core functionality common to many JSP applications. --> 
    <dependency> 
     <groupId>jstl</groupId> 
     <artifactId>jstl</artifactId> 
     <version>${javax.servlet.jstl.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>taglibs</groupId> 
     <artifactId>standard</artifactId> 
     <version>${javax.taglibs.standard.version}</version> 
    </dependency> 
    <!-- Data Mapper package is a high-performance data binding package built on Jackson JSON processor --> 
    <dependency> 
     <groupId>org.codehaus.jackson</groupId> 
     <artifactId>jackson-mapper-asl</artifactId> 
     <version>${jackson.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <!-- Jackson is a high-performance JSON processor (parser, generator) --> 
    <dependency> 
     <groupId>org.codehaus.jackson</groupId> 
     <artifactId>jackson-core-asl</artifactId> 
     <version>${jackson.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <!-- Logger --> 
    <dependency> 
     <groupId>log4j</groupId> 
     <artifactId>log4j</artifactId> 
     <version>${log4j.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <!-- The Simple Logging Facade for Java or (SLF4J) serves as a simple facade or abstraction for various logging frameworks, e.g. java.util.logging, log4j and logback, allowing the end user to plug in the desired logging framework at deployment time. --> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
     <version>${slf4j.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-log4j12</artifactId> 
     <version>${slf4j.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>jcl-over-slf4j</artifactId> 
     <version>${slf4j.version}</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <!-- Spring Data Neo4j --> 
    <dependency> 
     <groupId>org.springframework.data</groupId> 
     <artifactId>spring-data-neo4j</artifactId> 
     <version>${spring.data.neo4j.version}</version> 
     <exclusions> 
      <exclusion> 
       <artifactId>neo4j</artifactId> 
       <groupId>org.neo4j</groupId> 
      </exclusion> 
      <exclusion> 
       <artifactId>neo4j-cypher-dsl</artifactId> 
       <groupId>org.neo4j</groupId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>org.neo4j</groupId> 
     <artifactId>neo4j-kernel</artifactId> 
     <version>${neo4j.kernel.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.neo4j</groupId> 
     <artifactId>neo4j-cypher</artifactId> 
     <version>${neo4j.cypher.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.neo4j</groupId> 
     <artifactId>neo4j-cypher-dsl</artifactId> 
     <version>${neo4j.cypher.dsl.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.scala-lang</groupId> 
     <artifactId>scala-library</artifactId> 
     <version>${scala.library.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-validator</artifactId> 
     <version>${hibernate.validator.version}</version> 
    </dependency> 
    <!-- Javax Servlet. This needs to be included for runtime only! --> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>javax.servlet-api</artifactId> 
     <version>${javax.servlet-api.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
    <groupId>javax.servlet.jsp</groupId> 
    <artifactId>jsp-api</artifactId> 
    <version>${javax.servlet.jsp-api.version}</version> 
    <scope>provided</scope> 
</dependency> 
    <!-- Testing dependencies --> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>${junit.version}</version> 
     <type>jar</type> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.mockito</groupId> 
     <artifactId>mockito-all</artifactId> 
     <version>${mockito.version}</version> 
     <type>jar</type> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-test</artifactId> 
     <version>${spring.core.version}</version> 
     <type>jar</type> 
     <scope>test</scope> 
    </dependency> 
</dependencies> 
<build> 
    <resources> 
    <resource> 
     <filtering>true</filtering> 
     <directory>src/test/resources</directory> 
     <includes> 
     <include>**/*.properties</include> 
     </includes> 
     <excludes> 
     <exclude>**/*local.properties</exclude> 
     </excludes> 
    </resource> 
    <resource> 
     <directory>src/main/resources</directory> 
     <includes> 
     <include>**/*.properties</include> 
     <include>**/*.xml</include> 
     </includes> 
    </resource> 
</resources> 
    <finalName>spring-neo4j-tutorial</finalName> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>${maven.compiler.plugin.version}</version> 
      <configuration> 
       <source>1.7</source> 
       <target>1.7</target> 
      </configuration> 
     </plugin> 
     <plugin> 
    <artifactId>maven-resources-plugin</artifactId> 
    <version>${maven.plugin.version}</version> 
    <configuration> 
     <encoding>UTF-8</encoding> 
    </configuration> 
    </plugin> 
    </plugins> 
</build> 
<repositories> 
    <repository> 
     <id>org.springframework.maven.release</id> 
     <name>Spring Maven Release Repository</name> 
     <url>http://maven.springframework.org/release</url> 
     <releases> 
      <enabled>true</enabled> 
     </releases> 
     <snapshots> 
      <enabled>false</enabled> 
     </snapshots> 
    </repository> 
    <repository> 
     <id>neo4j</id> 
     <url>http://m2.neo4j.org/content/repositories/releases</url> 
     <releases> 
      <enabled>true</enabled> 
     </releases> 
     <snapshots> 
      <enabled>false</enabled> 
     </snapshots> 
    </repository> 
</repositories> 

,這是我的配置文件:

package org.krams.config; 

    import org.springframework.context.annotation.Bean; 
    import org.springframework.context.annotation.ComponentScan; 
    import org.springframework.context.annotation.Configuration; 
    //import org.springframework.context.annotation.ImportResource; 
    import org.springframework.context.annotation.PropertySource; 
    import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; 
    import org.springframework.web.servlet.ViewResolver; 
    import org.springframework.web.servlet.config.annotation.EnableWebMvc; 
    import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 
    import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 
    import org.springframework.web.servlet.view.InternalResourceViewResolver; 

    @EnableWebMvc 
    @ComponentScan("org.krams") 
    @PropertySource(value={"spring.properties"}) 
    //@ImportResource({"trace-context.xml"}) 
    @Configuration 
    public class AppContextConfiguration extends WebMvcConfigurerAdapter { 

     /* 
     * PropertySourcesPlaceHolderConfigurer Bean only required for @Value("{}") annotations. 
     * Remove this bean if you are not using @Value annotations for injecting properties. 
     */ 
     @Bean 
     public static PropertySourcesPlaceholderConfigurer properties() { 
      PropertySourcesPlaceholderConfigurer propertyConfigurer = new PropertySourcesPlaceholderConfigurer(); 
      return propertyConfigurer; 
     } 

     @Override 
     public void addResourceHandlers(ResourceHandlerRegistry registry) { 
      registry.addResourceHandler("/resources/**").addResourceLocations("classpath:../../META-INF/resources/"); 
     } 

     @Bean 
     public ViewResolver getViewResolver(){ 
      InternalResourceViewResolver resolver = new InternalResourceViewResolver(); 
      resolver.setPrefix("/WEB-INF/jsp/"); 
      resolver.setSuffix(".jsp"); 
      resolver.setOrder(1); 
      return resolver; 
     } 

    } 

而且

package org.krams.config; 

    import org.neo4j.graphdb.GraphDatabaseService; 
    import org.springframework.beans.factory.annotation.Autowired; 
    import org.springframework.beans.factory.annotation.Value; 
    import org.springframework.context.annotation.Bean; 
    import org.springframework.context.annotation.Configuration; 
    import org.springframework.context.annotation.Import; 
    import org.springframework.data.neo4j.config.EnableNeo4jRepositories; 
    import org.springframework.data.neo4j.config.Neo4jConfiguration; 
    import org.springframework.data.neo4j.core.GraphDatabase; 
    import org.springframework.data.neo4j.rest.SpringCypherRestGraphDatabase; 
    import org.krams.repository.UserRepository; 
    import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 

    @Configuration 
    @Import(AppContextConfiguration.class) 
    @EnableAutoConfiguration 
    @EnableNeo4jRepositories(basePackages = "org.krams.repository") 
    public class Neo4jConfigConfiguration { 
     @Value("${neo4j.server}") 
     private String BASE_URI; 

     @Value("${neo4j.user}") 
     private String USER_NAME; 

     @Value("${neo4j.password}") 
     private String PASSWORD; 

     @Autowired 
     GraphDatabase graphDatabase; 

     @Autowired 
     UserRepository userRepository; 

     @Bean 
     GraphDatabaseService graphDatabaseService() { 
      SpringCypherRestGraphDatabase grapdhDbService = new SpringCypherRestGraphDatabase(BASE_URI, USER_NAME, PASSWORD); 
      return grapdhDbService; 
     } 

     @Configuration 
     static class Neo4jMoreConfig extends Neo4jConfiguration { 
      Neo4jMoreConfig() { 
       setBasePackage("org.krams.domain"); 
      } 
     } 
    } 

這是我的測試類:

  package org.krams.unit; 

    import org.junit.Test; 
    import org.junit.runner.RunWith; 
    import org.krams.config.Neo4jConfigConfiguration; 
    import org.springframework.beans.factory.annotation.Autowired; 
    import org.springframework.boot.test.SpringApplicationConfiguration; 
    import org.springframework.data.neo4j.support.Neo4jTemplate; 
    import org.springframework.test.annotation.DirtiesContext; 
    import org.springframework.test.annotation.Rollback; 
    import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 
    import org.springframework.test.context.transaction.BeforeTransaction; 
    import org.springframework.test.context.web.WebAppConfiguration; 

    @SpringApplicationConfiguration(classes = Neo4jConfigConfiguration.class) 
    @RunWith(SpringJUnit4ClassRunner.class) 
    @WebAppConfiguration 
    @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) 
    public class Neo4jConnectionTest { 

     @Autowired 
     private Neo4jTemplate template; 

     @Rollback(true) 
     @BeforeTransaction 
     public void cleanDb() { 
      System.out.println("Function Before"); 
     } 

     @Test 
     public void testConnection() { 
      System.out.println("Connection build"); 
     } 

    } 

此產生錯誤:

  package org.krams.unit; 

      import org.junit.Test; 
      import org.junit.runner.RunWith; 
      import org.krams.config.Neo4jConfigConfiguration; 
      import org.springframework.beans.factory.annotation.Autowired; 
      import org.springframework.boot.test.SpringApplicationConfiguration; 
      import org.springframework.data.neo4j.support.Neo4jTemplate; 
      import org.springframework.test.annotation.DirtiesContext; 
      import org.springframework.test.annotation.Rollback; 
      import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 
      import org.springframework.test.context.transaction.BeforeTransaction; 

      @SpringApplicationConfiguration(classes = Neo4jConfigConfiguration.class) 
      @RunWith(SpringJUnit4ClassRunner.class) 
      @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) 
      public class Neo4jConnectionTest { 

       @Autowired 
       private Neo4jTemplate template; 

       @Rollback(true) 
       @BeforeTransaction 
       public void cleanDb() { 
        System.out.println("Function Before"); 
       } 

       @Test 
       public void testConnection() { 
        System.out.println("Connection build"); 
       } 

      } 

這將導致一個錯誤:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory]: Factory method 'ty 
     peRepresentationStrategyFactory' threw exception; nested exception is java.lang.RuntimeException: Error reading as JSON '' 
         at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) 
         at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) 
         ... 160 more 
     Caused by: java.lang.RuntimeException: Error reading as JSON '' 
         at org.neo4j.rest.graphdb.util.JsonHelper.readJson(JsonHelper.java:57) 
         at org.neo4j.rest.graphdb.util.JsonHelper.jsonToSingleValue(JsonHelper.java:62) 
         at org.neo4j.rest.graphdb.RequestResult.toEntity(RequestResult.java:104) 
         at org.neo4j.rest.graphdb.RequestResult.toMap(RequestResult.java:113) 
         at org.neo4j.rest.graphdb.index.RetrievedIndexInfo.<init>(RetrievedIndexInfo.java:42) 
         at org.neo4j.rest.graphdb.RestAPIIndexImpl.indexInfo(RestAPIIndexImpl.java:328) 
         at org.neo4j.rest.graphdb.RestAPICypherImpl.indexInfo(RestAPICypherImpl.java:748) 
         at org.neo4j.rest.graphdb.index.RestIndexManager.indexInfo(RestIndexManager.java:52) 
         at org.neo4j.rest.graphdb.index.RestIndexManager.existsForNodes(RestIndexManager.java:47) 
         at org.neo4j.rest.graphdb.RestAPICypherImpl.getIndex(RestAPICypherImpl.java:584) 
         at org.springframework.data.neo4j.rest.SpringCypherRestGraphDatabase.getIndex(SpringCypherRe 
     stGraphDatabase.java:91) 
         at org.springframework.data.neo4j.support.typerepresentation.AbstractIndexBasedTypeRepresent 
     ationStrategy.isStrategyAlreadyInUse(AbstractIndexBasedTypeRepresentationStrategy.java:56) 
         at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.chooseStrategy(TypeRepresentationStrategyFactory.java:51) 
         at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.<init>(TypeRepresentationStrategyFactory.java:35) 
         at org.springframework.data.neo4j.config.Neo4jConfiguration.typeRepresentationStrategyFactory(Neo4jConfiguration.java:151) 
         at org.krams.config.Neo4jConfigConfiguration$Neo4jMoreConfig$$EnhancerBySpringCGLIB$$ca3aba7a.CGLIB$typeRepresentationStrategyFactory$26(<generated>) 
         at org.krams.config.Neo4jConfigConfiguration$Neo4jMoreConfig$$EnhancerBySpringCGLIB$$ca3aba7a$$FastClassBySpringCGLIB$$d4ddeef3.invoke(<generated>) 
         at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) 
         at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:318) 
         at org.krams.config.Neo4jConfigConfiguration$Neo4jMoreConfig$$EnhancerBySpringCGLIB$$ca3aba7a.typeRepresentationStrategyFactory(<generated>) 
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
         at java.lang.reflect.Method.invoke(Method.java:606) 
         at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleI 
     nstantiationStrategy.java:162) 
         ... 161 more 
     Caused by: java.io.EOFException: No content to map to Object due to end of input 
         at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2768) 
         at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2711) 
         at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1856) 
         at org.neo4j.rest.graphdb.util.JsonHelper.readJson(JsonHelper.java:55) 
         ... 185 more 

我不知道這是關於版本。 我的本地Neo4j版本os 2.2.3

謝謝。

+0

對不起Dee實際上,我只是讀你的問題的標題,並誤解你的pom.xml文件爲配置文件。 –

+0

使用更新的新彈簧數據版本4.0.0.RC2 – Karthikeyan

+0

沒有用於啓動的自動配置,您必須在配置中將'Neo4jConfigConfiguration'從SDN擴展。或者@導入它。 –

回答

0

嘗試使用此Java配置文件而不是XML配置。它應該工作,檢查this SO post更好的解釋。

import org.neo4j.ogm.session.Session; 
import org.neo4j.ogm.session.SessionFactory; 
import org.springframework.context.annotation.Bean; 
import org.springframework.context.annotation.ComponentScan; 


@Configuration 
@EnableNeo4jRepositories("com.app.repository") 
@EnableTransactionManagement 
@ComponentScan("com.app") 

public class AppNeo4jConfiguration extends Neo4jConfiguration{ 


public SessionFactory getSessionFactory() { 
    return new SessionFactory("com.app.bo"); 
} 


@Bean 
public Neo4jServer neo4jServer() { 
    return new RemoteServer("http://localhost:7474"); 
} 


@Bean 
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS) 
public Session getSession() throws Exception { 
    return super.getSession(); 
} 
} 
+0

嗨,Kunal,我從來沒有在我的配置中使用任何XML。如上所述,所有配置都在java文件內。你給我的參考是舊版本,我已經升級到上面的版本3.3.2。 – Dee

+0

這是SDN4 :) –

+0

謝謝邁克爾。是的,我沒有使用SDN 4.我已經完成了目前的功能。此刻編輯我的帖子。 – Dee

0

我改變了上面的代碼。 另外我犯了一個錯誤,沒有提到DB REST API。 只要確保這兩個,它會起作用。

相關問題