Discussion:
any ideas what cause this hivemind startup exception?
John Coleman
2006-02-08 15:12:46 UTC
Permalink
Exception in thread "main"
org.apache.hivemind.ApplicationRuntimeException: Service point
hivemind.Startup does not exist.
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getServicePoint(RegistryInfrastructureImpl.java:179)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getService(RegistryInfrastructureImpl.java:205)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.startup(RegistryInfrastructureImpl.java:434)
at
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.java:154)
at
org.apache.hivemind.impl.RegistryBuilder.constructDefaultRegistry(RegistryBuilder.java:196)
James Carman
2006-02-08 15:15:40 UTC
Permalink
What code are you using to construct your registry?



_____

From: John Coleman [mailto:***@ntlworld.com]
Sent: Wednesday, February 08, 2006 10:13 AM
To: HiveMind user group
Subject: any ideas what cause this hivemind startup exception?



Exception in thread "main"
org.apache.hivemind.ApplicationRuntimeException: Service point
hivemind.Startup does not exist.
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getServicePoint(Registry
InfrastructureImpl.java:179)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getService(RegistryInfra
structureImpl.java:205)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.startup(RegistryInfrastr
uctureImpl.java:434)
at
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.j
ava:154)
at
org.apache.hivemind.impl.RegistryBuilder.constructDefaultRegistry(RegistryBu
ilder.java:196)
John Coleman
2006-02-08 16:04:18 UTC
Permalink
this:

/**
* Bootstrap the application using HiveMind regsitry.
*
* @param args String[]
*/
public static final void main(String[] args) {
// create an application main class using HiveMind factory
registry = RegistryBuilder.constructDefaultRegistry();
VTMain main = (VTMain) registry.getService(VTMain.class);
main.execute();
}

It works when run in my JBuilder environment, but using the maven build,
will not run it.

TIA,
John



----- Original Message -----
From: James Carman
To: hivemind-***@jakarta.apache.org
Sent: Wednesday, February 08, 2006 3:15 PM
Subject: RE: any ideas what cause this hivemind startup exception?


What code are you using to construct your registry?




From: John Coleman [mailto:***@ntlworld.com]
Sent: Wednesday, February 08, 2006 10:13 AM
To: HiveMind user group
Subject: any ideas what cause this hivemind startup exception?

Exception in thread "main"
org.apache.hivemind.ApplicationRuntimeException: Service point
hivemind.Startup does not exist.
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getServicePoint(Registry
InfrastructureImpl.java:179)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getService(RegistryInfra
structureImpl.java:205)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.startup(RegistryInfrastr
uctureImpl.java:434)
at
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.j
ava:154)
at
org.apache.hivemind.impl.RegistryBuilder.constructDefaultRegistry(RegistryBu
ilder.java:196)
Knut Wannheden
2006-02-08 16:13:20 UTC
Permalink
You will get this if HiveMind is unable to find its own hivemodule.xml
files. Although I don't quite see why it would fail. Note that
HiveMind (per default) uses the context class loader to load the
hivemodule.xml files.

Sorry if I can't provide any better help.

--knut
Post by John Coleman
/**
* Bootstrap the application using HiveMind regsitry.
*
*/
public static final void main(String[] args) {
// create an application main class using HiveMind factory
registry = RegistryBuilder.constructDefaultRegistry();
VTMain main = (VTMain) registry.getService(VTMain.class);
main.execute();
}
It works when run in my JBuilder environment, but using the maven build,
will not run it.
TIA,
John
----- Original Message -----
From: James Carman
Sent: Wednesday, February 08, 2006 3:15 PM
Subject: RE: any ideas what cause this hivemind startup exception?
What code are you using to construct your registry?
Sent: Wednesday, February 08, 2006 10:13 AM
To: HiveMind user group
Subject: any ideas what cause this hivemind startup exception?
Exception in thread "main"
org.apache.hivemind.ApplicationRuntimeException: Service point
hivemind.Startup does not exist.
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getServicePoint(Registry
InfrastructureImpl.java:179)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getService(RegistryInfra
structureImpl.java:205)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.startup(RegistryInfrastr
uctureImpl.java:434)
at
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.j
ava:154)
at
org.apache.hivemind.impl.RegistryBuilder.constructDefaultRegistry(RegistryBu
ilder.java:196)
---------------------------------------------------------------------
John Coleman
2006-02-08 16:18:47 UTC
Permalink
It is strange, because as far as I know these files are in the same JAR as
the HM code, which is clearly executing.

