You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@river.apache.org by Tom Hobbs <tv...@googlemail.com> on 2012/01/25 11:33:12 UTC

Overriding initialMemberGroups in "options" when starting reggie

Does anyone know the correct incantation required to override the
initialMemberGroups value when starting reggie.

I've tried various permutations along the themes such as;

			new NonActivatableServiceDescriptor(
			    codebase,
			    policy,
			    classpath,
			    "com.sun.jini.reggie.TransientRegistrarImpl",
			    new String[] { config,
"com.sun.jini.reggie.initialMemberGroups=[\"Lester\", \"Jeff\"]" }) };

The above example gives a parse error on the '[' character.  I've
tried every variation I can think of, I've yet to hit the right one
though.

Does anyone have any ideas or can point me in the right direction?

Thanks,

Tom

Re: Overriding initialMemberGroups in "options" when starting reggie

Posted by Tom Hobbs <tv...@googlemail.com>.
It does indeed.  Complete stack trace below...

SEVERE: Reggie initialization failed
net.jini.config.ConfigurationException: Override 1: Line 1: expected
expression, found '['
	at net.jini.config.ConfigurationFile.oops(ConfigurationFile.java:2755)
	at net.jini.config.ConfigurationFile.access$1(ConfigurationFile.java:2749)
	at net.jini.config.ConfigurationFile$Parser.oops(ConfigurationFile.java:1731)
	at net.jini.config.ConfigurationFile$Parser.syntax(ConfigurationFile.java:1703)
	at net.jini.config.ConfigurationFile$Parser.token(ConfigurationFile.java:1676)
	at net.jini.config.ConfigurationFile$Parser.parseSubExpr(ConfigurationFile.java:1517)
	at net.jini.config.ConfigurationFile$Parser.parseExpr(ConfigurationFile.java:1472)
	at net.jini.config.ConfigurationFile$Entry.<init>(ConfigurationFile.java:680)
	at net.jini.config.ConfigurationFile$Parser.parseOverride(ConfigurationFile.java:1421)
	at net.jini.config.ConfigurationFile$Parser.<init>(ConfigurationFile.java:1235)
	at net.jini.config.ConfigurationFile.<init>(ConfigurationFile.java:1811)
	at net.jini.config.ConfigurationProvider.getInstance(ConfigurationProvider.java:225)
	at com.sun.jini.reggie.RegistrarImpl.<init>(RegistrarImpl.java:393)
	at com.sun.jini.reggie.TransientRegistrarImpl.<init>(TransientRegistrarImpl.java:39)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivatableServiceDescriptor.java:674)
	at com.sun.jini.start.ServiceStarter.create(ServiceStarter.java:287)
	at com.sun.jini.start.ServiceStarter.processServiceDescriptors(ServiceStarter.java:445)
	at com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:505)
	at org.apache.river.extra.easystart.StartLookupService.main(StartLookupService.java:34)
25-Jan-2012 11:25:48 com.sun.jini.start.ServiceStarter checkResultFailures
WARNING: Exception creating service.
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivatableServiceDescriptor.java:674)
	at com.sun.jini.start.ServiceStarter.create(ServiceStarter.java:287)
	at com.sun.jini.start.ServiceStarter.processServiceDescriptors(ServiceStarter.java:445)
	at com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:505)
	at org.apache.river.extra.easystart.StartLookupService.main(StartLookupService.java:34)
Caused by: net.jini.config.ConfigurationException: Override 1: Line 1:
expected expression, found '['
	at net.jini.config.ConfigurationFile.oops(ConfigurationFile.java:2755)
	at net.jini.config.ConfigurationFile.access$1(ConfigurationFile.java:2749)
	at net.jini.config.ConfigurationFile$Parser.oops(ConfigurationFile.java:1731)
	at net.jini.config.ConfigurationFile$Parser.syntax(ConfigurationFile.java:1703)
	at net.jini.config.ConfigurationFile$Parser.token(ConfigurationFile.java:1676)
	at net.jini.config.ConfigurationFile$Parser.parseSubExpr(ConfigurationFile.java:1517)
	at net.jini.config.ConfigurationFile$Parser.parseExpr(ConfigurationFile.java:1472)
	at net.jini.config.ConfigurationFile$Entry.<init>(ConfigurationFile.java:680)
	at net.jini.config.ConfigurationFile$Parser.parseOverride(ConfigurationFile.java:1421)
	at net.jini.config.ConfigurationFile$Parser.<init>(ConfigurationFile.java:1235)
	at net.jini.config.ConfigurationFile.<init>(ConfigurationFile.java:1811)
	at net.jini.config.ConfigurationProvider.getInstance(ConfigurationProvider.java:225)
	at com.sun.jini.reggie.RegistrarImpl.<init>(RegistrarImpl.java:393)
	at com.sun.jini.reggie.TransientRegistrarImpl.<init>(TransientRegistrarImpl.java:39)
	... 9 more

