Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Spatial noob exception "Index with the same name but different config exists!"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  19 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Janiak  
View profile  
 More options Sep 21 2012, 4:54 pm
From: Michael Janiak <michael.jan...@gmail.com>
Date: Fri, 21 Sep 2012 13:54:40 -0700 (PDT)
Local: Fri, Sep 21 2012 4:54 pm
Subject: Spatial noob exception "Index with the same name but different config exists!"

Hi All,

I'm to get some Spatial basics under my belt but after fiddling around with
spatial all afternoon I'm stuck at what seems like the most trivial of
problems. ( I actually ran into this same problem in previous attempts and
ended up abandoning my efforts )

I'm using the spatial example in the Good Relationships manual<http://static.springsource.org/spring-data/data-graph/snapshot-site/r...> and
Michael's post<https://groups.google.com/d/msg/neo4j/uOOZw70RSig/8QIdupLfYIEJ>as a starting point. I'm using venues from New York City but when I run a
unit test, I get an "Index with the same name but different config exists!"
exception. I suppose that this has something to do with points needing to
be unique and receiving the same wkt value if they're close together. But
it seems like that should be something expected from real life, for
example, you can have multiple "venues" in an office block.

Is there something obvious I'm missing here???

As always, thank you in advance!

As an FYI, I'm using the following Venue class and I tried defining the wkt
as both %.2f and %s, which I've also seen used.

@NodeEntity
public class Venue {
 @GraphId private Long graphId;
 @Indexed(indexType = IndexType.POINT, indexName = "VenueLocation")
private String wkt;

public void setLocation(float lon, float lat) {
this.wkt = String.format("POINT( %.2f %.2f )",lon,lat);

}
}

public interface VenueRepository extends GraphRepository<Venue>,
SpatialRepository<Venue>{}

And for the unit test I'm just doing this:

@Autowired private VenueRepository venueRep;