This is not a webapp BTW.

John

----- Original Message -----
From: "Knut Wannheden" <***@gmail.com>
To: <hivemind-***@jakarta.apache.org>
Sent: Wednesday, February 08, 2006 4:13 PM
Subject: Re: any ideas what cause this hivemind startup exception?


You will get this if HiveMind is unable to find its own hivemodule.xml
files. Although I don't quite see why it would fail. Note that
HiveMind (per default) uses the context class loader to load the
hivemodule.xml files.

Sorry if I can't provide any better help.

--knut
Post by John Coleman
/**
* Bootstrap the application using HiveMind regsitry.
*
*/
public static final void main(String[] args) {
// create an application main class using HiveMind factory
registry = RegistryBuilder.constructDefaultRegistry();
VTMain main = (VTMain) registry.getService(VTMain.class);
main.execute();
}
It works when run in my JBuilder environment, but using the maven build,
will not run it.
TIA,
John
----- Original Message -----
From: James Carman
Sent: Wednesday, February 08, 2006 3:15 PM
Subject: RE: any ideas what cause this hivemind startup exception?
What code are you using to construct your registry?
Sent: Wednesday, February 08, 2006 10:13 AM
To: HiveMind user group
Subject: any ideas what cause this hivemind startup exception?
Exception in thread "main"
org.apache.hivemind.ApplicationRuntimeException: Service point
hivemind.Startup does not exist.
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getServicePoint(Registry
Post by John Coleman
InfrastructureImpl.java:179)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getService(RegistryInfra
Post by John Coleman
structureImpl.java:205)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.startup(RegistryInfrastr
Post by John Coleman
uctureImpl.java:434)
at
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.j
Post by John Coleman
ava:154)
at
org.apache.hivemind.impl.RegistryBuilder.constructDefaultRegistry(RegistryBu
Post by John Coleman
ilder.java:196)
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-***@jakarta.apache.org
For additional commands, e-mail: hivemind-user-***@jakarta.apache.org
Knut Wannheden
2006-02-08 16:25:28 UTC
Permalink
I get the impression your context class loader is set to something
"strange". You could verify that by doing something like this before
you construct the registry:

Thread.currentThread().setContextClassLoader(RegistryBuilder.class.getClassLoader());

Although I don't know how you should resolve this issue...

--knut
Post by John Coleman
It is strange, because as far as I know these files are in the same JAR as
the HM code, which is clearly executing.
This is not a webapp BTW.
John
----- Original Message -----
Sent: Wednesday, February 08, 2006 4:13 PM
Subject: Re: any ideas what cause this hivemind startup exception?
You will get this if HiveMind is unable to find its own hivemodule.xml
files. Although I don't quite see why it would fail. Note that
HiveMind (per default) uses the context class loader to load the
hivemodule.xml files.
Sorry if I can't provide any better help.
--knut
Post by John Coleman
/**
* Bootstrap the application using HiveMind regsitry.
*
*/
public static final void main(String[] args) {
// create an application main class using HiveMind factory
registry = RegistryBuilder.constructDefaultRegistry();
VTMain main = (VTMain) registry.getService(VTMain.class);
main.execute();
}
It works when run in my JBuilder environment, but using the maven build,
will not run it.
TIA,
John
----- Original Message -----
From: James Carman
Sent: Wednesday, February 08, 2006 3:15 PM
Subject: RE: any ideas what cause this hivemind startup exception?
What code are you using to construct your registry?
Sent: Wednesday, February 08, 2006 10:13 AM
To: HiveMind user group
Subject: any ideas what cause this hivemind startup exception?
Exception in thread "main"
org.apache.hivemind.ApplicationRuntimeException: Service point
hivemind.Startup does not exist.
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getServicePoint(Registry
Post by John Coleman
InfrastructureImpl.java:179)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getService(RegistryInfra
Post by John Coleman
structureImpl.java:205)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.startup(RegistryInfrastr
Post by John Coleman
uctureImpl.java:434)
at
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.j
Post by John Coleman
ava:154)
at
org.apache.hivemind.impl.RegistryBuilder.constructDefaultRegistry(RegistryBu
Post by John Coleman
ilder.java:196)
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Martin Pike
2006-02-09 05:57:03 UTC
Permalink
I am attempting to initialise an instance of a class with one of two
sets of data, specified in a hivemodule.xml file, defined as
contributions attached to configuration points.

