---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Why do you think this is an OSGi issue?
It sounds like the namespaces may not be properly set but I cannot tell
unless you post some configuration here.
A
Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email: antoin...@ricston.com | blog: blog.ricston.com | web: ricston.com
I'll give you an idea what I'm seeing.
So I'm trying to startup in a bundle Activator like this
DefaultMuleContextFactory muleContextFactory = new
DefaultMuleContextFactory();
SpringXmlConfigurationBuilder configBuilder = new
SpringXmlConfigurationBuilder(configResourceArray);
muleContext = muleContextFactory.createMuleContext(configBuilder);
muleContext.start();
configResourceArray is an array of ConfigResource.
So when I do this I get...
java.io.FileNotFoundException: default-mule-config.xml
Bummer. So I saw I could call
configBuilder.setUseDefaultConfigResource(false);
which gave me
org.mule.api.MuleRuntimeException: The required object/property
"securityManager" is null
So ok, I'm thinking I need the default mule file. So I have my bundle go
find it and put it at the front of the configuration file list. I don't put
any other config files in this list at this point and I get
org.mule.api.config.ConfigurationException: Initialisation Failure:
Configuration problem: Unable to locate NamespaceHandler for namespace
[http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [bundleresource://90/default-mule-config.xml]
(org.mule.api.lifecycle.InitialisationException)
So that's why I came here. I'm not quite sure what I should be doing to
startup within an OSGi bundle where I'm using OSGi and Spring-DM.
Does that help shed more light?
--
View this message in context: http://www.nabble.com/Mule-and-OSGi-tp21708300p21802264.html
If it cannot find the mule configuration file then either the filename is
incorrect, or the file is not in the current directory.
What I find to be curious is that you immediately assume that you should use
"the default mule file" What are you talking about here? There is no such
thing as a default Mule configuration file since this is something that you
should provide; this MUST be the name of your configuration file. If, on
the other hand, your configuration file is named "mule-config.xml", then
Mule will find it on its own as this is the default file name to expect.
HTH
default-mule-config.xml is in mule-module-spring-config-2.1.2.jar.
SpringXmlConfigurationBuilder sure seems to be trying to read it. Line 32 of
SpringXmlConfigurationBuilder defines it as:
public static final String MULE_DEFAULTS_CONFIG = "default-mule-config.xml";
and line 62 in the doConfigure method prepends this file to the front of the
resources to be loaded array.
Needless to say I'm a little confused. This is why I thought it might be
something with OSGi changing how this works in the base case.
--
View this message in context: http://www.nabble.com/Mule-and-OSGi-tp21708300p21810349.html
It appears that osgi framework replaced the parent classloader and/or url stream handler factory. I cannot explain it otherwise, the bundleresource:// qualifier clearly is the culprit here. Still, resources should be just discoverable via standard Java classloading means. Please provide as much detail as possible.
Andrew
On Feb 3, 2009 8:55 AM, "paquettd" <dan.pa...@lmco.com> wrote:
I realize that I need to use my own mule configuration file. What I'm trying
to say is that the system doesn't even get to the point of trying to load my
configuration file.
default-mule-config.xml is in mule-module-spring-config-2.1.2.jar.
SpringXmlConfigurationBuilder sure seems to be trying to read it. Line 32 of
SpringXmlConfigurationBuilder defines it as:
public static final String MULE_DEFAULTS_CONFIG = "default-mule-config.xml";
and line 62 in the doConfigure method prepends this file to the front of the
resources to be loaded array.
Needless to say I'm a little confused. This is why I thought it might be
something with OSGi changing how this works in the base case.
antoine.borg wrote: > > Hi, > > If it cannot find the mule configuration file then either the fi...
--
View this message in context: http://www.nabble.com/Mule-and-OSGi-tp21708300p21810349.html
Sent from the Mule - User mailing list archive at Nabble.com. ------------------------------------...
I started stepping into the SpringXmlConfigurationBuilder and have a
question about createSpringRegistry.
It checks for a parentContext before creating the registry and initializing
it. I did not supply a parent context so it goes to the base case. Is this
something i should have provided?
--
View this message in context: http://www.nabble.com/Mule-and-OSGi-tp21708300p21811413.html
Sent from the Mule - User mailing list archive at Nabble.com.
I did the stream read in the same bundle Activator that is doing the
startup.
The full stack trace follows.
To me it seems like Spring cannot figure out how to parse the file. I'm
running in Eclipse. My OSGi TargetPlatform is set to all the bundles that
came with Mule 2.1.2 (so all the org.springframework bundles are in there).
I know Spring-DM scans bundle generally looks for spring.handlers and
spring.schemas to define how to parse this stuff. How do these get set when
starting Mule?
Thanks.
Start Level Event Dispatcher] INFO
org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML
bean definitions from URL [bundleresource://61/default-mule-config.xml]
[Start Level Event Dispatcher] DEBUG
org.springframework.beans.factory.xml.DefaultDocumentLoader - Using JAXP
provider
[com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
[Start Level Event Dispatcher] DEBUG
org.springframework.beans.factory.xml.PluggableSchemaResolver - Loading
schema mappings from [META-INF/spring.schemas]
[Start Level Event Dispatcher] DEBUG
org.springframework.beans.factory.xml.PluggableSchemaResolver - Loaded
schema mappings: {}
[Start Level Event Dispatcher] ERROR
org.mule.config.spring.SpringXmlConfigurationBuilder - Configuration with
"org.mule.config.spring.SpringXmlConfigurationBuilder" failed.
org.mule.api.lifecycle.InitialisationException: Initialisation Failure: Line
8 in XML document from URL [bundleresource://61/default-mule-config.xml] is
invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1:
Cannot find the declaration of element 'beans'.
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:79)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
at
org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at com.lmco.psb.mule.Activator.start(Activator.java:67)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:355)
at
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1074)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:616)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:299)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:489)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:211)
at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:321)
Caused by:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
8 in XML document from URL [bundleresource://61/default-mule-config.xml] is
invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1:
Cannot find the declaration of element 'beans'.
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at
org.mule.config.spring.MuleApplicationContext.loadBeanDefinitions(MuleApplicationContext.java:104)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:71)
... 20 more
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
declaration of element 'beans'.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1944)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250)
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
... 29 more
[Start Level Event Dispatcher] ERROR com.lmco.psb.mule.Activator - Exception
caught starting Mule
org.mule.api.config.ConfigurationException: Initialisation Failure: Line 8
in XML document from URL [bundleresource://61/default-mule-config.xml] is
invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1:
Cannot find the declaration of element 'beans'.
(org.mule.api.lifecycle.InitialisationException)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at
org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at com.lmco.psb.mule.Activator.start(Activator.java:67)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:355)
at
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1074)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:616)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:299)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:489)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:211)
at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:321)
Caused by: org.mule.api.lifecycle.InitialisationException: Initialisation
Failure: Line 8 in XML document from URL
[bundleresource://61/default-mule-config.xml] is invalid; nested exception
is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of
element 'beans'.
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:79)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
... 17 more
Caused by:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
8 in XML document from URL [bundleresource://61/default-mule-config.xml] is
invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1:
Cannot find the declaration of element 'beans'.
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at
org.mule.config.spring.MuleApplicationContext.loadBeanDefinitions(MuleApplicationContext.java:104)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:71)
... 20 more
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
declaration of element 'beans'.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1944)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250)
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
... 29 more
--
View this message in context: http://www.nabble.com/Mule-and-OSGi-tp21708300p21811955.html
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema
document 'http://www.springframework.org/schema/beans/spring-beans-2.5.xsd',
because 1) could not find the document; 2) the document could not be read;
3) the root element of the document is not <xsd:schema>.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.warning(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.XMLErrorReporter.reportError(Unknown Source)
at
org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown
Source)
at
org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown
Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown
Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown
Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
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
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at
org.mule.config.spring.MuleApplicationContext.loadBeanDefinitions(MuleApplicationContext.java:104)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:71)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
at
org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
--
View this message in context: http://www.nabble.com/Mule-and-OSGi-tp21708300p21812591.html
Usually when we use Spring-DM that takes care of things.. but I bet since
I'm launching in a "mule-first" instead of "spring-first" situation the
namespace resolver isn't setup right.
I'll try some things and post if I can solve it.
--
View this message in context: http://www.nabble.com/Mule-and-OSGi-tp21708300p21815117.html