Can someone answer this question. Is it possible to have the spatial repository in a spring boot app in embedded mode?
#Bean
public GraphDatabaseService graphDatabaseService() {
return new GraphDatabaseFactory().newEmbeddedDatabase("neo4j.db");
}
by just adding the
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-spatial</artifactId>
<version>0.9</version>
</dependency>
to your classpath?
I keep getting the error
Caused by: java.lang.IllegalArgumentException: No index provider 'spatial' found. Maybe the intended provider (or one more of its dependencies) aren't on the classpath or it failed to load.
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:91)
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.findIndexConfig(IndexManagerImpl.java:142)
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.getOrCreateIndexConfig(IndexManagerImpl.java:209)
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.getOrCreateNodeIndex(IndexManagerImpl.java:314)
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.forNodes(IndexManagerImpl.java:302)
at org.springframework.data.neo4j.support.DelegatingGraphDatabase.createIndex(DelegatingGraphDatabase.java:163)
at org.springframework.data.neo4j.support.index.IndexProviderImpl.createIndex(IndexProviderImpl.java:91)
at org.springframework.data.neo4j.support.index.IndexProviderImpl.getIndex(IndexProviderImpl.java:68)
at org.springframework.data.neo4j.support.index.IndexProviderImpl.getIndex(IndexProviderImpl.java:108)
at org.springframework.data.neo4j.support.mapping.EntityIndexCreator$2.doWithPersistentProperty(EntityIndexCreator.java:61)
at org.springframework.data.neo4j.support.mapping.EntityIndexCreator$2.doWithPersistentProperty(EntityIndexCreator.java:57)
at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:294)
at org.springframework.data.neo4j.support.mapping.EntityIndexCreator.ensureEntityIndexes(EntityIndexCreator.java:57)
at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.updateStoredEntityType(Neo4jMappingContext.java:78)
at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:71)
at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:49)
at org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:257)
at org.springframework.data.mapping.context.AbstractMappingContext.initialize(AbstractMappingContext.java:373)
at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.initialize(Neo4jMappingContext.java:111)
at org.springframework.data.mapping.context.AbstractMappingContext.afterPropertiesSet(AbstractMappingContext.java:363)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
... 62 more
Sure, you can have spring data neo4j + spring boot.
You can find the code I wrote here: https://github.com/inserpio/neo4art
And a short post describing how I did it: https://inserpio.wordpress.com/2014/09/21/neo4art-moves-to-cloud-foundry-at-springone-2gx-2014/
Hope it can help!
Cheers,
Lorenzo
Use this repository in your maven pom
<repository>
<id>neo4j-contrib-releases</id>
<url>https://raw.github.com/neo4j-contrib/m2/master/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>neo4j-contrib-snapshots</id>
<url>https://raw.github.com/neo4j-contrib/m2/master/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
with the dependency
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-spatial</artifactId>
<version>0.13-neo4j-2.1.2</version>
</dependency>
Related
While integrating the report portal with your testng project, we need epam.reportpotal dependencies, On adding the reportportal dependency I am facing the following error in pom.xml dependency :
it says : Missing artifact com.epam.reportportal:agent-java-testng:jar:5.0.4
To resolve this you need to add the following repositories in your pom.xml file as mentioned on github(https://github.com/reportportal/agent-java-testNG)
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-epam-reportportal</id>
<name>bintray</name>
<url>http://dl.bintray.com/epam/reportportal</url>
</repository>
</repositories>
I have the following repositories defined in my pom.xml.
<repositories>
<repository>
<id>spring-maven-release</id>
<name>Spring Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
</repository>
<repository>
<id>spring-maven-milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
</repository>
<repository>
<id>spring-roo-repository</id>
<name>Spring Roo Repository</name>
<url>http://spring-roo-repository.springsource.org/release</url>
</repository>
<repository>
<id>xxxx-repo.snapshot</id>
<name>iGV Snapshot Repository</name>
<url>http://mavenrepo.XXXX.com/maven2</url>
</repository>
Is there a way to know the jars that are downloaded from http://mavenrepo.XXXX.com/maven2 in the above pom.xml?
Yes you can check by following steps:
Right click on project explorer folder n click on new.
Click on others,select maven new project.
Click next,choose default work-space.
Now you can see list of archetypes these are nothing but dependencies that comes with maven.
I'm trying to setup Vaadin for a new project.
I'm following the steps documented in https://vaadin.com/wiki/-/wiki/Main/Creating+a+Maven+project
The following command in empty directory:
mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.1.8
Gives me a following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.vaadin:vaadin-archetype-application:7.1.8) -> [Help 1]
I've also tried creating pom with:
<?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>group</groupId>
<artifactId>artifact</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>name</name>
<description>description</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>7.1.6</vaadin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
<version>${vaadin.version}</version>
</dependency>
</dependencies>
</project>
Running mvm clean install results in the following error:
[ERROR] Failed to execute goal on project artifact: Could not resolve dependencies for project group:artifact:war:1.0-SNAPSHOT: The following artifacts could not be resolved: com.vaadin:vaadin-server:jar:7.1.6, com.vaadin:vaadin-client-compiled:jar:7.1.6, com.vaadin:vaadin-client:jar:7.1.6, com.vaadin:vaadin-themes:jar:7.1.6: Failure to find com.vaadin:vaadin-server:jar:7.1.6 in http://10.255.251.14:9991/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
Also there are the following warnings seen:
[WARNING] The POM for com.vaadin:vaadin-server:jar:7.1.6 is missing, no dependency information available
[WARNING] The POM for com.vaadin:vaadin-client-compiled:jar:7.1.6 is missing, no dependency information available
[WARNING] The POM for com.vaadin:vaadin-client:jar:7.1.6 is missing, no dependency information available
[WARNING] The POM for com.vaadin:vaadin-themes:jar:7.1.6 is missing, no dependency information available
At first we thought there might be some problems with our nexus installation, but we also tried running these commands from external machine without nexus. Same issues.
Try to add
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
Add this to your pom.xml:
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Then you have to force the update. Example: mvn install -U
It seems that the problem is related to maven repositories and not vaadin.
I've tried locating computer in other country (most likely different maven repository mirror too) and it worked.
Update: I had it working for an hour or so without changing anything and then it started failing again.
This might be related to the heartbleed bug everyone is going crazy about at the moment. Admins probably patching it all over the place and there might be some disruptions to repository services or our own network.
Looks like the list of available archetypes isn't up to date.
Run this command mvn archetype:update-local-catalog
Basic info:
I use embedded Maven 3.0.4 in Eclipse Juno (with JBoss Tools).
settings.xml (straight from community.jboss.org/wiki/MavenGettingStarted-Users):
<profile>
<id>jboss-public-repository</id>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<activeProfiles>
<activeProfile>jboss-public-repository</activeProfile>
<activeProfile>jboss-deprecated-repository</activeProfile>
</activeProfiles>
Note: I tried also repository.jboss.org/nexus/content/groups/jboss and repository.jboss.org/nexus/content/groups/public/ with same results.
What I did:
I created Maven project from scrath using artifact org.jboss.spec.archetypes jboss-javaee6-webapp. System try to download repos. Everything downloads fine except two POMs:
maven-plugin-descriptor-2.0.6.pom
plexus-2.0.2.pom
I will focus on maven-plugin-descriptor, but plexus behave identically.
Error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project example:
Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved:
Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 ():
Failed to read artifact descriptor for org.apache.maven:maven-plugin-descriptor:jar:2.0.6:
Could not transfer artifact org.apache.maven:maven-plugin-descriptor:pom:2.0.6 from/to central (repo.maven.apache.org/maven2):
No response received after 60000 -> [Help 1]
Requested file is not present at all in repository.jboss.org/nexus/content/groups/public-jboss/org/apache/maven/maven-plugin-descriptor/2.0.6/ (returns 404).
I tried to go to repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.0.6/ directly in browser. File maven-plugin-descriptor-2.0.6.pom is present, but after click it thinks... thinks... thinks... aaand connection reset. Note that many other POMs was downloaded from repo.maven.apache.org without problems. Only this file for some reason Just Don't Work(TM).
Other:
I am NOT behind proxy. I DID use "delete whatever.lastUpdated" trick. Even deleted entire repo to force downloading everything again. Did not work, of course.
Any ideas? Or maybe I am barking at wrong tree and some other repository must be set in settings.xml? I have impression that maven tries to download too old versions...
Problem was solved. If someone have similiar problem to mine, he have to use mirrors.
In settings.xml:
<settings>
...
<mirrors>
<mirror>
<id>uk.maven.org</id>
<mirrorOf>central</mirrorOf>
<name>UK Central</name>
<url>http://uk.maven.org/maven2</url>
</mirror>
</mirrors>
...
</settings>
Every time i build something with Mavent i muss struggle with the searching a proper repo for the required Maven artifact. As now i am searching the repo for the spring-aop but can not find one. Actual pom.xml follows.
How can i approach assembling pom.xml properly?
Thanks.
<repositories>
<repository>
<id>springsource-milestone</id>
<url>http://maven.springframework.org/milestone</url>
</repository>
<repository>
<id>org.springframework.repository.maven</id>
<name>SpringSource Maven Repository</name>
<url>http://repository.springframework.org/maven/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.aop</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
</dependencies>
The artifact spring-aop is present in maven central repo.
Normally most of the released artifacts are present in maven central which need not be explicitly specified in pom.xml. You can use the search option of the central repo for this.
In the question above, you would need to include the additional spring repos only if you were looking for milestone (alpha/beta) releases.
I would recommend to use a repository manager instead of added repositories to the pom.