On Wed, Jan 25, 2012 at 11:18 AM, Simon IJskes - QCG <si...@qcg.nl> wrote:
> On 25-01-12 11:33, Tom Hobbs wrote:
>>
>> Does anyone know the correct incantation required to override the
>> initialMemberGroups value when starting reggie.
>>
>> I've tried various permutations along the themes such as;
>>
>>                        new NonActivatableServiceDescriptor(
>>                            codebase,
>>                            policy,
>>                            classpath,
>>                            "com.sun.jini.reggie.TransientRegistrarImpl",
>>                            new String[] { config,
>> "com.sun.jini.reggie.initialMemberGroups=[\"Lester\", \"Jeff\"]" }) };
>>
>> The above example gives a parse error on the '[' character.  I've
>> tried every variation I can think of, I've yet to hit the right one
>> though.
>
>
> Does this parse error originate from the Configuration parse? Could you
> paste the stacktrace?
>
> Gr. Sim
>
>
> --
> QCG, Software voor het MKB, 071-5890970, http://www.qcg.nl
> Quality Consultancy Group b.v., Leiderdorp, Kvk Den Haag: 28088397

Re: Overriding initialMemberGroups in "options" when starting reggie

Posted by Simon IJskes - QCG <si...@qcg.nl>.
On 25-01-12 12:33, Tom Hobbs wrote:

> I've been trying *everything* and have risked making my eyeballs
> bleed.  Missed that one, though.

LOL


-- 
QCG, Software voor het MKB, 071-5890970, http://www.qcg.nl
Quality Consultancy Group b.v., Leiderdorp, Kvk Den Haag: 28088397

Re: Overriding initialMemberGroups in "options" when starting reggie

Posted by Tom Hobbs <tv...@googlemail.com>.
You sir, are a genius.

I've been trying *everything* and have risked making my eyeballs
bleed.  Missed that one, though.

Cheers.

On Wed, Jan 25, 2012 at 11:29 AM, Simon IJskes - QCG <si...@qcg.nl> wrote:
> On 25-01-12 12:18, Simon IJskes - QCG wrote:
>>
>> On 25-01-12 11:33, Tom Hobbs wrote:
>>>
>>> Does anyone know the correct incantation required to override the
>>> initialMemberGroups value when starting reggie.
>>>
>>> I've tried various permutations along the themes such as;
>>>
>>> new NonActivatableServiceDescriptor(
>>> codebase,
>>> policy,
>>> classpath,
>>> "com.sun.jini.reggie.TransientRegistrarImpl",
>>> new String[] { config,
>>> "com.sun.jini.reggie.initialMemberGroups=[\"Lester\", \"Jeff\"]" }) };
>>>
>>> The above example gives a parse error on the '[' character. I've
>>> tried every variation I can think of, I've yet to hit the right one
>>> though.
>
>
> how about: '"com.sun.jini.reggie.initialMemberGroups= new String[] {
> \"Lester\", \"Jeff\" }' ?
>
>
>
>
> --
> QCG, Software voor het MKB, 071-5890970, http://www.qcg.nl
> Quality Consultancy Group b.v., Leiderdorp, Kvk Den Haag: 28088397

Re: Overriding initialMemberGroups in "options" when starting reggie

Posted by Simon IJskes - QCG <si...@qcg.nl>.
On 25-01-12 12:18, Simon IJskes - QCG wrote:
> On 25-01-12 11:33, Tom Hobbs wrote:
>> Does anyone know the correct incantation required to override the
>> initialMemberGroups value when starting reggie.
>>
>> I've tried various permutations along the themes such as;
>>
>> new NonActivatableServiceDescriptor(
>> codebase,
>> policy,
>> classpath,
>> "com.sun.jini.reggie.TransientRegistrarImpl",
>> new String[] { config,
>> "com.sun.jini.reggie.initialMemberGroups=[\"Lester\", \"Jeff\"]" }) };
>>
>> The above example gives a parse error on the '[' character. I've
>> tried every variation I can think of, I've yet to hit the right one
>> though.

how about: '"com.sun.jini.reggie.initialMemberGroups= new String[] { 
\"Lester\", \"Jeff\" }' ?



-- 
QCG, Software voor het MKB, 071-5890970, http://www.qcg.nl
Quality Consultancy Group b.v., Leiderdorp, Kvk Den Haag: 28088397

Re: Overriding initialMemberGroups in "options" when starting reggie