The code shows instantiating of the object. If the service point called
is 'testConfig.address' the code runs ok, but if I call the service
point 'testConfig.address2' which references the second contribution it
fails with error:

Error at file:...../META-INF/hivemodule.xml, line 41, column 72: Unable
to update property data of object ***@210b5b:
java.lang.reflect.InvocationTargetException
org.apache.hivemind.ApplicationRuntimeException: Unable to update
property data of object ***@210b5b:
java.lang.reflect.InvocationTargetException

I am new to HiveMind and would appreciate any pointers as to what I'm
doing wrong.

--Code

public static void main(String[] args) {
Registry registry = RegistryBuilder.constructDefaultRegistry();
Address address =
(Address)registry.getService("testConfig.address2", Address.class);
System.out.print(address.getAddress());
}

-- hivemodule.xml

<?xml version="1.0"?>
<module id="testConfig" version="1.0.0" package = "test.config">

<configuration-point id="Address">
<schema>
<element name="datum">
<attribute name="key" required="true"/>
<attribute name="value" required="true"/>
<conversion class="test.config.Datum"/>
</element>
</schema>
</configuration-point>
<configuration-point id="Address2" schema-id="Address" />
<contribution configuration-id="Address">
<datum key="road" value="Temple Quay"/>
<datum key="town" value="Bristol"/>
<datum key="postcode" value="BS1"/>
<datum key="country" value="UK"/>
</contribution>
<contribution configuration-id="Address2" >
<datum key="road" value="Pall Mall"/>
<datum key="town" value="London"/>
<datum key="postcode" value="SW1"/>
<datum key="country" value="UK"/>
</contribution>

<service-point id="address" interface="test.config.Address">
<invoke-factory>
<construct class="test.config.AddressImpl">
<set-configuration property="data" configuration-id="Address"/>
</construct>
</invoke-factory>
</service-point>

<service-point id="address2" interface="test.config.Address">
<invoke-factory>
<construct class="test.config.AddressImpl">
<set-configuration property="data" configuration-id="Address2"/>
</construct>
</invoke-factory>
</service-point>

</module>

Regards
Martin Pike
Shing Hing Man
2006-02-09 11:13:51 UTC
Permalink
Post by Martin Pike
<configuration-point id="Address2"
schema-id="Address" />
In the above, I do not think you have specified a
schema with id=Address.

In the following, try replacing
<schema> with <schema id="Address">
Post by Martin Pike
<configuration-point id="Address">
<schema>
<element name="datum">
<attribute name="key" required="true"/>
<attribute name="value" required="true"/>
<conversion class="test.config.Datum"/>
</element>
</schema>
</configuration-point>
Shing
Post by Martin Pike
I am attempting to initialise an instance of a class
with one of two
sets of data, specified in a hivemodule.xml file,
defined as
contributions attached to configuration points.
The code shows instantiating of the object. If the
service point called
is 'testConfig.address' the code runs ok, but if I
call the service
point 'testConfig.address2' which references the
second contribution it
Error at file:...../META-INF/hivemodule.xml, line
41, column 72: Unable
to update property data of object
java.lang.reflect.InvocationTargetException
Unable to update
java.lang.reflect.InvocationTargetException
I am new to HiveMind and would appreciate any
pointers as to what I'm
doing wrong.
--Code
public static void main(String[] args) {
Registry registry =
RegistryBuilder.constructDefaultRegistry();
Address address =
(Address)registry.getService("testConfig.address2",
Address.class);
System.out.print(address.getAddress());
}
-- hivemodule.xml
<?xml version="1.0"?>
<module id="testConfig" version="1.0.0" package =
"test.config">
<configuration-point id="Address">
<schema>
<element name="datum">
<attribute name="key" required="true"/>
<attribute name="value" required="true"/>
<conversion class="test.config.Datum"/>
</element>
</schema>
</configuration-point>
<configuration-point id="Address2"
schema-id="Address" />
<contribution configuration-id="Address">
<datum key="road" value="Temple Quay"/>
<datum key="town" value="Bristol"/>
<datum key="postcode" value="BS1"/>
<datum key="country" value="UK"/>
</contribution>
<contribution configuration-id="Address2" >
<datum key="road" value="Pall Mall"/>
<datum key="town" value="London"/>
<datum key="postcode" value="SW1"/>
<datum key="country" value="UK"/>
</contribution>
<service-point id="address"
interface="test.config.Address">
<invoke-factory>
<construct class="test.config.AddressImpl">
<set-configuration property="data"
configuration-id="Address"/>
</construct>
</invoke-factory>
</service-point>
<service-point id="address2"
interface="test.config.Address">
<invoke-factory>
<construct class="test.config.AddressImpl">
<set-configuration property="data"
configuration-id="Address2"/>
</construct>
</invoke-factory>
</service-point>
</module>
Regards
Martin Pike
Home page :
http://uk.geocities.com/matmsh/index.html



