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

Ask Your Question
0

Space lookup fails from web app

Hi,

I am currently playing around with GigaSpaces XAP on Windows XP. I have created a simple PU which creates an embedded space using the following Spring snippet:

<os-core:space id="space" url="/./saiSpace" lookup-groups="bms"/>

Also, I have created a JEE5 web app deployed to glassfish v2 UR1 app server that is supposed to attach to the space and populate it with some objects. However, the lookup of the space fails miserably with the following stack trace:

[#|2008-03-03T10:09:26.811+0100|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=51;_ThreadName=Thread-53;_RequestID=dcd9417f-a121-47a2-abde-da304b4db0c3;|WebModule[/gs-sai-service]PWC1275: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'space': Invocation of init method failed; nested exception is org.openspaces.core.space.CannotFindSpaceException: Failed to find space with url [jini:////saiSpace?groups=bms&state=started]; nested exception is com.j_spaces.core.client.FinderException: LookupFinder failed to find service using the following service attributes:

 Service attributes: [com.j_spaces.lookup.entry.State(state=started,electable=null,replicable=null)]
 Service attributes: [net.jini.lookup.entry.Name(name=saiSpace)]
 Lookup timeout: [5000]
 Classes: [interface com.j_spaces.core.service.Service]
 Jini Lookup Groups: [bms]

Caused by: org.openspaces.core.space.CannotFindSpaceException: Failed to find space with url [jini:////saiSpace?groups=bms&state=started]; nested exception is com.j_spaces.core.client.FinderException: LookupFinder failed to find service using the following service attributes:

 Service attributes: [com.j_spaces.lookup.entry.State(state=started,electable=null,replicable=null)]
 Service attributes: [net.jini.lookup.entry.Name(name=saiSpace)]
 Lookup timeout: [5000]
 Classes: [interface com.j_spaces.core.service.Service]
 Jini Lookup Groups: [bms]

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

 Service attributes: [com.j_spaces.lookup.entry.State(state=started,electable=null,replicable=null)]
 Service attributes: [net.jini.lookup.entry.Name(name=saiSpace)]
 Lookup timeout: [5000]
 Classes: [interface com.j_spaces.core.service.Service]
 Jini Lookup Groups: [bms]

at com.j_spaces.core.client.LookupFinder.find(SourceFile:349)
at com.j_spaces.core.client.SpaceFinder.a(SourceFile:957)
at com.j_spaces.core.client.SpaceFinder._find(SourceFile:543)
at com.j_spaces.core.client.SpaceFinder.find(SourceFile:387)
at org.openspaces.core.space.UrlSpaceFactoryBean.doCreateSpace(UrlSpaceFactoryBean.java:275)
at org.openspaces.core.space.AbstractSpaceFactoryBean.afterPropertiesSet(AbstractSpaceFactoryBean.java:124)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:247)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:796)
at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:592)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4523)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5184)
at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:148)
at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:170)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:955)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1584)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:182)
at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:278)
at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:974)
at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:961)
at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:464)
at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:591)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:635)
at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:744)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
at com.sun.enterprise.deployment.client.DeploymentClientUtils.startApplication(DeploymentClientUtils.java:145)
at com.sun.enterprise.deployment.client.DeployAction.run(DeployAction.java:537)
at java ...
(more)

asked 2008-03-03 03:28:01 -0500

sophokles gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

Kai,

it shouldn't have anything to do with the web app. Are you sure you can see the space from the UI? (did you use the same lookup group)?

If so, can you run a simple main which will lookup the space?

-Guy

answered 2008-03-03 03:53:30 -0500

guy sayar gravatar image
edit flag offensive delete link more

Comments

I can see the space in the Space Browser of gs-ui. According to it the space has Jini Groups "bms" and "gigaspaces-6.0XAP" which I am also using in the applicationContext.xml of the web app. I will try to run a simple standalone class and post the results.

Kai

sophokles gravatar imagesophokles ( 2008-03-03 03:58:29 -0500 )edit

Hi,

I have run the following TestCase:

public class SpaceLookupTest extends TestCase { Logger log = Logger.getLogger(SpaceLookupTest.class.getName());

public void testLookup() throws Exception
{    
    Object obj = SpaceFinder.find("jini://*/*/saiSpace?groups=bms");
    assertNotNull("lookup returned null reference", obj);
}

}

The lookup fails as well with the following stack trace:

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

     Service attributes: [com.j_spaces.lookup.entry.State(state=started,electable=null,replicable=null)]
     Service attributes: [net.jini.lookup.entry.Name(name=saiSpace)]
     Lookup timeout: [5000]
     Classes: [interface com.j_spaces.core.service.Service]
     Jini Lookup Groups: [bms]

    at com.j_spaces.core.client.LookupFinder.find(SourceFile:349)
    at com.j_spaces.core.client.SpaceFinder.a(SourceFile:957)
    at com.j_spaces.core.client.SpaceFinder._find(SourceFile:543)
    at com.j_spaces.core.client.SpaceFinder.internalFind(SourceFile:345)
    at com.j_spaces.core.client.SpaceFinder.internalFind(SourceFile:333)
    at com.j_spaces.core.client.SpaceFinder.find(SourceFile:412)
    at com.bosch.bms.SpaceLookupTest.testLookup(SpaceLookupTest.java:24)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)

Kai

sophokles gravatar imagesophokles ( 2008-03-03 04:24:54 -0500 )edit

It looks to me like a groups issues.

Can you remove the groups attribute from both the server and the client? (i.e. jini:////saiSpace at client, and /./saiSapce at server).

-Guy

guy sayar gravatar imageguy sayar ( 2008-03-03 04:30:26 -0500 )edit

Okay, I have changed the pu.xml to

<os-core:space id="space" url="/./saiSpace"/>

and the test case to

Object obj = SpaceFinder.find("jini:////saiSpace");

This succeeds now. However, when I change the applicationContext.xml accordingly to

<os-core:space id="space" url="jini://*/*/saiSpace"/>

I still get the following stack trace during lookup:

[#|2008-03-03T11:39:47.862+0100|SEVERE|sun-appserver9.1|org.springframework.web.context.ContextLoader|_ThreadID=14;_ThreadName=pool-1-thread-6;_RequestID=9c971862-4686-431a-86e6-459eeeb96c6b;|Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'space': Invocation of init method failed; nested exception is org.openspaces.core.space.CannotFindSpaceException: Failed to find space with url [jini:////saiSpace?groups=gigaspaces-6.0XAP&state=started]; nested exception is com.j_spaces.core.client.FinderException: LookupFinder failed to find service using the following service attributes:

 Service attributes: [com.j_spaces.lookup.entry.State(state=started,electable=null,replicable=null)]
 Service attributes: [net.jini.lookup.entry.Name(name=saiSpace)]
 Lookup timeout: [5000]
 Classes: [interface com.j_spaces.core.service.Service]
 Jini Lookup Groups: [gigaspaces-6.0XAP]

Caused by: org.openspaces.core.space.CannotFindSpaceException: Failed to find space with url [jini:////saiSpace?groups=gigaspaces-6.0XAP&state=started]; nested exception is com.j_spaces.core.client.FinderException: LookupFinder failed to find service using the following service attributes:

 Service attributes: [com.j_spaces.lookup.entry.State(state=started,electable=null,replicable=null)]
 Service attributes: [net.jini.lookup.entry.Name(name=saiSpace)]
 Lookup timeout: [5000]
 Classes: [interface com.j_spaces.core.service.Service]
 Jini Lookup Groups: [gigaspaces-6.0XAP]

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

 Service attributes: [com.j_spaces.lookup.entry.State(state=started,electable=null,replicable=null)]
 Service attributes: [net.jini.lookup.entry.Name(name=saiSpace)]
 Lookup timeout: [5000]
 Classes: [interface com.j_spaces.core.service.Service]
 Jini Lookup Groups: [gigaspaces-6.0XAP]

at com.j_spaces.core.client.LookupFinder.find(SourceFile:349)
at com.j_spaces.core.client.SpaceFinder.a(SourceFile:957)
at com.j_spaces.core.client.SpaceFinder._find(SourceFile:543)
at com.j_spaces.core.client.SpaceFinder.find(SourceFile:387)
at org.openspaces.core.space.UrlSpaceFactoryBean.doCreateSpace(UrlSpaceFactoryBean.java:275)
at org.openspaces.core.space.AbstractSpaceFactoryBean.afterPropertiesSet(AbstractSpaceFactoryBean.java:124)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:247)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:796)
at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:592)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java ...
(more)
sophokles gravatar imagesophokles ( 2008-03-03 04:43:56 -0500 )edit

Hi,

I have moved my test case to a standalone class with a main method. Guess what, now it cannot find the space anymore using url:

jini:////saiSpace

which has worked an hour ago in the JUnit test. However, I have restarted the GSM and GSC in between ... All of this stuff seems to behave very unpredictably. What else can I do? Do you need any stacktraces, log files etc?

Kai

sophokles gravatar imagesophokles ( 2008-03-03 07:20:04 -0500 )edit

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: 2008-03-03 03:28:01 -0500

Seen: 266 times

Last updated: Mar 03 '08