You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by David Kaspar Dump <dk...@gmail.com> on 2006/06/01 11:35:41 UTC

http-component and dynamic xsltResource

Hello ServiceMix list, thank you for a great product.

Our scenario is to receive messages via HTTP(S), validate, translate
and route to a destination.

The routing and translation is determined by GET parameters and the
configuration is to be stored in a data base.

My idea was to develop  a BC that interacts with the data base and
based on the GET parameters determines what translation should be done
and what the destination is.

http-component -  BC1 (trasnformation lookup) - XSLT component - BC2
(router) - HTTP or SMTP or FTP

For this to work I was wondering a few questions.

1. Is it possible dynamically to change the xsltResource for the XSLT
component (ie to override what was specified in servicemix.xml)

2. The way to change the endpont dynamically seems to be to use

ServiceEndpoint se = context.resolveEndpointReference(epr);
exchange.setEndpoint(se);


but what exactly is the "epr fragment"? I would like to resolve an
endpoint specified in the servicemix.xml

Please suggest if I am completly on the wrong track, maybe I should be
using the newer servicemix-eip instead?


thank you,
dk

Re: http-component and dynamic xsltResource

Posted by dkd <dk...@gmail.com>.
After getting familiar with the servicemix-eip patterns, the RoutingSlip
seems to be a candidate for my requirement.

Is it possible to construct a custom RoutingSlip for each message that comes
in and set it as an intial ServiceEndpoint?

thank you,
dkd


-- 
View this message in context: http://www.nabble.com/http-component-and-dynamic-xsltResource-tf1715775.html#a5221227
Sent from the ServiceMix - User forum at Nabble.com.


Re: http-component and dynamic xsltResource

Posted by David Kaspar Dump <dk...@gmail.com>.
I would like to revisit this issue and find a way to read routing
configuration from a data base for each message that comes in.

The servicemix xml file would still be used to define the available
components but a routing (sequence of components to traverse) would be
loaded by a BC each time a message comes in.

The idea was that such a routing configuration would be attached to
the in message in a first BC.

Is there any existing component that can serves this purpose, that is
to read a (custom) routing configuration form the in message directly
and forward to correct service after each step?

Thank you,

On 6/1/06, Guillaume Nodet <gn...@gmail.com> wrote:
> All your routing needs can be fullfilled by the EIP component,
> using the ContentBasedRouter and Pipeline (i guess you are using an InOnly
> MEP).
>
> The HTTP will send an InOnly exchange to a Pipeline.
> The Pipeline will send an InOut exchange to a first ContentBasedRouter.
> The ContentBasedRouter will route  the exchange to the needed XSLT
> stylesheet and send back the answer to the Pipeline.
> The Pipeline will forward the transformed exchange to a second
> ContentBasedRouter which will route it to the final destination (HTTP, SMTP
> ...)
>
> If the XSLT should be associated with the final destination, you can use a
> single ContentBasedRouter and put the several Pipelines between it and the
> final destination, each Pipeline invoking an XSLT component.
>
> Not sure if I'm very clear, and mail is not a very good way to express
> schema :(
>
> In short, use EIP and one XSLT per endpoint.
>
> Cheers,
> Guillaume Nodet
>
>
>
> On 6/1/06, David Kaspar Dump <dk...@gmail.com> wrote:
> >
> > Hello ServiceMix list, thank you for a great product.
> >
> > Our scenario is to receive messages via HTTP(S), validate, translate
> > and route to a destination.
> >
> > The routing and translation is determined by GET parameters and the
> > configuration is to be stored in a data base.
> >
> > My idea was to develop  a BC that interacts with the data base and
> > based on the GET parameters determines what translation should be done
> > and what the destination is.
> >
> > http-component -  BC1 (trasnformation lookup) - XSLT component - BC2
> > (router) - HTTP or SMTP or FTP
> >
> > For this to work I was wondering a few questions.
> >
> > 1. Is it possible dynamically to change the xsltResource for the XSLT
> > component (ie to override what was specified in servicemix.xml)
> >
> > 2. The way to change the endpont dynamically seems to be to use
> >
> > ServiceEndpoint se = context.resolveEndpointReference(epr);
> > exchange.setEndpoint(se);
> >
> >
> > but what exactly is the "epr fragment"? I would like to resolve an
> > endpoint specified in the servicemix.xml
> >
> > Please suggest if I am completly on the wrong track, maybe I should be
> > using the newer servicemix-eip instead?
> >
> >
> > thank you,
> > dk
> >
>
>

RE: http-component and dynamic xsltResource

Posted by Soumadeep <so...@infravio.com>.
I believe that's the issues. The spring framework is looking for jars in the
classpath tag in the service.xml and throwing an error because it's not been
loaded yet.

I will file a jira.  For the time being let me put the dependent jars in
SM/lib and see if it works.

Thanks
Soumadeep

-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com]
Sent: Thursday, June 01, 2006 4:25 PM
To: servicemix-users@geronimo.apache.org
Subject: Re: http-component and dynamic xsltResource

If I recall, this kind of NPE happens when you use the <classpath/> tag
inside an xbean file, but the library is not found.  You should raise a JIRA
on http://issues.apache.org/jira/browse/XBEAN: the problem should be
detected earlier and throws a meaningfull exception.

Cheers,
Guillaume Nodet

On 6/1/06, Soumadeep <so...@infravio.com> wrote:
>
> Guillaume,
>
> The new snapshot 3.0 doesn't have many of the optional jars that were
> there
> in the earlier builds, which our application used in order to run.
> We have accordingly changed the code base to accommodate the change in the
> new lib files structure, our code base compiles but we get the following
> error when we try to run it.
>
> Any changes in the way SA and the SU are defined or the jbi.xml??
>
> Thanks
> Soumadeep
>
> Apache ServiceMix ESB: 3.0-SNAPSHOT
>
> Loading Apache ServiceMix from file: servicemix.xml
> Caught: java.lang.NullPointerException
> java.lang.NullPointerException
>         at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
>         at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
>         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
>         at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
>         at java.lang.ClassLoader.getResource(ClassLoader.java:977)
>         at
> org.apache.xbean.server.classloader.MultiParentClassLoader.getResourc
> e(MultiParentClassLoader.java:156)
>         at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java
> :1159)
>         at org.apache.commons.logging.LogFactory$3.run(LogFactory.java
> :627)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.apache.commons.logging.LogFactory.getResourceAsStream(LogFactory.
> java:623)
>         at
> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:281)
>
>         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java
> :395)
>         at
> org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.
> <init>(DefaultXmlBeanDefinitionParser.java:155)
>         at
> org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.<in
> it>(XBeanXmlBeanDefinitionParser.java:66)
>         at
> org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionReader.reg
> isterBeanDefinitions(XBeanXmlBeanDefinitionReader.java:77)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
> eanDefinitions(XmlBeanDefinitionReader.java:223)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
> nDefinitions(XmlBeanDefinitionReader.java:173)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
> nDefinitions(XmlBeanDefinitionReader.java:148)
>         at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReade
> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
>         at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReade
> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
>         at
> org.springframework.context.support.AbstractXmlApplicationContext.loa
> dBeanDefinitions(AbstractXmlApplicationContext.java:113)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadB
> eanDefinitions(FileSystemXmlApplicationContext.java:161)
>         at
> org.springframework.context.support.AbstractRefreshableApplicationCon
> text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
>         at
> org.springframework.context.support.AbstractApplicationContext.refres
> h(AbstractApplicationContext.java:269)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >(FileSystemXmlApplicationContext.java:149)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >(FileSystemXmlApplicationContext.java:100)
>         at org.apache.servicemix.Main.main(Main.java:80)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
>
>
>



Re: http-component and dynamic xsltResource

Posted by Guillaume Nodet <gn...@gmail.com>.
If I recall, this kind of NPE happens when you use the <classpath/> tag
inside an xbean file, but the library is not found.  You should raise a JIRA
on http://issues.apache.org/jira/browse/XBEAN: the problem should be
detected earlier and throws a meaningfull exception.

Cheers,
Guillaume Nodet

On 6/1/06, Soumadeep <so...@infravio.com> wrote:
>
> Guillaume,
>
> The new snapshot 3.0 doesn't have many of the optional jars that were
> there
> in the earlier builds, which our application used in order to run.
> We have accordingly changed the code base to accommodate the change in the
> new lib files structure, our code base compiles but we get the following
> error when we try to run it.
>
> Any changes in the way SA and the SU are defined or the jbi.xml??
>
> Thanks
> Soumadeep
>
> Apache ServiceMix ESB: 3.0-SNAPSHOT
>
> Loading Apache ServiceMix from file: servicemix.xml
> Caught: java.lang.NullPointerException
> java.lang.NullPointerException
>         at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
>         at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
>         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
>         at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
>         at java.lang.ClassLoader.getResource(ClassLoader.java:977)
>         at
> org.apache.xbean.server.classloader.MultiParentClassLoader.getResourc
> e(MultiParentClassLoader.java:156)
>         at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java
> :1159)
>         at org.apache.commons.logging.LogFactory$3.run(LogFactory.java
> :627)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.apache.commons.logging.LogFactory.getResourceAsStream(LogFactory.
> java:623)
>         at
> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:281)
>
>         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java
> :395)
>         at
> org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.
> <init>(DefaultXmlBeanDefinitionParser.java:155)
>         at
> org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.<in
> it>(XBeanXmlBeanDefinitionParser.java:66)
>         at
> org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionReader.reg
> isterBeanDefinitions(XBeanXmlBeanDefinitionReader.java:77)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
> eanDefinitions(XmlBeanDefinitionReader.java:223)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
> nDefinitions(XmlBeanDefinitionReader.java:173)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
> nDefinitions(XmlBeanDefinitionReader.java:148)
>         at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReade
> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
>         at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReade
> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
>         at
> org.springframework.context.support.AbstractXmlApplicationContext.loa
> dBeanDefinitions(AbstractXmlApplicationContext.java:113)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadB
> eanDefinitions(FileSystemXmlApplicationContext.java:161)
>         at
> org.springframework.context.support.AbstractRefreshableApplicationCon
> text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
>         at
> org.springframework.context.support.AbstractApplicationContext.refres
> h(AbstractApplicationContext.java:269)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >(FileSystemXmlApplicationContext.java:149)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >(FileSystemXmlApplicationContext.java:100)
>         at org.apache.servicemix.Main.main(Main.java:80)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
>
>
>

RE: Optional Libraries Missing

Posted by Soumadeep <so...@infravio.com>.
I completely agree with you about the way the libs are being distributed and
it's very right.
In fact our code base has all the required libs embedded in our service
unit/zipped. Still we are getting the error as described at the end of this
email.

Any thoughts, do you think this is a class loading issue?

Soumadeep

-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com]
Sent: Thursday, June 01, 2006 4:23 PM
To: servicemix-users@geronimo.apache.org
Subject: Re: Optional Libraries Missing

I am aware of that.
It was a bit on purpose for the following reasons:
  * some of the jars that were distributed can not be because their license
prohibits that
  * classloaders / jar conflicts problems

Let me further explain the second point.
The JBI spec defines components that come with their own set of libraries,
but components classloaders inherit all the libraries from the container
classloader.  To avoid clashes, the container should have a minimum set of
libraries (which is obviously not really the case).  A first step is to
remove all unneeded libraries from the container classloader (this also have
the benefit that the distribution is lighter).  There are still possible
conflicts with the jars that are needed by the container (xalan, xerces,
etc...).

If you use servicemix in embedded mode (static servicemix.xml configuration
file), you should build your own distribution and include the necessary
jars.  If you use the lightweight container, the needed jars for the
component you use should be embeded in your service units.

Another thing i have thought about is to create two distributions, one with
std JBI components (the way the current distribution is, but without the
remaining optional libraries) and another one for embedding servicemix (all
needed jars like those for std JBI components available, removing the
deploy/install dirs) .  Examples could also be splitted across the two
distributions.
This has however one drawback: new users may have difficulties to choose
between both distributions and even if the first one is better in production
(ability to deploy/undeploy things at runtime), the second one is easier for
development / tests.

Any ideas welcome.
Guillaume Nodet