@Test
public void test2FiveNodes(){
 for (int i = 0; i < vArray.length; i++) {
Venue venue = new Venue();
venue.setLocation(locArray[i][1], locArray[i][0]);
venue = venueRep.save(venue);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Sep 21 2012, 5:00 pm
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Fri, 21 Sep 2012 14:00:09 -0700
Local: Fri, Sep 21 2012 5:00 pm
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"
Michael,
are all the tests failing like this or might there be an issue with
the database not being totally clean before runs?

Cheers,

/peter neubauer

Neo4j 1.8.RC1 "Vindeln Vy" -
http://blog.neo4j.org/2012/09/neo4j-18rc1-really-careful-ftw.html

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Wanna learn something new? Come to @graphconnect.

On Fri, Sep 21, 2012 at 1:54 PM, Michael Janiak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Janiak  
View profile  
 More options Sep 21 2012, 6:08 pm
From: Michael Janiak <michael.jan...@gmail.com>
Date: Fri, 21 Sep 2012 15:08:58 -0700 (PDT)
Local: Fri, Sep 21 2012 6:08 pm
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

I should have mentioned, I clean the database before every test like so:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:testContext.xml")
@Transactional
public class SpatialTest {

@Rollback(false)
@BeforeTransaction
public void cleanUpGraph() {
Neo4jHelper.cleanDb(template);

}

Also I just tried deleting the whole database and running just this test
and I get the error exactly when the second node is saved.

@Test
public void testNodes(){
 for (int i = 0; i < vArray.length; i++) {
Venue venue = new Venue();
venue.setLocation(locArray[i][1], locArray[i][0]);
System.out.println(i+": "+venue.getLocation());
 venue = template.save(venue);

}

Set<Venue> nodes = (Set<Venue>) venueRep.findAll();
 assertEquals(nodes.size(),5);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Sep 21 2012, 6:14 pm
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Fri, 21 Sep 2012 15:13:43 -0700
Local: Fri, Sep 21 2012 6:13 pm
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"
What is Neo4jHelper.cleanDb(template); doing?

Do you have that test isolated standalone somewhere? We might be able
to recreate it and add it to the standard SDN tests ...

Cheers,

/peter neubauer

Neo4j 1.8.RC1 "Vindeln Vy" -
http://blog.neo4j.org/2012/09/neo4j-18rc1-really-careful-ftw.html

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Wanna learn something new? Come to @graphconnect.

On Fri, Sep 21, 2012 at 3:08 PM, Michael Janiak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Janiak  
View profile  
 More options Sep 21 2012, 6:32 pm
From: Michael Janiak <michael.jan...@gmail.com>
Date: Fri, 21 Sep 2012 15:32:45 -0700 (PDT)
Local: Fri, Sep 21 2012 6:32 pm
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Hi Peter, thank you for these rapid responses!

I use the Neo4jHelper to clean the database before each test. I've been
using it for all my other tests and it's been working so far.

Here's all the pertinent code: http://pastebin.com/DR1B9mu9


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lasse Westh-Nielsen  
View profile  
 More options Sep 24 2012, 4:26 am
From: Lasse Westh-Nielsen <lasse.westh-niel...@neopersistence.com>
Date: Mon, 24 Sep 2012 09:26:44 +0100
Local: Mon, Sep 24 2012 4:26 am
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Michael,

The code you shared seems to work, for me at least - I have put it into a
single file test here, using just an in-memory db:

https://gist.github.com/3774902

Interestingly, when I add the cleanup bit I get a problem with Node[0], not
sure why - but don't think it has to do with spatial necessarily.

On Fri, Sep 21, 2012 at 11:32 PM, Michael Janiak
<michael.jan...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Craig Taverner  
View profile  
 More options Sep 24 2012, 12:12 pm
From: Craig Taverner <cr...@amanzi.com>
Date: Mon, 24 Sep 2012 18:12:37 +0200
Local: Mon, Sep 24 2012 12:12 pm
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Going back to the first email, I noticed that the error message was *"Index
with the same name but different config exists!". *I should mention that
this has nothing to do with features being similar or identical. It is
about the definition of the layer. Since we allow the layers to have custom
code for mapping custom domain models into geometries, this knowledge is
embedded in the layer in a dynamic way. For example, we provide three
built-in types of layers, OSMLayer, SimplePointLayer and EditableLayerImpl
(for WKT). If you try to create two layers with the same name, but
different types, you will get the error you see above.

I must assume that you have code that tries to create the layer a second
time, and the second time it does not specify the layer type and gets the
default choice (probably EditableLayerImpl). But the first time it was
created with some other type, perhaps SimplePointLayer if you are storing
only simple lat/long locations (seems to be the case).

On Mon, Sep 24, 2012 at 10:26 AM, Lasse Westh-Nielsen <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Janiak  
View profile  
 More options Sep 25 2012, 9:53 am
From: Michael Janiak <michael.jan...@gmail.com>
Date: Tue, 25 Sep 2012 06:53:12 -0700 (PDT)
Local: Tues, Sep 25 2012 9:53 am
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Hi Lasse, thank you for doing that!

I'm trying to reproduce your results using your exact code including the
ImpermanentGraphDatabase, however I get a java.lang.NoClassDefFoundError:
org/springframework/core/annotation/AnnotationAttributes

This feels like a pom problem. Are there other dependencies I should be
using?

I've got

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>2.1.0.RC2</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.1.0.RELEASE</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<type>test-jar</type>
<version>1.8.M06</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-spatial</artifactId>
<version>0.9-SNAPSHOT</version>
</dependency>

Michael


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Janiak  
View profile  
 More options Sep 25 2012, 9:59 am
From: Michael Janiak <michael.jan...@gmail.com>
Date: Tue, 25 Sep 2012 06:59:48 -0700 (PDT)
Local: Tues, Sep 25 2012 9:59 am
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Hi Chris, sorry but that is way over my head. At the moment I'm literally
having a problem with executing the code I pasted earlier  
http://pastebin.com/DR1B9mu9. I initially thought there was a problem with
having multiple nodes of a similar POINT index but you seem to be saying
that that is not the case. Are you saying that I'm inadvertently creating
two layers of the same name? How could I change the above code to correct
that?

Could it be something to do with the fact that I use a REST database for my
test context?

<neo4j:config graphDatabaseService="graphDatabaseService"/>
<bean id="graphDatabaseService"
class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase">
  <constructor-arg index="0" value="http://localhost:7474/db/data" />
</bean>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Sep 25 2012, 11:45 am
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Tue, 25 Sep 2012 08:45:51 -0700
Local: Tues, Sep 25 2012 11:45 am
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Can you share the full exception stacktrace?

And could you upgrade to SDN-rest 2.1.0.RC4 ?

And remove the explicit rest-graphdb dependency ?

I think there was an issue with index type-checking in the rest-graphdb but am not sure.

A sample project would be great though !

Michael

Am 25.09.2012 um 06:59 schrieb Michael Janiak:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Janiak  
View profile  
 More options Sep 25 2012, 9:41 pm
From: Michael Janiak <michael.jan...@gmail.com>
Date: Tue, 25 Sep 2012 18:41:56 -0700 (PDT)
Local: Tues, Sep 25 2012 9:41 pm
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Hi Michael,

I updated the SDN rest dependency and tried removing the rest-grapdb
dependency but it still doesn't work.

Here's the full stack trace and test project:  
https://github.com/MichaelJaniak/neo4j-spatial-test/. I've included all the
dependencies that I'm using for my main project.

As an aside, removing the dependency artifactId: spring-data-neo4j-rest
produces one of these: ERROR
org.springframework.test.context.TestContextManager - Caught exception
while allowing TestExecutionListener
[org.springframework.test.context.support.DependencyInjectionTestExecutionL istener@3db9b677]
to prepare test instance
[com.spatialtest.app.SpatialTest@6b7a5e49] java.lang.IllegalStateException:
Failed to load ApplicationContext

Michael


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Sep 26 2012, 3:14 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Wed, 26 Sep 2012 00:14:14 -0700
Local: Wed, Sep 26 2012 3:14 am
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"
Michael,
are you sure you have installed the spatial plugin into your Neo4j
server? Otherwise the spatial index will not work.

Cheers,

/peter neubauer

Neo4j 1.8.RC1 "Vindeln Vy" -
http://blog.neo4j.org/2012/09/neo4j-18rc1-really-careful-ftw.html

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Wanna learn something new? Come to @graphconnect.

On Tue, Sep 25, 2012 at 6:41 PM, Michael Janiak

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Janiak  
View profile  
 More options Sep 26 2012, 9:05 am
From: Michael Janiak <michael.jan...@gmail.com>
Date: Wed, 26 Sep 2012 06:05:44 -0700 (PDT)
Local: Wed, Sep 26 2012 9:05 am
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Peter,

Thank you!

That's why it's noob question, I didn't install the plugin I thought the
maven dependency below would be enough.

I'll try it out. Hopefully I'll figure out how to get it onto Heroku.

                <dependency>
                        <groupId>org.neo4j</groupId>
                        <artifactId>neo4j-spatial</artifactId>
                        <version>0.9-SNAPSHOT</version>
                </dependency>

Best,

Michael

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Sep 26 2012, 10:36 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Wed, 26 Sep 2012 07:35:40 -0700
Local: Wed, Sep 26 2012 10:35 am
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"
Michael,
you have to install the plugin into your server that you are running
against over REST in your setup, see

https://github.com/neo4j/spatial/

"Using the Neo4j Spatial Server plugin"

bascially,
build the plugin with

git clone https://github.com/neo4j/spatial/

then copy the target/....server-plugin.zip and expand it unde rthe
NEO4J_SERVER/plugins directory.

Cheers,

/peter neubauer

Neo4j 1.8.RC1 "Vindeln Vy" -
http://blog.neo4j.org/2012/09/neo4j-18rc1-really-careful-ftw.html

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Wanna learn something new? Come to @graphconnect.

On Wed, Sep 26, 2012 at 6:05 AM, Michael Janiak

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Janiak  
View profile  
 More options Oct 2 2012, 1:53 pm
From: Michael Janiak <michael.jan...@gmail.com>
Date: Tue, 2 Oct 2012 10:53:27 -0700 (PDT)
Local: Tues, Oct 2 2012 1:53 pm
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Thanks Peter, I have this, running on my local Neo4j server and with a few
hiccups it seems to be working, for example, I can run search queries like
this, which is great:

START venuesSpatial=node:location('withinDistance:[40.7143, -74.0099,
15.0]'),
user = node(5)
MATCH user-[:LIKES]->venues
WHERE ID(venues) = venuesSpatial.id AND venues.name=~".*(?i)hall.*"
RETURN venues

My last question is, I have my production app running on Heroku and I'm
using a Neo4j hosted database instance. How do I go about adding the
spatial plugin onto that? I've had a look at this documentation and it I
can't find any guidance https://devcenter.heroku.com/articles/neo4j

Michael

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Oct 2 2012, 3:33 pm
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Tue, 2 Oct 2012 21:32:55 +0200
Local: Tues, Oct 2 2012 3:32 pm
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"
Michael,
uhh, first, I am not sure Heroku instances should be run in production
(isn't it in beta)? Secondly, currently the free plan (paid ones to
come) is not letting you install plugins. for that, I would take an
environment where you have more control, like an AWS instance on US
East (near Heroku), and spin up your own Neo4j Server, that you can
connect to from Heroku. Would that work?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Wanna learn something new? Come to http://graphconnect.com

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Janiak  
View profile  
 More options Oct 3 2012, 10:22 am
From: Michael Janiak <michael.jan...@gmail.com>
Date: Wed, 3 Oct 2012 07:22:21 -0700 (PDT)
Local: Wed, Oct 3 2012 10:22 am
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

I thought it would be something like that. We were trying to push that out
into the future but I guess we'll have to fast track. We'll probably just
deploy the whole app onto EC2. I saw that someone prepared an AMI Neo4j
image so we might use that, or just roll our own if it's too complicated.

Michael

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Oct 3 2012, 11:08 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Wed, 3 Oct 2012 17:08:29 +0200
Local: Wed, Oct 3 2012 11:08 am
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"
Yeah,

here you go, http://cloud.dzone.com/articles/how-deploy-neo4j-instance

feel free to publish your updated instance for others to use.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Wanna learn something new? Come to http://graphconnect.com

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Janiak  
View profile  
 More options Oct 20 2012, 1:18 pm
From: Michael Janiak <michael.jan...@gmail.com>
Date: Sat, 20 Oct 2012 10:18:17 -0700 (PDT)
Local: Sat, Oct 20 2012 1:18 pm
Subject: Re: [Neo4j] Spatial noob exception "Index with the same name but different config exists!"

Thank you so much for all your help!

We've actually decided against this for now... too much effort for a beta,
so we're taking the mvp approach and living without.

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »