You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Grant McDonald <gm...@infocomp.com> on 2006/06/27 15:35:05 UTC

NPE running ComponentAssemblyInstallationTest in servicemix-core

When compiling servicemix-core in the latest trunk
ComponentAssemblyInstallationTest.testComponentInstallation() fails with an
NPE being thrown. This test case tests the installation of two jbi
installers: logger-component-1.0-jbi-installer.zip and
quartz-component-1.0-jbi-installer.zip.  During running of this test case a
null pointer exception is thrown due to the fact that the descriptor
(jbi.xml) doesn't have a bootstrap-class-path element defined.

The question here is should the test component installer jbi.xml files have
the bootstrap-class-path element added as an empty element
(<bootstrap-class-path/>) ?

If this is not favourable one of two things can be done:

1) Add a default value in the Component class
(org.apache.servicemix.jbi.deployment) for both the bootstrap and component
class paths.  That is, private ClassPath bootstrapClassPath; becomes:
private ClassPath bootstrapClassPath = new ClassPath(); in Component.java. 
I'm not sure if there are any related caveats surrounding the use of this
kind of default in an XBean mapping class.  Anyone who knows please chip in
an answer.

2) Put an NPE check in InstallerMBeanImpl.createBootstrap() before the call
to buildClassLoader which passes in the bootstrap classpath (line 82)

It is worth discussing the best approach with respect to real world
deployment of jbi installer zips and implementation of either above option
is quite trivial.  Let me know if you want an issue raised and a patch
submitted for a particular approach.

-- 
View this message in context: http://www.nabble.com/NPE-running-ComponentAssemblyInstallationTest-in-servicemix-core-tf1855321.html#a5066006
Sent from the ServiceMix - Dev forum at Nabble.com.


Re: NPE running ComponentAssemblyInstallationTest in servicemix-core

Posted by Grant McDonald <gm...@infocomp.com>.

No worries, the example installers will need to be modified in that case
otherwise they will fail.  Btw, what is the current state of the tests in
SM?


gnodet wrote:
> 
> Currently, there is no validity check performed after loading the jbi
> descriptor.
> ServiceMix should ensure that all mandatory fields are filled and throw a
> meaningful
> exception when this is not the case.
> Could you raise a JIRA issue for that ?
> 
> Cheers,
> Guillaume Nodet
> 
> On 6/27/06, Terry Cox <te...@meta-concepts.com> wrote:
>>
>> > The question here is should the test component installer jbi.xml
>> > files have the bootstrap-class-path element added as an empty
>> > element (<bootstrap-class-path/>) ?
>>
>>
>> The specification is not that helpful here:
>>
>> "The JBI implementation MUST create an InstallationContext object,
>> initialized to provide the following data:
>> •Installation root, as a String containing the root's full directory
>>   path name.
>> •Bootstrap class name, as given in the installation descriptor.
>> •Bootstrap class path, as given in the installation descriptor." <snip>
>>
>> Nothing is said about default paths, however, from the JBI schema,
>> bootstrap class path is not shown as optional, so should be provided for
>> the file to be valid.
>>
>> "component =
>> element component {
>> attribute type { "service-engine" | "binding-component" },
>> attribute component-class-loader-delegation { "parent-first" |
>> "self-first" }?,
>> attribute bootstrap-class-loader-delegation { "parent-first" |
>> "self-first" }?,
>> identification,
>> element component-class-name { attribute description { text }?, text },
>> element component-class path { class path },
>> element bootstrap-class-name { text },
>> element bootstrap-class path { class path },
>> shared-library-list*,
>> element* -this:* { text }*
>> }"
>>
>> Terry
>>
> 
> 
-- 
View this message in context: http://www.nabble.com/NPE-running-ComponentAssemblyInstallationTest-in-servicemix-core-tf1855321.html#a5070115
Sent from the ServiceMix - Dev forum at Nabble.com.


Re: NPE running ComponentAssemblyInstallationTest in servicemix-core

Posted by Guillaume Nodet <gn...@gmail.com>.
Currently, there is no validity check performed after loading the jbi
descriptor.
ServiceMix should ensure that all mandatory fields are filled and throw a
meaningful
exception when this is not the case.
Could you raise a JIRA issue for that ?

Cheers,
Guillaume Nodet

On 6/27/06, Terry Cox <te...@meta-concepts.com> wrote:
>
> > The question here is should the test component installer jbi.xml
> > files have the bootstrap-class-path element added as an empty
> > element (<bootstrap-class-path/>) ?
>
>
> The specification is not that helpful here:
>
> "The JBI implementation MUST create an InstallationContext object,
> initialized to provide the following data:
> •Installation root, as a String containing the root's full directory
>   path name.
> •Bootstrap class name, as given in the installation descriptor.
> •Bootstrap class path, as given in the installation descriptor." <snip>
>
> Nothing is said about default paths, however, from the JBI schema,
> bootstrap class path is not shown as optional, so should be provided for
> the file to be valid.
>
> "component =
> element component {
> attribute type { "service-engine" | "binding-component" },
> attribute component-class-loader-delegation { "parent-first" |
> "self-first" }?,
> attribute bootstrap-class-loader-delegation { "parent-first" |
> "self-first" }?,
> identification,
> element component-class-name { attribute description { text }?, text },
> element component-class path { class path },
> element bootstrap-class-name { text },
> element bootstrap-class path { class path },
> shared-library-list*,
> element* -this:* { text }*
> }"
>
> Terry
>

Re: NPE running ComponentAssemblyInstallationTest in servicemix-core

Posted by Terry Cox <te...@meta-concepts.com>.
> The question here is should the test component installer jbi.xml 
> files have the bootstrap-class-path element added as an empty
 > element (<bootstrap-class-path/>) ?


The specification is not that helpful here:

"The JBI implementation MUST create an InstallationContext object, 
initialized to provide the following data:
•Installation root, as a String containing the root’s full directory
  path name.
•Bootstrap class name, as given in the installation descriptor.
•Bootstrap class path, as given in the installation descriptor." <snip>

Nothing is said about default paths, however, from the JBI schema, 
bootstrap class path is not shown as optional, so should be provided for 
the file to be valid.

"component =
element component {
attribute type { "service-engine" | "binding-component" },
attribute component-class-loader-delegation { "parent-first" | 
"self-first" }?,
attribute bootstrap-class-loader-delegation { "parent-first" | 
"self-first" }?,
identification,
element component-class-name { attribute description { text }?, text },
element component-class path { class path },
element bootstrap-class-name { text },
element bootstrap-class path { class path },
shared-library-list*,
element* -this:* { text }*
}"

Terry