On 6/1/06, Soumadeep <so...@infravio.com> wrote:
>
> Changed the subject :)
>
> Soumadeep
>
> -----Original Message-----
> From: Soumadeep [mailto:soumadeep@infravio.com]
> Sent: Thursday, June 01, 2006 4:03 PM
> To: servicemix-users@geronimo.apache.org
> Subject: RE: http-component and dynamic xsltResource
>
> Guillaume,
>
> The new snapshot 3.0 doesn't have many of the optional jars that were
> there
> in the earlier builds, which our application used in order to run.
> We have accordingly changed the code base to accommodate the change in the
> new lib files structure, our code base compiles but we get the following
> error when we try to run it.
>
> Any changes in the way SA and the SU are defined or the jbi.xml??
>
> Thanks
> Soumadeep
>
> Apache ServiceMix ESB: 3.0-SNAPSHOT
>
> Loading Apache ServiceMix from file: servicemix.xml
> Caught: java.lang.NullPointerException
> java.lang.NullPointerException
>         at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
>         at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
>         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
>         at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
>         at java.lang.ClassLoader.getResource(ClassLoader.java:977)
>         at
> org.apache.xbean.server.classloader.MultiParentClassLoader.getResourc
> e(MultiParentClassLoader.java:156)
>         at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java
> :1159)
>         at org.apache.commons.logging.LogFactory$3.run(LogFactory.java
> :627)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.apache.commons.logging.LogFactory.getResourceAsStream(LogFactory.
> java:623)
>         at
> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:281)
>
>         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java
> :395)
>         at
> org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.
> <init>(DefaultXmlBeanDefinitionParser.java:155)
>         at
> org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.<in
> it>(XBeanXmlBeanDefinitionParser.java:66)
>         at
> org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionReader.reg
> isterBeanDefinitions(XBeanXmlBeanDefinitionReader.java:77)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
> eanDefinitions(XmlBeanDefinitionReader.java:223)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
> nDefinitions(XmlBeanDefinitionReader.java:173)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
> nDefinitions(XmlBeanDefinitionReader.java:148)
>         at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReade
> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
>         at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReade
> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
>         at
> org.springframework.context.support.AbstractXmlApplicationContext.loa
> dBeanDefinitions(AbstractXmlApplicationContext.java:113)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadB
> eanDefinitions(FileSystemXmlApplicationContext.java:161)
>         at
> org.springframework.context.support.AbstractRefreshableApplicationCon
> text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
>         at
> org.springframework.context.support.AbstractApplicationContext.refres
> h(AbstractApplicationContext.java:269)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >(FileSystemXmlApplicationContext.java:149)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >(FileSystemXmlApplicationContext.java:100)
>         at org.apache.servicemix.Main.main(Main.java:80)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
>
>
>
>



Re: Optional Libraries Missing

Posted by Guillaume Nodet <gn...@gmail.com>.
I am aware of that.
It was a bit on purpose for the following reasons:
  * some of the jars that were distributed can not be because their license
prohibits that
  * classloaders / jar conflicts problems

Let me further explain the second point.
The JBI spec defines components that come with their own set of libraries,
but components classloaders inherit all the libraries from the container
classloader.  To avoid clashes, the container should have a minimum set of
libraries (which is obviously not really the case).  A first step is to
remove all unneeded libraries from the container classloader (this also have
the benefit that the distribution is lighter).  There are still possible
conflicts with the jars that are needed by the container (xalan, xerces,
etc...).

If you use servicemix in embedded mode (static servicemix.xml configuration
file), you should build your own distribution and include the necessary
jars.  If you use the lightweight container, the needed jars for the
component you use should be embeded in your service units.

Another thing i have thought about is to create two distributions, one with
std JBI components (the way the current distribution is, but without the
remaining optional libraries) and another one for embedding servicemix (all
needed jars like those for std JBI components available, removing the
deploy/install dirs) .  Examples could also be splitted across the two
distributions.
This has however one drawback: new users may have difficulties to choose
between both distributions and even if the first one is better in production
(ability to deploy/undeploy things at runtime), the second one is easier for
development / tests.

Any ideas welcome.
Guillaume Nodet

