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

Ask Your Question

Client Security exception while connecting to space


I've problem connecting to a space from web client (app server: Glass fish). The PU is running with space default settings. How to set the default settings at client ?. please see below code.

private static String SPACE_URL = "ini:////myspace

SecurityConfig config = new SecurityConfig();
UrlSpaceConfigurer urlConfig= new UrlSpaceConfigurer(prop.getProperty(SPACE_URL));
IJSpace space = urlConfig.space();



  1. server.log

This thread was imported from the previous forum.
For your reference, the original is available here

asked 2008-11-18 16:54:38 -0600

sudhakarkr gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

Try this:
GigaSpace space = new GigaSpaceConfigurer(new UrlSpaceConfigurer("jini:////mySpace")).gigaSpace();



  1. server.log

answered 2008-11-18 17:30:52 -0600

shay hassidim gravatar image
edit flag offensive delete link more


Nope. Same error... see below exception from glass fish.. hope this helps.

java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at javax.security.jacc.PolicyConfigurationFactory.getPolicyConfigurationFactory(PolicyConfigurationFactory.java:111) at com.sun.enterprise.security.provider.BasePolicyWrapper.getPolicyFactory(BasePolicyWrapper.java:659) at com.sun.enterprise.security.provider.BasePolicyWrapper.getPolicyConfigForContext(BasePolicyWrapper.java:307) at com.sun.enterprise.security.provider.BasePolicyWrapper.doImplies(BasePolicyWrapper.java:389) at com.sun.enterprise.security.provider.BasePolicyWrapper.implies(BasePolicyWrapper.java:249) at java.security.ProtectionDomain.implies(ProtectionDomain.java:213) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:301) at java.security.AccessController.checkPermission(AccessController.java:546) h4. Attachments


sudhakarkr gravatar image sudhakarkr  ( 2008-11-18 17:45:17 -0600 )edit

Yep. U need to change the security policy property to use gs home/policy/policy.all.

It would be much simpler if u use the embedded jetty comes with the product.

Shay h4. Attachments


shay hassidim gravatar image shay hassidim  ( 2008-11-18 18:02:49 -0600 )edit

Hi Shay,

Please see more info on this...

It is failing on the return statement where it is calling SpaceFiner.find(spaceURLs);. The value of spaceURLs is [jini:////regionNYspace?groups=gigaspaces-6.6.1-XAP-ga&state=started] at the time of the failure. With same values and same calls the project works fine when ran directly from Eclipse but when the project is deployed to glassfish, it fails. I’ve also included call trace up to when it fails.

class UrlSpaceFactoryBean /** * Creates the space by calling {@link #doGetSpaceUrls()} and then using the returned * {@link SpaceURL} a space is found using {@link SpaceFinder#find(SpaceURL)}. */ protected IJSpace doCreateSpace() throws DataAccessException { SpaceURL[] spaceURLs = doGetSpaceUrls(); try { return (IJSpace) SpaceFinder.find(spaceURLs); } catch (FinderException e) { if (SpaceUtils.isRemoteProtocol(spaceURLs[0])) { throw new CannotFindSpaceException("Failed to find space with url " + Arrays.toString(spaceURLs) + "", e); } throw new CannotCreateSpaceException("Failed to create space with url " + Arrays.toString(spaceURLs) + "", e); } }

Call Trace

Daemon Thread [httpWorkerThread-8080-1] (Suspended)
SpaceFinder.prepareSecurity(String) line: 548 SpaceFinder.prepareSecurity(String) line: 547
SpaceFinder.find(SpaceURL[]) line: 204 UrlSpaceFactoryBean.doCreateSpace() line: 312
UrlSpaceFactoryBean(AbstractSpaceFactoryBean).afterPropertiesSet() line: 149
UrlSpaceConfigurer.space() line: 237
GigaSpaceConfigurer.<init>(UrlSpaceConfigurer) line: 60

where to specify policy.all - while deploying PU's ?. please provide details. Any changes to client code that connects to space ?.

Is this problem specific to Glass fish ?

Appreciate your response.

Thanks. h4. Attachments


sudhakarkr gravatar image sudhakarkr  ( 2008-11-18 18:38:05 -0600 )edit

Have your app server to use the following when started: -Djava.security.policy=D:\gigaspaces-xap-6.6.1-ga\policy\policy.all Shay h4. Attachments


shay hassidim gravatar image shay hassidim  ( 2008-11-19 07:59:27 -0600 )edit


No luck. I did tried changing the system property earlier to use policy.all (also myproj.policy (removed the parameters as in glassfish server.policy) in domain.xml but did not work. Still throws same exception. I've attached log for more details.

policy.all grant { permission java.security.AllPermission "", ""; };

myproj.policy grant { permission java.security.AllPermission; };

Thanks. h4. Attachments


sudhakarkr gravatar image sudhakarkr  ( 2008-11-19 08:53:53 -0600 )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


Asked: 2008-11-18 16:54:38 -0600

Seen: 84 times

Last updated: Nov 18 '08