___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
Martin Pike
2006-02-09 11:39:52 UTC
Permalink
Shing,

Thankyou for your suggestion , however it would appear that adding id to
schema is illegal as I receive the message:

SEVERE: Error at file:...../testConfig/bin/META-INF/hivemodule.xml, line
5, column 28: Unknown attribute 'id' in element
module/configuration-point/schema.

However on checking the documentation at
'HiveMind1.1/docs/descriptor.html#configuration-point' it states that id
is required. This would seem to go against the examples that are shown
in the documentation of the use of <schema> which do not have an id
attribute.

What is correct? Is id valid/required as an id of schema or not?
Post by Shing Hing Man
Post by Martin Pike
<configuration-point id="Address2"
schema-id="Address" />
In the above, I do not think you have specified a
schema with id=Address.
In the following, try replacing
<schema> with <schema id="Address">
Post by Martin Pike
<configuration-point id="Address">
<schema>
<element name="datum">
<attribute name="key" required="true"/>
<attribute name="value" required="true"/>
<conversion class="test.config.Datum"/>
</element>
</schema>
</configuration-point>
Shing
--
Martin Pike
***@yntegral.com
Tel: 0117 925 0862
Yntegral Ltd - Linking people and information
Martin Pike
2006-02-09 11:45:07 UTC
Permalink
Please ignore the last messsage on this thread. In looking at the
documentation again I see that if an id is specified in the
<configuration-point> element it is illegal
to have an id in the <schema> element also. Therefore Shing's suggestion
will be invalid, I think.

Martin Pike wrote:

Shing,

Thankyou for your suggestion , however it would appear that adding id to
schema is illegal as I receive the message:

SEVERE: Error at file:...../testConfig/bin/META-INF/hivemodule.xml, line
5, column 28: Unknown attribute 'id' in element
module/configuration-point/schema.

However on checking the documentation at
'HiveMind1.1/docs/descriptor.html#configuration-point' it states that id
is required. This would seem to go against the examples that are shown
in the documentation of the use of <schema> which do not have an id
attribute.

What is correct? Is id valid/required as an id of schema or not?
Post by Shing Hing Man
Post by Martin Pike
<configuration-point id="Address2"
schema-id="Address" />
In the above, I do not think you have specified a
schema with id=Address.
In the following, try replacing
<schema> with <schema id="Address">
Post by Martin Pike
<configuration-point id="Address">
<schema>
<element name="datum">
<attribute name="key" required="true"/>
<attribute name="value" required="true"/>
<conversion class="test.config.Datum"/>
</element>
</schema>
</configuration-point>
Shing
Achim Huegen
2006-02-09 12:30:23 UTC
Permalink
You can't reuse a schema that is defined inside
an configuration-point. Define it standalone and
it will accept the id attribute:

<schema id="AddressSchema">
<element name="datum">
<attribute name="key" required="true"/>
<attribute name="value" required="true"/>
<conversion class="test.config.Datum"/>
</element>
</schema>