On 6/1/06, Soumadeep <so...@infravio.com> wrote:
>
> Changed the subject :)
>
> Soumadeep
>
> -----Original Message-----
> From: Soumadeep [mailto:soumadeep@infravio.com]
> Sent: Thursday, June 01, 2006 4:03 PM
> To: servicemix-users@geronimo.apache.org
> Subject: RE: http-component and dynamic xsltResource
>
> Guillaume,
>
> The new snapshot 3.0 doesn't have many of the optional jars that were
> there
> in the earlier builds, which our application used in order to run.
> We have accordingly changed the code base to accommodate the change in the
> new lib files structure, our code base compiles but we get the following
> error when we try to run it.
>
> Any changes in the way SA and the SU are defined or the jbi.xml??
>
> Thanks
> Soumadeep
>
> Apache ServiceMix ESB: 3.0-SNAPSHOT
>
> Loading Apache ServiceMix from file: servicemix.xml
> Caught: java.lang.NullPointerException
> java.lang.NullPointerException
>         at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
>         at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
>         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
>         at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
>         at java.lang.ClassLoader.getResource(ClassLoader.java:977)
>         at
> org.apache.xbean.server.classloader.MultiParentClassLoader.getResourc
> e(MultiParentClassLoader.java:156)
>         at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java
> :1159)
>         at org.apache.commons.logging.LogFactory$3.run(LogFactory.java
> :627)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.apache.commons.logging.LogFactory.getResourceAsStream(LogFactory.
> java:623)
>         at
> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:281)
>
>         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java
> :395)
>         at
> org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.
> <init>(DefaultXmlBeanDefinitionParser.java:155)
>         at
> org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.<in
> it>(XBeanXmlBeanDefinitionParser.java:66)
>         at
> org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionReader.reg
> isterBeanDefinitions(XBeanXmlBeanDefinitionReader.java:77)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
> eanDefinitions(XmlBeanDefinitionReader.java:223)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
> nDefinitions(XmlBeanDefinitionReader.java:173)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
> nDefinitions(XmlBeanDefinitionReader.java:148)
>         at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReade
> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
>         at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReade
> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
>         at
> org.springframework.context.support.AbstractXmlApplicationContext.loa
> dBeanDefinitions(AbstractXmlApplicationContext.java:113)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadB
> eanDefinitions(FileSystemXmlApplicationContext.java:161)
>         at
> org.springframework.context.support.AbstractRefreshableApplicationCon
> text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
>         at
> org.springframework.context.support.AbstractApplicationContext.refres
> h(AbstractApplicationContext.java:269)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >(FileSystemXmlApplicationContext.java:149)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >(FileSystemXmlApplicationContext.java:100)
>         at org.apache.servicemix.Main.main(Main.java:80)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
>
>
>
>

Optional Libraries Missing

Posted by Soumadeep <so...@infravio.com>.
Changed the subject :)

Soumadeep

-----Original Message-----
From: Soumadeep [mailto:soumadeep@infravio.com]
Sent: Thursday, June 01, 2006 4:03 PM
To: servicemix-users@geronimo.apache.org
Subject: RE: http-component and dynamic xsltResource

Guillaume,

The new snapshot 3.0 doesn't have many of the optional jars that were there
in the earlier builds, which our application used in order to run.
We have accordingly changed the code base to accommodate the change in the
new lib files structure, our code base compiles but we get the following
error when we try to run it.

Any changes in the way SA and the SU are defined or the jbi.xml??

Thanks
Soumadeep

Apache ServiceMix ESB: 3.0-SNAPSHOT

Loading Apache ServiceMix from file: servicemix.xml
Caught: java.lang.NullPointerException
java.lang.NullPointerException
        at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
        at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
        at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
        at java.lang.ClassLoader.getResource(ClassLoader.java:977)
        at
org.apache.xbean.server.classloader.MultiParentClassLoader.getResourc
e(MultiParentClassLoader.java:156)
        at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1159)
        at org.apache.commons.logging.LogFactory$3.run(LogFactory.java:627)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.commons.logging.LogFactory.getResourceAsStream(LogFactory.
java:623)
        at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:281)

        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
        at
org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.
<init>(DefaultXmlBeanDefinitionParser.java:155)
        at
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.<in
it>(XBeanXmlBeanDefinitionParser.java:66)
        at
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionReader.reg
isterBeanDefinitions(XBeanXmlBeanDefinitionReader.java:77)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:223)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:173)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:148)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
        at
org.springframework.context.support.AbstractXmlApplicationContext.loa
dBeanDefinitions(AbstractXmlApplicationContext.java:113)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadB
eanDefinitions(FileSystemXmlApplicationContext.java:161)
        at
org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
        at
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:269)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
>(FileSystemXmlApplicationContext.java:149)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
>(FileSystemXmlApplicationContext.java:100)
        at org.apache.servicemix.Main.main(Main.java:80)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:461)




RE: http-component and dynamic xsltResource

Posted by Soumadeep <so...@infravio.com>.
Guillaume,

The new snapshot 3.0 doesn't have many of the optional jars that were there
in the earlier builds, which our application used in order to run.
We have accordingly changed the code base to accommodate the change in the
new lib files structure, our code base compiles but we get the following
error when we try to run it.

Any changes in the way SA and the SU are defined or the jbi.xml??

Thanks
Soumadeep

Apache ServiceMix ESB: 3.0-SNAPSHOT

Loading Apache ServiceMix from file: servicemix.xml
Caught: java.lang.NullPointerException
java.lang.NullPointerException
        at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
        at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
        at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
        at java.lang.ClassLoader.getResource(ClassLoader.java:977)
        at
org.apache.xbean.server.classloader.MultiParentClassLoader.getResourc
e(MultiParentClassLoader.java:156)
        at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1159)
        at org.apache.commons.logging.LogFactory$3.run(LogFactory.java:627)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.commons.logging.LogFactory.getResourceAsStream(LogFactory.
java:623)
        at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:281)

        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
        at
org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.
<init>(DefaultXmlBeanDefinitionParser.java:155)
        at
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.<in
it>(XBeanXmlBeanDefinitionParser.java:66)
        at
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionReader.reg
isterBeanDefinitions(XBeanXmlBeanDefinitionReader.java:77)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:223)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:173)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:148)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
        at
org.springframework.context.support.AbstractXmlApplicationContext.loa
dBeanDefinitions(AbstractXmlApplicationContext.java:113)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadB
eanDefinitions(FileSystemXmlApplicationContext.java:161)
        at
org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
        at
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:269)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
>(FileSystemXmlApplicationContext.java:149)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
>(FileSystemXmlApplicationContext.java:100)
        at org.apache.servicemix.Main.main(Main.java:80)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:461)



Re: http-component and dynamic xsltResource

Posted by Guillaume Nodet <gn...@gmail.com>.
All your routing needs can be fullfilled by the EIP component,
using the ContentBasedRouter and Pipeline (i guess you are using an InOnly
MEP).

The HTTP will send an InOnly exchange to a Pipeline.
The Pipeline will send an InOut exchange to a first ContentBasedRouter.
The ContentBasedRouter will route  the exchange to the needed XSLT
stylesheet and send back the answer to the Pipeline.
The Pipeline will forward the transformed exchange to a second
ContentBasedRouter which will route it to the final destination (HTTP, SMTP
...)

If the XSLT should be associated with the final destination, you can use a
single ContentBasedRouter and put the several Pipelines between it and the
final destination, each Pipeline invoking an XSLT component.

Not sure if I'm very clear, and mail is not a very good way to express
schema :(

In short, use EIP and one XSLT per endpoint.

Cheers,
Guillaume Nodet



On 6/1/06, David Kaspar Dump <dk...@gmail.com> wrote:
>
> Hello ServiceMix list, thank you for a great product.
>
> Our scenario is to receive messages via HTTP(S), validate, translate
> and route to a destination.
>
> The routing and translation is determined by GET parameters and the
> configuration is to be stored in a data base.
>
> My idea was to develop  a BC that interacts with the data base and
> based on the GET parameters determines what translation should be done
> and what the destination is.
>
> http-component -  BC1 (trasnformation lookup) - XSLT component - BC2
> (router) - HTTP or SMTP or FTP
>
> For this to work I was wondering a few questions.
>
> 1. Is it possible dynamically to change the xsltResource for the XSLT
> component (ie to override what was specified in servicemix.xml)
>
> 2. The way to change the endpont dynamically seems to be to use
>
> ServiceEndpoint se = context.resolveEndpointReference(epr);
> exchange.setEndpoint(se);
>
>
> but what exactly is the "epr fragment"? I would like to resolve an
> endpoint specified in the servicemix.xml
>
> Please suggest if I am completly on the wrong track, maybe I should be
> using the newer servicemix-eip instead?
>
>
> thank you,
> dk
>