Posted by Simon IJskes - QCG <si...@qcg.nl>.
On 25-01-12 11:33, Tom Hobbs wrote:
> Does anyone know the correct incantation required to override the
> initialMemberGroups value when starting reggie.
>
> I've tried various permutations along the themes such as;
>
> 			new NonActivatableServiceDescriptor(
> 			    codebase,
> 			    policy,
> 			    classpath,
> 			    "com.sun.jini.reggie.TransientRegistrarImpl",
> 			    new String[] { config,
> "com.sun.jini.reggie.initialMemberGroups=[\"Lester\", \"Jeff\"]" }) };
>
> The above example gives a parse error on the '[' character.  I've
> tried every variation I can think of, I've yet to hit the right one
> though.

Does this parse error originate from the Configuration parse? Could you 
paste the stacktrace?

Gr. Sim


-- 
QCG, Software voor het MKB, 071-5890970, http://www.qcg.nl
Quality Consultancy Group b.v., Leiderdorp, Kvk Den Haag: 28088397

Re: Overriding initialMemberGroups in "options" when starting reggie

Posted by Tom Hobbs <tv...@googlemail.com>.
I agree.  I'm making judicious use of an empty config file and the
overrides to be able to specify things easily in Java (with
accompanying convenience methods) and starting services is much more
simple.

I'm only working with reggie, outrigger and mahalo at the moment, but
I've found something curious.  Has anyone else experienced this and is
it a bug somewhere else or just a bug in my implementation?

If I specify something such as;

new NonActivatableServiceDescriptor(
			    codebase, 	
			    policy,
			    classpath,
			    "com.sun.jini.mahalo.TransientMahaloImpl",
			    new String[] { config,
			                           "com.sun.jini.mahalo.serviceInfo=new
net.jini.lookup.entry.ServiceInfo(\"transName\", \"manufacturer\",
\"vendor\", \"version\", \"model\", \"serialNumber\")",
			    		       "com.sun.jini.mahalo.initialLookupAttributes = new
net.jini.core.entry.Entry[] { serviceInfo }"})};

When I lookup the service via reggie, there are two ServiceInfos in
initialLookupAttributes, the standard one the service gives itself and
the new one that I provide.

Anyone seen that, or got any thoughts on it?

On Wed, Jan 25, 2012 at 2:28 PM, Gregg Wonderly <ge...@cox.net> wrote:
> This is an example of one of those things where "just java" is the answer in the configuration file.  Constructing new objects, always works.  The subtle issues of what can and can't happen all revolve around invoking methods and using their return values.  As Sim pointed out, the new String[] { ... } syntax works fine.  I've always avoided using the command line options to adjust configuration, just because it can seem difficult to get it right, especially with quoting of quotes.
>
> Gregg Wonderly
>
> On Jan 25, 2012, at 4:33 AM, Tom Hobbs wrote:
>
>> Does anyone know the correct incantation required to override the
>> initialMemberGroups value when starting reggie.
>>
>> I've tried various permutations along the themes such as;
>>
>>                       new NonActivatableServiceDescriptor(
>>                           codebase,
>>                           policy,
>>                           classpath,
>>                           "com.sun.jini.reggie.TransientRegistrarImpl",
>>                           new String[] { config,
>> "com.sun.jini.reggie.initialMemberGroups=[\"Lester\", \"Jeff\"]" }) };
>>
>> The above example gives a parse error on the '[' character.  I've
>> tried every variation I can think of, I've yet to hit the right one
>> though.
>>
>> Does anyone have any ideas or can point me in the right direction?
>>
>> Thanks,
>>
>> Tom
>

Re: Overriding initialMemberGroups in "options" when starting reggie

Posted by Gregg Wonderly <ge...@cox.net>.
This is an example of one of those things where "just java" is the answer in the configuration file.  Constructing new objects, always works.  The subtle issues of what can and can't happen all revolve around invoking methods and using their return values.  As Sim pointed out, the new String[] { ... } syntax works fine.  I've always avoided using the command line options to adjust configuration, just because it can seem difficult to get it right, especially with quoting of quotes.

Gregg Wonderly

On Jan 25, 2012, at 4:33 AM, Tom Hobbs wrote:

> Does anyone know the correct incantation required to override the
> initialMemberGroups value when starting reggie.
> 
> I've tried various permutations along the themes such as;
> 
> 			new NonActivatableServiceDescriptor(
> 			    codebase,
> 			    policy,
> 			    classpath,
> 			    "com.sun.jini.reggie.TransientRegistrarImpl",
> 			    new String[] { config,
> "com.sun.jini.reggie.initialMemberGroups=[\"Lester\", \"Jeff\"]" }) };
> 
> The above example gives a parse error on the '[' character.  I've
> tried every variation I can think of, I've yet to hit the right one
> though.
> 
> Does anyone have any ideas or can point me in the right direction?
> 
> Thanks,
> 
> Tom