This may a problem with validation.
You may try with the old version of spring http://dist.codehaus.org/servicemix/jars/spring-1.2.2-dev-2.jar or you may try to modify the code of org.servicemix.client.DescriptorFactory#getDescriptor with this one

   public static Descriptor getDescriptor(String installRoot) {
       Descriptor root = null;
       File descriptor = new File(installRoot + META_INF, DESCRIPTOR_FILE);
log.debug("Checking for descriptor " + descriptor.getAbsolutePath());
       if (descriptor.exists()) {
           try {
Thread.currentThread().setContextClassLoader(Descriptor.class.getClassLoader()); FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext("file:///"
                       + descriptor.getAbsolutePath(),
Arrays.asList(new Object[] { new XBeanProcessor()}));
               root = (Descriptor) context.getBean("jbi");
               log.debug("Parsed descriptor " + root);
           } catch (Throwable e) {
throw new RuntimeException("Unable to parse the jbi.xml", e);
           }
       } else {
throw new RuntimeException("Descriptor file: " + descriptor + " doesn't exist");
       }
       return root;
   }

Make sure you use the org.xbean.spring.context.FileSystemXmlApplicationContext and not the spring one.
This should work.

Cheers,
Guillaume Nodet

Mark wrote:

Hi,

I am trying to build JBI components following the Spring Client Toolkit
tutorial on the ServiceMix web site. When I drop the component installer
zip files into the installer directory, getting serveral errors on the
console (on Windows).

Is this tutorial still valid for ServiceMix 2.0 release? Thanks for your
help.

Here is the error log.

[WARN] AutoDeploymentService - Directory: install: Automatic install of
..\insta
ll\myFirstComponent-1.0-jbi-installer.zip failed
<java.lang.RuntimeException: Un
able to parse the jbi.xml>java.lang.RuntimeException: Unable to parse the
jbi.xm
l
       at
org.servicemix.client.DescriptorFactory.getDescriptor(DescriptorFacto
ry.java:61)
       at
org.servicemix.client.ClientEndPointRegistry.loadServiceUnitServices(
ClientEndPointRegistry.java:314)
       at
org.servicemix.client.ClientEndPointRegistry.loadComponentServices(Cl
ientEndPointRegistry.java:298)
       at
org.servicemix.client.SpringComponentLifeCycle.init(SpringComponentLi
feCycle.java:130)
       at
org.servicemix.jbi.container.JBIContainer.activateComponent(JBIContai
ner.java:887)
       at
org.servicemix.jbi.container.JBIContainer.activateComponent(JBIContai
ner.java:838)
       at
org.servicemix.jbi.framework.InstallerMBeanImpl.install(InstallerMBea
nImpl.java:131)
       at
org.servicemix.jbi.framework.InstallationService.install(Installation
Service.java:263)
       at
org.servicemix.jbi.framework.AutoDeploymentService.updateArchive(Auto
DeploymentService.java:184)
       at
org.servicemix.jbi.framework.AutoDeploymentService$2.run(AutoDeployme
ntService.java:512)
       at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.ja
va:291)
       at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
So
urce)
       at java.lang.Thread.run(Thread.java:595)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
Line
3 in XML document from URL
[file:/C:/servicemix-2.0/bin/../wdir/defaultJBI/compo
nents/myFirstComponent/installation/META-INF/jbi.xml] is invalid; nested
excepti
on is org.xml.sax.SAXParseException: Document root element "jbi", must
match DOC
TYPE root "null".
       at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:169)
       at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125)
       at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141)
       at
org.springframework.context.support.AbstractXmlApplicationContext.loa
dBeanDefinitions(AbstractXmlApplicationContext.java:113)
       at
org.springframework.context.support.AbstractXmlApplicationContext.loa
dBeanDefinitions(AbstractXmlApplicationContext.java:81)
       at
org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
       at
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:268)
       at
org.springframework.context.support.FileSystemXmlApplicationContext.<
init>(FileSystemXmlApplicationContext.java:83)
       at
org.springframework.context.support.FileSystemXmlApplicationContext.<
init>(FileSystemXmlApplicationContext.java:68)
       at
org.springframework.context.support.FileSystemXmlApplicationContext.<
init>(FileSystemXmlApplicationContext.java:59)
       at
org.servicemix.client.DescriptorFactory.getDescriptor(DescriptorFacto
ry.java:56)
       ... 12 more
Caused by: org.xml.sax.SAXParseException: Document root element "jbi",
must matc
h DOCTYPE root "null".
       at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
       at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
       at
org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unkno
wn Source)
       at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown
Source)
       at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
Sourc
e)
       at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElemen
t(Unknown Source)
       at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanR
ootElementHook(Unknown Source)
       at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
       at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
       at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
       at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:161)
       ... 22 more




Thanks,

Mark

Technical Services
Sirvisetti Systems
347 Plainfield Avenue
Edison NJ 08817
Tel:(866) 985-2200 Ext 1106
Fax:(732) 985-4448
http://www.sirvisetti.com
http://autostream.sirvisetti.com


----------------------------------------------------------------------
This email has been sent by Sirvisetti Systems. If you believe this email
has reached you in error or if you no longer wish to receive email updates
from Sirvisetti Systems, reply to this email with Remove in the Subject
line. We regret for the inconvenience caused.







Reply via email to