<configuration-point id="Address" schema-id="AddressSchema" />
<configuration-point id="Address2" schema-id="AddressSchema" />

More info here:
http://jakarta.apache.org/hivemind/configurations.html

Achim
Post by Martin Pike
I am attempting to initialise an instance of a class with one of two
sets of data, specified in a hivemodule.xml file, defined as
contributions attached to configuration points.
The code shows instantiating of the object. If the service point called
is 'testConfig.address' the code runs ok, but if I call the service
point 'testConfig.address2' which references the second contribution it
Error at file:...../META-INF/hivemodule.xml, line 41, column 72: Unable
java.lang.reflect.InvocationTargetException
org.apache.hivemind.ApplicationRuntimeException: Unable to update
java.lang.reflect.InvocationTargetException
I am new to HiveMind and would appreciate any pointers as to what I'm
doing wrong.
--Code
public static void main(String[] args) {
Registry registry = RegistryBuilder.constructDefaultRegistry();
Address address =
(Address)registry.getService("testConfig.address2", Address.class);
System.out.print(address.getAddress());
}
-- hivemodule.xml
<?xml version="1.0"?>
<module id="testConfig" version="1.0.0" package = "test.config">
<configuration-point id="Address">
<schema>
<element name="datum">
<attribute name="key" required="true"/>
<attribute name="value" required="true"/>
<conversion class="test.config.Datum"/>
</element>
</schema>
</configuration-point>
<configuration-point id="Address2" schema-id="Address" />
<contribution configuration-id="Address">
<datum key="road" value="Temple Quay"/>
<datum key="town" value="Bristol"/>
<datum key="postcode" value="BS1"/>
<datum key="country" value="UK"/>
</contribution>
<contribution configuration-id="Address2" >
<datum key="road" value="Pall Mall"/>
<datum key="town" value="London"/>
<datum key="postcode" value="SW1"/>
<datum key="country" value="UK"/>
</contribution>
<service-point id="address" interface="test.config.Address">
<invoke-factory>
<construct class="test.config.AddressImpl">
<set-configuration property="data" configuration-id="Address"/>
</construct>
</invoke-factory>
</service-point>
<service-point id="address2" interface="test.config.Address">
<invoke-factory>
<construct class="test.config.AddressImpl">
<set-configuration property="data" configuration-id="Address2"/>
</construct>
</invoke-factory>
</service-point>
</module>
Regards
Martin Pike
Martin Pike
2006-02-09 13:29:56 UTC
Permalink
Thankyou Achim,

This is the solution to my problem.

martin
Post by Achim Huegen
You can't reuse a schema that is defined inside
an configuration-point. Define it standalone and
<schema id="AddressSchema">
<element name="datum">
<attribute name="key" required="true"/>
<attribute name="value" required="true"/>
<conversion class="test.config.Datum"/>
</element>
</schema>
<configuration-point id="Address" schema-id="AddressSchema" />
<configuration-point id="Address2" schema-id="AddressSchema" />
http://jakarta.apache.org/hivemind/configurations.html
Achim
Aleksej
2006-02-09 07:28:35 UTC
Permalink
I use this peace of code to build registry:
-----------
Registry registry= null;
try{
RegistryBuilder registryBuilder= new RegistryBuilder();
ClassLoader classLoader=
Thread.currentThread().getContextClassLoader();
ClassResolver classResolver= new DefaultClassResolver(
classLoader );
ModuleDescriptorProvider moduleDescriptorProvider= new
XmlModuleDescriptorProvider( classResolver, "hivemodule.xml" ); //
perhaps the place which should solve your problem
registryBuilder.addModuleDescriptorProvider(
moduleDescriptorProvider );
registryBuilder.addDefaultModuleDescriptorProvider();
Locale locale= Locale.getDefault();
registry= registryBuilder.constructRegistry( locale );

log.debug( "registry builded" );
executeWithRegistry( registry ); // abstract method where
all my logic goes

}catch( Exception ex ){
log.error( ex );
return;
}finally{
if( registry != null ){
log.debug( "going to shutdown registry" );
try{
registry.cleanupThread();
registry.shutdown();

}catch( Exception ex ){
log.error( "failed to shutdown registry", ex );
}
}
}
Loading...