Note that there are some explanatory texts on larger screens.

plurals
  1. POIntegration (maven) of Spring Data Neo4j in Dynamic Web Project using Jersey and Tomcat
    text
    copied!<p>I´m getting a little bit lost in my own (maven enabled) dynamic WEB - Project. The project works fine, I´ve got a RESTful WebService (Jersey) running and I´m able to consume it.</p> <p>... my next step was to persist my domain classes, with Spring Data and Neo4j. So, I´ve added some tags to my pom.xml</p> <pre><code>... &lt;repository&gt; &lt;id&gt;spring-milestone&lt;/id&gt; &lt;name&gt;Spring Maven MILESTONE Repository&lt;/name&gt; &lt;url&gt;http://maven.springframework.org/milestone&lt;/url&gt; &lt;/repository&gt; &lt;dependency&gt; &lt;groupId&gt;org.springframework.data&lt;/groupId&gt; &lt;artifactId&gt;spring-data-neo4j&lt;/artifactId&gt; &lt;version&gt;2.0.0.RELEASE&lt;/version&gt; &lt;/dependency&gt; ... </code></pre> <p>my next step was to annotate my entity-classes... here is a simple example:</p> <pre><code>... @NodeEntity public class Category { @GraphId Long nodeId; String categoryType; public Category(String categoryType){ this.categoryType = categoryType; } } ... </code></pre> <p>okay, everything´s fine... now I want to persist my category-object...</p> <pre><code>@Autowired Neo4jTemplate template; @Test @Transactional public void toGraphDb() { template.save(new Category("mashineCategory")); } </code></pre> <p>when I run the test I´m getting a NullPointerException, cause the template is null</p> <p>I guess there is something missing in my project, but I´m not sure in which folder/file to add informations/files...</p> <p>here is my web.xml:</p> <pre><code>... &lt;display-name&gt;ElisaSimulatorM4&lt;/display-name&gt; &lt;servlet&gt; &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt; &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt; &lt;param-value&gt;de.elisa.communication.webservice.restservice.implementation&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt; &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; ... </code></pre> <p>in some guides I read something about dispatcherServlets and an applicatonContext.xml, but I have no idea where to put it in my project.</p> <p>Maybe someone can help me out...</p> <p>Ps. I wanted to upload a screenshot from my project-tree but as a greenhorn I haven't got enough reputation... sorry for that</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload