Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Failed to find space with url

I have created a space (In-memory data grid : mySpace) via gs-ui console (see the attached file). And while trying to access this in my Main.java program as below:

protected void initGigaSpaces() throws Exception { System.out.println("initGigaSpaces");

    String spaceName = "mySpace";

    IJSpace space = new UrlSpaceConfigurer("jini://*/*/mySpace").space();
    gigaSpace = new GigaSpaceConfigurer(space).gigaSpace();

    System.out.println("gigaSpace creation....");

    if (gigaSpace != null) {
        System.out.println("writing msg...");
        gigaSpace.write(new String("Hello"));

        System.out.println("reading msg...");
        String[] spaceEntries = gigaSpace.readMultiple(new String(), Integer.MAX_VALUE);

        if (spaceEntries != null)
            System.out.println("spaceEntries = " + spaceEntries.length);
        else 
            System.out.println("spaceEntries null");

        for (String msg : spaceEntries) {
            System.out.println(msg);
        }
    } else {
        System.out.println("gs null");
    }
}

Its throwing the following error:

initGigaSpaces Exception in thread "main" org.openspaces.core.space.CannotFindSpaceException: Failed to find space with url [jini:////mySpace?groups=gigaspaces-9.0.2-XAPPremium-ga&state=started]; nested exception is com.j_spaces.core.client.FinderException: LookupFinder failed to find service using the following service attributes:

 Service attributes: [net.jini.lookup.entry.Name(name=mySpace)]
 Service attributes: [com.j_spaces.lookup.entry.State(state=started,electable=null,replicable=null)]
 Lookup timeout: [5000]
 Classes: [interface com.j_spaces.core.service.Service]
 Jini Lookup Groups: [gigaspaces-9.0.2-XAPPremium-ga]
 Number of Lookup Services: 0

at org.openspaces.core.space.UrlSpaceFactoryBean.doCreateSpace(UrlSpaceFactoryBean.java:360)
at org.openspaces.core.space.AbstractSpaceFactoryBean.afterPropertiesSet(AbstractSpaceFactoryBean.java:175)
at org.openspaces.core.space.UrlSpaceConfigurer.create(UrlSpaceConfigurer.java:315)
at org.openspaces.core.space.UrlSpaceConfigurer.space(UrlSpaceConfigurer.java:327)
at com.showcase.service.Main.initGigaSpaces(Main.java:29)
at com.showcase.service.Main.main(Main.java:17)

Caused by: com.j_spaces.core.client.FinderException: LookupFinder failed to find service using the following service attributes:

 Service attributes: [net.jini.lookup.entry.Name(name=mySpace)]
 Service attributes: [com.j_spaces.lookup.entry.State(state=started,electable=null,replicable=null)]
 Lookup timeout: [5000]
 Classes: [interface com.j_spaces.core.service.Service]
 Jini Lookup Groups: [gigaspaces-9.0.2-XAPPremium-ga]
 Number of Lookup Services: 0


at com.j_spaces.core.client.LookupFinder.find(LookupFinder.java:360)
at com.j_spaces.core.client.SpaceFinder.findJiniService(SpaceFinder.java:894)
at com.j_spaces.core.client.SpaceFinder.findService(SpaceFinder.java:514)
at com.j_spaces.core.client.SpaceFinder.findService(SpaceFinder.java:467)
at com.j_spaces.core.client.SpaceFinder.find(SpaceFinder.java:357)
at org.openspaces.core.space.UrlSpaceFactoryBean.doCreateSpace(UrlSpaceFactoryBean.java:357)
... 5 more

But the same program is working under the gigaspaces example folder (hello-common). I am running this program in eclipse 3.2....

Its a maven application. I have attached my POM file also... I have all the necessary dependencies...

Edited by: Gopinathan Mani on Feb 14, 2013 8:05 AM h4. Attachments

[gs-agent.jpg|/upfiles/13759702235594203.jpeg]

[pom.xml|/upfiles/13759702238938405.xml]

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=4030]{quote}

asked 2013-02-14 07:29:04 -0500

get4gopim gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

Gopinathan , Before you run your application you have to deploy first the space. If you don't want to deploy the space , you can run it within your application. In order to do this you need to change the URL: {code} IJSpace space = new UrlSpaceConfigurer("/./mySpace").space(); {code}

If you do deploy the space and still can't connect try to have the locators added to the URL: {code} IJSpace space = new UrlSpaceConfigurer("jini:////mySpace?locators=IP").space(); {code}

Where the IP should be the machine IP running the data grid lookup service.

Note you should write your POJO class object rather using String object (or any other Java primitives). Your java class should follow our POJO guidelines: http://wiki.gigaspaces.com/wiki/displ...

See example below {code} @SpaceClass public class Person { private Integer id; private String name; private String lastName; private Integer age;

...
public Person() {}

@SpaceId(autoGenerate=false)
@SpaceRouting
public Integer getId() { return id;}

public void setId(Integer id) {  this.id = id; }

@SpaceProperty(index=BASIC)
public Long getLastName() { return lastName; }

public void setLastName(String type) { this.lastName = lastName; }

...

} {code}

Shay

answered 2013-02-14 13:29:29 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-02-14 07:29:04 -0500

Seen: 936 times

Last updated: Feb 14 '13