You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Ranjib Dey <ra...@thoughtworks.com> on 2010/05/10 18:28:34 UTC

Deploying custom mailets in James3 (Spring deployment)

Hi All,
I am trying to migrate our james based apps form james 2.3.2 to james 3(
which uses spring). Currently i am facing some trouble to incorporate our
custom mailets on james3. I have placed the necessary jar files inside lib
subdirectory, but james is  not able to pick up the classes.. although its
showing it has searched the packages..
following is the log
________________________________
*Exception in thread "main"
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'instanceFactory' defined in class path resource
[spring-beans.xml]: Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'jamesCamelContext': Invocation of init method failed; nested
exception is org.apache.commons.configuration.ConfigurationException: Unable
to init matcher
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
    at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
    at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
    at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at
org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
    at org.apache.james.container.spring.Main.main(Main.java:27)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'jamesCamelContext': Invocation of init method
failed; nested exception is
org.apache.commons.configuration.ConfigurationException: Unable to init
matcher
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
    at
org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
    ... 12 more
Caused by: org.apache.commons.configuration.ConfigurationException: Unable
to init matcher
    at
org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
    at
org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
    at
org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
    at
org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
    at
org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
    at
org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
    at
org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
    ... 23 more
Caused by: org.apache.mailet.MailetException: Could not load matcher
(CrypMatcher);
  nested exception is:
    java.lang.ClassNotFoundException: Requested matcher not found:
CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
org.apache.james.mailet.crypto.matchers. com.thoughtworks.imap.crypmatcher.
    at
org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
    at
org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
    at
org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
    ... 31 more
Caused by: java.lang.ClassNotFoundException: Requested matcher not found:
CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
org.apache.james.mailet.crypto.matchers. com.thoughtworks.imap.crypmatcher.
    at
org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
    at
org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
    ... 32 more
___________*_______________
thanks in advance
ranjib

Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Norman Maurer <no...@apache.org>.
Hi,

you will need to add the jar to yor classpath by add it to setenv.sh /
.bat or wrapper.conf (depending in your start method of James)

bye
Norman

2010/5/10, Ranjib Dey <ra...@thoughtworks.com>:
> Hi All,
> I am trying to migrate our james based apps form james 2.3.2 to james 3(
> which uses spring). Currently i am facing some trouble to incorporate our
> custom mailets on james3. I have placed the necessary jar files inside lib
> subdirectory, but james is  not able to pick up the classes.. although its
> showing it has searched the packages..
> following is the log
> ________________________________
> *Exception in thread "main"
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'instanceFactory' defined in class path resource
> [spring-beans.xml]: Initialization of bean failed; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'jamesCamelContext': Invocation of init method failed; nested
> exception is org.apache.commons.configuration.ConfigurationException: Unable
> to init matcher
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>     at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>     at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
>     at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
>     at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
>     at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>     at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>     at
> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
>     at org.apache.james.container.spring.Main.main(Main.java:27)
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'jamesCamelContext': Invocation of init method
> failed; nested exception is
> org.apache.commons.configuration.ConfigurationException: Unable to init
> matcher
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>     at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>     at
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
>     at
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>     ... 12 more
> Caused by: org.apache.commons.configuration.ConfigurationException: Unable
> to init matcher
>     at
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
>     at
> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
>     at
> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
>     at
> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
>     at
> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
>     at
> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
>     at
> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
>     ... 23 more
> Caused by: org.apache.mailet.MailetException: Could not load matcher
> (CrypMatcher);
>   nested exception is:
>     java.lang.ClassNotFoundException: Requested matcher not found:
> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
> org.apache.james.mailet.crypto.matchers. com.thoughtworks.imap.crypmatcher.
>     at
> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
>     at
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
>     at
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
>     ... 31 more
> Caused by: java.lang.ClassNotFoundException: Requested matcher not found:
> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
> org.apache.james.mailet.crypto.matchers. com.thoughtworks.imap.crypmatcher.
>     at
> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
>     at
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
>     ... 32 more
> ___________*_______________
> thanks in advance
> ranjib
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Norman Maurer <no...@apache.org>.
Hi Eric,

I was more thinkin about override the getClassLoader() method:

http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/core/io/ResourceLoader.html

Bye,
Norman


2010/5/11 Eric Charles <er...@u-mangate.com>:
> Hi Norman,
> About the classloader, are you thinking to set it via
> java.system.class.loader ?
> Tks,
> Eric
>
> On 05/10/2010 06:43 PM, Norman Maurer wrote:
>>
>> Hi Eric,
>>
>> that would be cool . With shell this is no problem. But my windows cmd
>> knowledge stopped me from doing this for windows. Maybe we could try
>> to use a custom classloader which will just pick up every jar inthe
>> folder.
>>
>> WDYT?
>>
>> Bye
>> Norman
>>
>> 2010/5/10, Eric Charles<er...@u-mangate.com>:
>>
>>>
>>> Hi Ranjib,
>>>
>>> The run.sh script located in bin directory set explicitly the classpath
>>> (no automatic discovery).
>>> Can you try to add you own jar to the list and see if it works.
>>>
>>> A nice feature would be james putting all jars in lib on the classpath
>>> (with jdk 1.6, simply set the directory on the classpath, otherwise a
>>> some bash commands must be used).
>>>
>>> Tks,
>>>
>>> Eric
>>>
>>>
>>> On 05/10/2010 06:28 PM, Ranjib Dey wrote:
>>>
>>>>
>>>> Hi All,
>>>> I am trying to migrate our james based apps form james 2.3.2 to james 3(
>>>> which uses spring). Currently i am facing some trouble to incorporate
>>>> our
>>>> custom mailets on james3. I have placed the necessary jar files inside
>>>> lib
>>>> subdirectory, but james is  not able to pick up the classes.. although
>>>> its
>>>> showing it has searched the packages..
>>>> following is the log
>>>> ________________________________
>>>> *Exception in thread "main"
>>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>>> bean
>>>> with name 'instanceFactory' defined in class path resource
>>>> [spring-beans.xml]: Initialization of bean failed; nested exception is
>>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>>> bean
>>>> with name 'jamesCamelContext': Invocation of init method failed; nested
>>>> exception is org.apache.commons.configuration.ConfigurationException:
>>>> Unable
>>>> to init matcher
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
>>>>      at
>>>>
>>>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
>>>>      at
>>>>
>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
>>>>      at
>>>>
>>>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>>>>      at
>>>>
>>>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>>>>      at
>>>>
>>>> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
>>>>      at org.apache.james.container.spring.Main.main(Main.java:27)
>>>> Caused by: org.springframework.beans.factory.BeanCreationException:
>>>> Error
>>>> creating bean with name 'jamesCamelContext': Invocation of init method
>>>> failed; nested exception is
>>>> org.apache.commons.configuration.ConfigurationException: Unable to init
>>>> matcher
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>>>>      at
>>>>
>>>> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
>>>>      at
>>>>
>>>> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>>>>      ... 12 more
>>>> Caused by: org.apache.commons.configuration.ConfigurationException:
>>>> Unable
>>>> to init matcher
>>>>      at
>>>>
>>>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
>>>>      at
>>>>
>>>> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
>>>>      at
>>>>
>>>> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
>>>>      at
>>>>
>>>> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
>>>>      at
>>>>
>>>> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
>>>>      at
>>>>
>>>> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
>>>>      at
>>>>
>>>> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
>>>>      at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
>>>>      ... 23 more
>>>> Caused by: org.apache.mailet.MailetException: Could not load matcher
>>>> (CrypMatcher);
>>>>    nested exception is:
>>>>      java.lang.ClassNotFoundException: Requested matcher not found:
>>>> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>>>> org.apache.james.mailet.crypto.matchers.
>>>> com.thoughtworks.imap.crypmatcher.
>>>>      at
>>>>
>>>> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
>>>>      at
>>>>
>>>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
>>>>      at
>>>>
>>>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
>>>>      ... 31 more
>>>> Caused by: java.lang.ClassNotFoundException: Requested matcher not
>>>> found:
>>>> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>>>> org.apache.james.mailet.crypto.matchers.
>>>> com.thoughtworks.imap.crypmatcher.
>>>>      at
>>>>
>>>> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
>>>>      at
>>>>
>>>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
>>>>      ... 32 more
>>>> ___________*_______________
>>>> thanks in advance
>>>> ranjib
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Eric Charles <er...@u-mangate.com>.
Hi Norman,
About the classloader, are you thinking to set it via 
java.system.class.loader ?
Tks,
Eric

On 05/10/2010 06:43 PM, Norman Maurer wrote:
> Hi Eric,
>
> that would be cool . With shell this is no problem. But my windows cmd
> knowledge stopped me from doing this for windows. Maybe we could try
> to use a custom classloader which will just pick up every jar inthe
> folder.
>
> WDYT?
>
> Bye
> Norman
>
> 2010/5/10, Eric Charles<er...@u-mangate.com>:
>    
>> Hi Ranjib,
>>
>> The run.sh script located in bin directory set explicitly the classpath
>> (no automatic discovery).
>> Can you try to add you own jar to the list and see if it works.
>>
>> A nice feature would be james putting all jars in lib on the classpath
>> (with jdk 1.6, simply set the directory on the classpath, otherwise a
>> some bash commands must be used).
>>
>> Tks,
>>
>> Eric
>>
>>
>> On 05/10/2010 06:28 PM, Ranjib Dey wrote:
>>      
>>> Hi All,
>>> I am trying to migrate our james based apps form james 2.3.2 to james 3(
>>> which uses spring). Currently i am facing some trouble to incorporate our
>>> custom mailets on james3. I have placed the necessary jar files inside lib
>>> subdirectory, but james is  not able to pick up the classes.. although its
>>> showing it has searched the packages..
>>> following is the log
>>> ________________________________
>>> *Exception in thread "main"
>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>> bean
>>> with name 'instanceFactory' defined in class path resource
>>> [spring-beans.xml]: Initialization of bean failed; nested exception is
>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>> bean
>>> with name 'jamesCamelContext': Invocation of init method failed; nested
>>> exception is org.apache.commons.configuration.ConfigurationException:
>>> Unable
>>> to init matcher
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>>>       at
>>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>>>       at
>>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>>       at
>>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>>>       at
>>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>>>       at
>>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
>>>       at
>>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
>>>       at
>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
>>>       at
>>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>>>       at
>>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>>>       at
>>> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
>>>       at org.apache.james.container.spring.Main.main(Main.java:27)
>>> Caused by: org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name 'jamesCamelContext': Invocation of init method
>>> failed; nested exception is
>>> org.apache.commons.configuration.ConfigurationException: Unable to init
>>> matcher
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>>>       at
>>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>>>       at
>>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>>       at
>>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>>>       at
>>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>>>       at
>>> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
>>>       at
>>> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>>>       ... 12 more
>>> Caused by: org.apache.commons.configuration.ConfigurationException: Unable
>>> to init matcher
>>>       at
>>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
>>>       at
>>> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
>>>       at
>>> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
>>>       at
>>> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
>>>       at
>>> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
>>>       at
>>> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
>>>       at
>>> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
>>>       at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
>>>       ... 23 more
>>> Caused by: org.apache.mailet.MailetException: Could not load matcher
>>> (CrypMatcher);
>>>     nested exception is:
>>>       java.lang.ClassNotFoundException: Requested matcher not found:
>>> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>>> org.apache.james.mailet.crypto.matchers.
>>> com.thoughtworks.imap.crypmatcher.
>>>       at
>>> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
>>>       at
>>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
>>>       at
>>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
>>>       ... 31 more
>>> Caused by: java.lang.ClassNotFoundException: Requested matcher not found:
>>> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>>> org.apache.james.mailet.crypto.matchers.
>>> com.thoughtworks.imap.crypmatcher.
>>>       at
>>> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
>>>       at
>>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
>>>       ... 32 more
>>> ___________*_______________
>>> thanks in advance
>>> ranjib
>>>
>>>
>>>        
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
>>      
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Ranjib Dey <ra...@thoughtworks.com>.
[ranjib@localhost]#cd james/bin
[ranjib@localhost]#sh run.sh


On Mon, May 10, 2010 at 11:52 PM, Norman Maurer <no...@apache.org> wrote:

> So only not workin with multiple jars ?
>
> How you start james ?
> Thx,
> Norman
>
> 2010/5/10 Ranjib Dey <ra...@thoughtworks.com>:
> > tried that too, but its not working when im giving multiple jar files (
> ';'
> > separated)
> > On Mon, May 10, 2010 at 11:43 PM, Norman Maurer <no...@apache.org>
> wrote:
> >
> >> Hi just add your mailet with full path:
> >>
> >> CLASSPATH_PREFIX=/full/path/to/your/jar/TWCrypto.jar
> >>
> >> Bye,
> >> Norman
> >>
> >>
> >> 2010/5/10 Ranjib Dey <ra...@thoughtworks.com>:
> >> > thanks, norman , eric i added rge jar file in the setenv.sh. But then
> >> james
> >> > unable to find out the "GenericMatcher" class (belongs to
> >> mailet-2.3.jar).
> >> > When i tried to add that to in the class path, it again fails to
> detect
> >> the
> >> > custom mailet
> >> > following the entry in setenv.sh
> >> >
> >> > CLASSPATH_PREFIX="../mailet-2.3.jar;TWCrypto.jar"
> >> >
> >> > following is the log
> >> > ----------------------------------
> >> >
> >> >  org.apache.mailet.MailetException: Could not load matcher
> (CrypMatcher);
> >> > ------------------------------------------
> >> >
> >> > On Mon, May 10, 2010 at 10:13 PM, Norman Maurer <no...@apache.org>
> >> wrote:
> >> >
> >> >> Hi Eric,
> >> >>
> >> >> that would be cool . With shell this is no problem. But my windows
> cmd
> >> >> knowledge stopped me from doing this for windows. Maybe we could try
> >> >> to use a custom classloader which will just pick up every jar inthe
> >> >> folder.
> >> >>
> >> >> WDYT?
> >> >>
> >> >> Bye
> >> >> Norman
> >> >>
> >> >> 2010/5/10, Eric Charles <er...@u-mangate.com>:
> >> >> > Hi Ranjib,
> >> >> >
> >> >> > The run.sh script located in bin directory set explicitly the
> >> classpath
> >> >> > (no automatic discovery).
> >> >> > Can you try to add you own jar to the list and see if it works.
> >> >> >
> >> >> > A nice feature would be james putting all jars in lib on the
> classpath
> >> >> > (with jdk 1.6, simply set the directory on the classpath, otherwise
> a
> >> >> > some bash commands must be used).
> >> >> >
> >> >> > Tks,
> >> >> >
> >> >> > Eric
> >> >> >
> >> >> >
> >> >> > On 05/10/2010 06:28 PM, Ranjib Dey wrote:
> >> >> >> Hi All,
> >> >> >> I am trying to migrate our james based apps form james 2.3.2 to
> james
> >> 3(
> >> >> >> which uses spring). Currently i am facing some trouble to
> incorporate
> >> >> our
> >> >> >> custom mailets on james3. I have placed the necessary jar files
> >> inside
> >> >> lib
> >> >> >> subdirectory, but james is  not able to pick up the classes..
> >> although
> >> >> its
> >> >> >> showing it has searched the packages..
> >> >> >> following is the log
> >> >> >> ________________________________
> >> >> >> *Exception in thread "main"
> >> >> >> org.springframework.beans.factory.BeanCreationException: Error
> >> creating
> >> >> >> bean
> >> >> >> with name 'instanceFactory' defined in class path resource
> >> >> >> [spring-beans.xml]: Initialization of bean failed; nested
> exception
> >> is
> >> >> >> org.springframework.beans.factory.BeanCreationException: Error
> >> creating
> >> >> >> bean
> >> >> >> with name 'jamesCamelContext': Invocation of init method failed;
> >> nested
> >> >> >> exception is
> org.apache.commons.configuration.ConfigurationException:
> >> >> >> Unable
> >> >> >> to init matcher
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
> >> >> >>      at org.apache.james.container.spring.Main.main(Main.java:27)
> >> >> >> Caused by:
> org.springframework.beans.factory.BeanCreationException:
> >> >> Error
> >> >> >> creating bean with name 'jamesCamelContext': Invocation of init
> >> method
> >> >> >> failed; nested exception is
> >> >> >> org.apache.commons.configuration.ConfigurationException: Unable to
> >> init
> >> >> >> matcher
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
> >> >> >>      ... 12 more
> >> >> >> Caused by:
> org.apache.commons.configuration.ConfigurationException:
> >> >> Unable
> >> >> >> to init matcher
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
> >> >> >>      ... 23 more
> >> >> >> Caused by: org.apache.mailet.MailetException: Could not load
> matcher
> >> >> >> (CrypMatcher);
> >> >> >>    nested exception is:
> >> >> >>      java.lang.ClassNotFoundException: Requested matcher not
> found:
> >> >> >> CrypMatcher.  Package searched:
>  org.apache.james.transport.matchers.
> >> >> >> org.apache.james.mailet.crypto.matchers.
> >> >> >> com.thoughtworks.imap.crypmatcher.
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
> >> >> >>      ... 31 more
> >> >> >> Caused by: java.lang.ClassNotFoundException: Requested matcher not
> >> >> found:
> >> >> >> CrypMatcher.  Package searched:
>  org.apache.james.transport.matchers.
> >> >> >> org.apache.james.mailet.crypto.matchers.
> >> >> >> com.thoughtworks.imap.crypmatcher.
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
> >> >> >>      at
> >> >> >>
> >> >>
> >>
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
> >> >> >>      ... 32 more
> >> >> >> ___________*_______________
> >> >> >> thanks in advance
> >> >> >> ranjib
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> ---------------------------------------------------------------------
> >> >> > To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> >> >> > For additional commands, e-mail: server-user-help@james.apache.org
> >> >> >
> >> >> >
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> >> >> For additional commands, e-mail: server-user-help@james.apache.org
> >> >>
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> >> For additional commands, e-mail: server-user-help@james.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Norman Maurer <no...@apache.org>.
So only not workin with multiple jars ?

How you start james ?
Thx,
Norman

2010/5/10 Ranjib Dey <ra...@thoughtworks.com>:
> tried that too, but its not working when im giving multiple jar files ( ';'
> separated)
> On Mon, May 10, 2010 at 11:43 PM, Norman Maurer <no...@apache.org> wrote:
>
>> Hi just add your mailet with full path:
>>
>> CLASSPATH_PREFIX=/full/path/to/your/jar/TWCrypto.jar
>>
>> Bye,
>> Norman
>>
>>
>> 2010/5/10 Ranjib Dey <ra...@thoughtworks.com>:
>> > thanks, norman , eric i added rge jar file in the setenv.sh. But then
>> james
>> > unable to find out the "GenericMatcher" class (belongs to
>> mailet-2.3.jar).
>> > When i tried to add that to in the class path, it again fails to detect
>> the
>> > custom mailet
>> > following the entry in setenv.sh
>> >
>> > CLASSPATH_PREFIX="../mailet-2.3.jar;TWCrypto.jar"
>> >
>> > following is the log
>> > ----------------------------------
>> >
>> >  org.apache.mailet.MailetException: Could not load matcher (CrypMatcher);
>> > ------------------------------------------
>> >
>> > On Mon, May 10, 2010 at 10:13 PM, Norman Maurer <no...@apache.org>
>> wrote:
>> >
>> >> Hi Eric,
>> >>
>> >> that would be cool . With shell this is no problem. But my windows cmd
>> >> knowledge stopped me from doing this for windows. Maybe we could try
>> >> to use a custom classloader which will just pick up every jar inthe
>> >> folder.
>> >>
>> >> WDYT?
>> >>
>> >> Bye
>> >> Norman
>> >>
>> >> 2010/5/10, Eric Charles <er...@u-mangate.com>:
>> >> > Hi Ranjib,
>> >> >
>> >> > The run.sh script located in bin directory set explicitly the
>> classpath
>> >> > (no automatic discovery).
>> >> > Can you try to add you own jar to the list and see if it works.
>> >> >
>> >> > A nice feature would be james putting all jars in lib on the classpath
>> >> > (with jdk 1.6, simply set the directory on the classpath, otherwise a
>> >> > some bash commands must be used).
>> >> >
>> >> > Tks,
>> >> >
>> >> > Eric
>> >> >
>> >> >
>> >> > On 05/10/2010 06:28 PM, Ranjib Dey wrote:
>> >> >> Hi All,
>> >> >> I am trying to migrate our james based apps form james 2.3.2 to james
>> 3(
>> >> >> which uses spring). Currently i am facing some trouble to incorporate
>> >> our
>> >> >> custom mailets on james3. I have placed the necessary jar files
>> inside
>> >> lib
>> >> >> subdirectory, but james is  not able to pick up the classes..
>> although
>> >> its
>> >> >> showing it has searched the packages..
>> >> >> following is the log
>> >> >> ________________________________
>> >> >> *Exception in thread "main"
>> >> >> org.springframework.beans.factory.BeanCreationException: Error
>> creating
>> >> >> bean
>> >> >> with name 'instanceFactory' defined in class path resource
>> >> >> [spring-beans.xml]: Initialization of bean failed; nested exception
>> is
>> >> >> org.springframework.beans.factory.BeanCreationException: Error
>> creating
>> >> >> bean
>> >> >> with name 'jamesCamelContext': Invocation of init method failed;
>> nested
>> >> >> exception is org.apache.commons.configuration.ConfigurationException:
>> >> >> Unable
>> >> >> to init matcher
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
>> >> >>      at org.apache.james.container.spring.Main.main(Main.java:27)
>> >> >> Caused by: org.springframework.beans.factory.BeanCreationException:
>> >> Error
>> >> >> creating bean with name 'jamesCamelContext': Invocation of init
>> method
>> >> >> failed; nested exception is
>> >> >> org.apache.commons.configuration.ConfigurationException: Unable to
>> init
>> >> >> matcher
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>> >> >>      ... 12 more
>> >> >> Caused by: org.apache.commons.configuration.ConfigurationException:
>> >> Unable
>> >> >> to init matcher
>> >> >>      at
>> >> >>
>> >>
>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
>> >> >>      at
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
>> >> >>      ... 23 more
>> >> >> Caused by: org.apache.mailet.MailetException: Could not load matcher
>> >> >> (CrypMatcher);
>> >> >>    nested exception is:
>> >> >>      java.lang.ClassNotFoundException: Requested matcher not found:
>> >> >> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>> >> >> org.apache.james.mailet.crypto.matchers.
>> >> >> com.thoughtworks.imap.crypmatcher.
>> >> >>      at
>> >> >>
>> >>
>> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
>> >> >>      ... 31 more
>> >> >> Caused by: java.lang.ClassNotFoundException: Requested matcher not
>> >> found:
>> >> >> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>> >> >> org.apache.james.mailet.crypto.matchers.
>> >> >> com.thoughtworks.imap.crypmatcher.
>> >> >>      at
>> >> >>
>> >>
>> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
>> >> >>      at
>> >> >>
>> >>
>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
>> >> >>      ... 32 more
>> >> >> ___________*_______________
>> >> >> thanks in advance
>> >> >> ranjib
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> >> > For additional commands, e-mail: server-user-help@james.apache.org
>> >> >
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> >> For additional commands, e-mail: server-user-help@james.apache.org
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Ranjib Dey <ra...@thoughtworks.com>.
tried that too, but its not working when im giving multiple jar files ( ';'
separated)
On Mon, May 10, 2010 at 11:43 PM, Norman Maurer <no...@apache.org> wrote:

> Hi just add your mailet with full path:
>
> CLASSPATH_PREFIX=/full/path/to/your/jar/TWCrypto.jar
>
> Bye,
> Norman
>
>
> 2010/5/10 Ranjib Dey <ra...@thoughtworks.com>:
> > thanks, norman , eric i added rge jar file in the setenv.sh. But then
> james
> > unable to find out the "GenericMatcher" class (belongs to
> mailet-2.3.jar).
> > When i tried to add that to in the class path, it again fails to detect
> the
> > custom mailet
> > following the entry in setenv.sh
> >
> > CLASSPATH_PREFIX="../mailet-2.3.jar;TWCrypto.jar"
> >
> > following is the log
> > ----------------------------------
> >
> >  org.apache.mailet.MailetException: Could not load matcher (CrypMatcher);
> > ------------------------------------------
> >
> > On Mon, May 10, 2010 at 10:13 PM, Norman Maurer <no...@apache.org>
> wrote:
> >
> >> Hi Eric,
> >>
> >> that would be cool . With shell this is no problem. But my windows cmd
> >> knowledge stopped me from doing this for windows. Maybe we could try
> >> to use a custom classloader which will just pick up every jar inthe
> >> folder.
> >>
> >> WDYT?
> >>
> >> Bye
> >> Norman
> >>
> >> 2010/5/10, Eric Charles <er...@u-mangate.com>:
> >> > Hi Ranjib,
> >> >
> >> > The run.sh script located in bin directory set explicitly the
> classpath
> >> > (no automatic discovery).
> >> > Can you try to add you own jar to the list and see if it works.
> >> >
> >> > A nice feature would be james putting all jars in lib on the classpath
> >> > (with jdk 1.6, simply set the directory on the classpath, otherwise a
> >> > some bash commands must be used).
> >> >
> >> > Tks,
> >> >
> >> > Eric
> >> >
> >> >
> >> > On 05/10/2010 06:28 PM, Ranjib Dey wrote:
> >> >> Hi All,
> >> >> I am trying to migrate our james based apps form james 2.3.2 to james
> 3(
> >> >> which uses spring). Currently i am facing some trouble to incorporate
> >> our
> >> >> custom mailets on james3. I have placed the necessary jar files
> inside
> >> lib
> >> >> subdirectory, but james is  not able to pick up the classes..
> although
> >> its
> >> >> showing it has searched the packages..
> >> >> following is the log
> >> >> ________________________________
> >> >> *Exception in thread "main"
> >> >> org.springframework.beans.factory.BeanCreationException: Error
> creating
> >> >> bean
> >> >> with name 'instanceFactory' defined in class path resource
> >> >> [spring-beans.xml]: Initialization of bean failed; nested exception
> is
> >> >> org.springframework.beans.factory.BeanCreationException: Error
> creating
> >> >> bean
> >> >> with name 'jamesCamelContext': Invocation of init method failed;
> nested
> >> >> exception is org.apache.commons.configuration.ConfigurationException:
> >> >> Unable
> >> >> to init matcher
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
> >> >>      at
> >> >>
> >>
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
> >> >>      at
> >> >>
> >>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
> >> >>      at
> >> >>
> >>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
> >> >>      at
> >> >>
> >>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
> >> >>      at
> >> >>
> >>
> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
> >> >>      at org.apache.james.container.spring.Main.main(Main.java:27)
> >> >> Caused by: org.springframework.beans.factory.BeanCreationException:
> >> Error
> >> >> creating bean with name 'jamesCamelContext': Invocation of init
> method
> >> >> failed; nested exception is
> >> >> org.apache.commons.configuration.ConfigurationException: Unable to
> init
> >> >> matcher
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
> >> >>      at
> >> >>
> >>
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
> >> >>      at
> >> >>
> >>
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
> >> >>      ... 12 more
> >> >> Caused by: org.apache.commons.configuration.ConfigurationException:
> >> Unable
> >> >> to init matcher
> >> >>      at
> >> >>
> >>
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
> >> >>      at
> >> >>
> >>
> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
> >> >>      at
> >> >>
> >>
> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
> >> >>      at
> >> >>
> >>
> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
> >> >>      at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
> >> >>      at
> >> >>
> >>
> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
> >> >>      at
> >> >>
> >>
> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
> >> >>      at
> >> >>
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
> >> >>      ... 23 more
> >> >> Caused by: org.apache.mailet.MailetException: Could not load matcher
> >> >> (CrypMatcher);
> >> >>    nested exception is:
> >> >>      java.lang.ClassNotFoundException: Requested matcher not found:
> >> >> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
> >> >> org.apache.james.mailet.crypto.matchers.
> >> >> com.thoughtworks.imap.crypmatcher.
> >> >>      at
> >> >>
> >>
> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
> >> >>      at
> >> >>
> >>
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
> >> >>      at
> >> >>
> >>
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
> >> >>      ... 31 more
> >> >> Caused by: java.lang.ClassNotFoundException: Requested matcher not
> >> found:
> >> >> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
> >> >> org.apache.james.mailet.crypto.matchers.
> >> >> com.thoughtworks.imap.crypmatcher.
> >> >>      at
> >> >>
> >>
> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
> >> >>      at
> >> >>
> >>
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
> >> >>      ... 32 more
> >> >> ___________*_______________
> >> >> thanks in advance
> >> >> ranjib
> >> >>
> >> >>
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> >> > For additional commands, e-mail: server-user-help@james.apache.org
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> >> For additional commands, e-mail: server-user-help@james.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Norman Maurer <no...@apache.org>.
Hi just add your mailet with full path:

CLASSPATH_PREFIX=/full/path/to/your/jar/TWCrypto.jar

Bye,
Norman


2010/5/10 Ranjib Dey <ra...@thoughtworks.com>:
> thanks, norman , eric i added rge jar file in the setenv.sh. But then james
> unable to find out the "GenericMatcher" class (belongs to mailet-2.3.jar).
> When i tried to add that to in the class path, it again fails to detect the
> custom mailet
> following the entry in setenv.sh
>
> CLASSPATH_PREFIX="../mailet-2.3.jar;TWCrypto.jar"
>
> following is the log
> ----------------------------------
>
>  org.apache.mailet.MailetException: Could not load matcher (CrypMatcher);
> ------------------------------------------
>
> On Mon, May 10, 2010 at 10:13 PM, Norman Maurer <no...@apache.org> wrote:
>
>> Hi Eric,
>>
>> that would be cool . With shell this is no problem. But my windows cmd
>> knowledge stopped me from doing this for windows. Maybe we could try
>> to use a custom classloader which will just pick up every jar inthe
>> folder.
>>
>> WDYT?
>>
>> Bye
>> Norman
>>
>> 2010/5/10, Eric Charles <er...@u-mangate.com>:
>> > Hi Ranjib,
>> >
>> > The run.sh script located in bin directory set explicitly the classpath
>> > (no automatic discovery).
>> > Can you try to add you own jar to the list and see if it works.
>> >
>> > A nice feature would be james putting all jars in lib on the classpath
>> > (with jdk 1.6, simply set the directory on the classpath, otherwise a
>> > some bash commands must be used).
>> >
>> > Tks,
>> >
>> > Eric
>> >
>> >
>> > On 05/10/2010 06:28 PM, Ranjib Dey wrote:
>> >> Hi All,
>> >> I am trying to migrate our james based apps form james 2.3.2 to james 3(
>> >> which uses spring). Currently i am facing some trouble to incorporate
>> our
>> >> custom mailets on james3. I have placed the necessary jar files inside
>> lib
>> >> subdirectory, but james is  not able to pick up the classes.. although
>> its
>> >> showing it has searched the packages..
>> >> following is the log
>> >> ________________________________
>> >> *Exception in thread "main"
>> >> org.springframework.beans.factory.BeanCreationException: Error creating
>> >> bean
>> >> with name 'instanceFactory' defined in class path resource
>> >> [spring-beans.xml]: Initialization of bean failed; nested exception is
>> >> org.springframework.beans.factory.BeanCreationException: Error creating
>> >> bean
>> >> with name 'jamesCamelContext': Invocation of init method failed; nested
>> >> exception is org.apache.commons.configuration.ConfigurationException:
>> >> Unable
>> >> to init matcher
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
>> >>      at
>> >>
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
>> >>      at
>> >>
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
>> >>      at
>> >>
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>> >>      at
>> >>
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>> >>      at
>> >>
>> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
>> >>      at org.apache.james.container.spring.Main.main(Main.java:27)
>> >> Caused by: org.springframework.beans.factory.BeanCreationException:
>> Error
>> >> creating bean with name 'jamesCamelContext': Invocation of init method
>> >> failed; nested exception is
>> >> org.apache.commons.configuration.ConfigurationException: Unable to init
>> >> matcher
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>> >>      at
>> >>
>> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
>> >>      at
>> >>
>> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>> >>      ... 12 more
>> >> Caused by: org.apache.commons.configuration.ConfigurationException:
>> Unable
>> >> to init matcher
>> >>      at
>> >>
>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
>> >>      at
>> >>
>> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
>> >>      at
>> >>
>> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
>> >>      at
>> >>
>> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
>> >>      at
>> >>
>> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
>> >>      at
>> >>
>> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
>> >>      at
>> >>
>> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
>> >>      at
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
>> >>      ... 23 more
>> >> Caused by: org.apache.mailet.MailetException: Could not load matcher
>> >> (CrypMatcher);
>> >>    nested exception is:
>> >>      java.lang.ClassNotFoundException: Requested matcher not found:
>> >> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>> >> org.apache.james.mailet.crypto.matchers.
>> >> com.thoughtworks.imap.crypmatcher.
>> >>      at
>> >>
>> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
>> >>      at
>> >>
>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
>> >>      at
>> >>
>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
>> >>      ... 31 more
>> >> Caused by: java.lang.ClassNotFoundException: Requested matcher not
>> found:
>> >> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>> >> org.apache.james.mailet.crypto.matchers.
>> >> com.thoughtworks.imap.crypmatcher.
>> >>      at
>> >>
>> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
>> >>      at
>> >>
>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
>> >>      ... 32 more
>> >> ___________*_______________
>> >> thanks in advance
>> >> ranjib
>> >>
>> >>
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> > For additional commands, e-mail: server-user-help@james.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Ranjib Dey <ra...@thoughtworks.com>.
thanks, norman , eric i added rge jar file in the setenv.sh. But then james
unable to find out the "GenericMatcher" class (belongs to mailet-2.3.jar).
When i tried to add that to in the class path, it again fails to detect the
custom mailet
following the entry in setenv.sh

CLASSPATH_PREFIX="../mailet-2.3.jar;TWCrypto.jar"

following is the log
----------------------------------

 org.apache.mailet.MailetException: Could not load matcher (CrypMatcher);
------------------------------------------

On Mon, May 10, 2010 at 10:13 PM, Norman Maurer <no...@apache.org> wrote:

> Hi Eric,
>
> that would be cool . With shell this is no problem. But my windows cmd
> knowledge stopped me from doing this for windows. Maybe we could try
> to use a custom classloader which will just pick up every jar inthe
> folder.
>
> WDYT?
>
> Bye
> Norman
>
> 2010/5/10, Eric Charles <er...@u-mangate.com>:
> > Hi Ranjib,
> >
> > The run.sh script located in bin directory set explicitly the classpath
> > (no automatic discovery).
> > Can you try to add you own jar to the list and see if it works.
> >
> > A nice feature would be james putting all jars in lib on the classpath
> > (with jdk 1.6, simply set the directory on the classpath, otherwise a
> > some bash commands must be used).
> >
> > Tks,
> >
> > Eric
> >
> >
> > On 05/10/2010 06:28 PM, Ranjib Dey wrote:
> >> Hi All,
> >> I am trying to migrate our james based apps form james 2.3.2 to james 3(
> >> which uses spring). Currently i am facing some trouble to incorporate
> our
> >> custom mailets on james3. I have placed the necessary jar files inside
> lib
> >> subdirectory, but james is  not able to pick up the classes.. although
> its
> >> showing it has searched the packages..
> >> following is the log
> >> ________________________________
> >> *Exception in thread "main"
> >> org.springframework.beans.factory.BeanCreationException: Error creating
> >> bean
> >> with name 'instanceFactory' defined in class path resource
> >> [spring-beans.xml]: Initialization of bean failed; nested exception is
> >> org.springframework.beans.factory.BeanCreationException: Error creating
> >> bean
> >> with name 'jamesCamelContext': Invocation of init method failed; nested
> >> exception is org.apache.commons.configuration.ConfigurationException:
> >> Unable
> >> to init matcher
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
> >>      at
> >>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
> >>      at
> >>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
> >>      at
> >>
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
> >>      at
> >>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
> >>      at
> >>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
> >>      at
> >>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
> >>      at
> >>
> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
> >>      at org.apache.james.container.spring.Main.main(Main.java:27)
> >> Caused by: org.springframework.beans.factory.BeanCreationException:
> Error
> >> creating bean with name 'jamesCamelContext': Invocation of init method
> >> failed; nested exception is
> >> org.apache.commons.configuration.ConfigurationException: Unable to init
> >> matcher
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
> >>      at
> >>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
> >>      at
> >>
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
> >>      at
> >>
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
> >>      ... 12 more
> >> Caused by: org.apache.commons.configuration.ConfigurationException:
> Unable
> >> to init matcher
> >>      at
> >>
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
> >>      at
> >>
> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
> >>      at
> >>
> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
> >>      at
> >>
> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
> >>      at
> >>
> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
> >>      at
> >>
> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
> >>      at
> >>
> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
> >>      at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
> >>      ... 23 more
> >> Caused by: org.apache.mailet.MailetException: Could not load matcher
> >> (CrypMatcher);
> >>    nested exception is:
> >>      java.lang.ClassNotFoundException: Requested matcher not found:
> >> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
> >> org.apache.james.mailet.crypto.matchers.
> >> com.thoughtworks.imap.crypmatcher.
> >>      at
> >>
> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
> >>      at
> >>
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
> >>      at
> >>
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
> >>      ... 31 more
> >> Caused by: java.lang.ClassNotFoundException: Requested matcher not
> found:
> >> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
> >> org.apache.james.mailet.crypto.matchers.
> >> com.thoughtworks.imap.crypmatcher.
> >>      at
> >>
> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
> >>      at
> >>
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
> >>      ... 32 more
> >> ___________*_______________
> >> thanks in advance
> >> ranjib
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> > For additional commands, e-mail: server-user-help@james.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Norman Maurer <no...@apache.org>.
Hi Israel,

thx for the help, I know there are some windows gurus out there ;)

Bye,
Norman


2010/5/11 Israel Tsadok <it...@gmail.com>:
> Norman,
> To do something like this in windows, you need the following lines in run.bat:
>
> SETLOCAL ENABLEDELAYEDEXPANSION
>
> FOR %%j IN ("%REPO%"\*.jar) DO (
>  SET CLASSPATH=!CLASSPATH!;%%j
> )
>
> Hope you get the picture.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Norman Maurer <no...@apache.org>.
I really would like to understand why it not worked out.. I'm doing
exactly this here without a problem. What shell are you using ? Can
you see the jars added to the classpath via "ps auxwww" ?

Thx,
Norman


2010/5/11 Ranjib Dey <ra...@thoughtworks.com>:
> i have tried to add the jars through setenv.sh, but didn't work... finally i
> end up appending them in the runs.sh 's  classpath variable
> On Tue, May 11, 2010 at 11:35 AM, Israel Tsadok <it...@gmail.com> wrote:
>
>> Norman,
>> To do something like this in windows, you need the following lines in
>> run.bat:
>>
>> SETLOCAL ENABLEDELAYEDEXPANSION
>>
>> FOR %%j IN ("%REPO%"\*.jar) DO (
>>  SET CLASSPATH=!CLASSPATH!;%%j
>> )
>>
>> Hope you get the picture.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Ranjib Dey <ra...@thoughtworks.com>.
i have tried to add the jars through setenv.sh, but didn't work... finally i
end up appending them in the runs.sh 's  classpath variable
On Tue, May 11, 2010 at 11:35 AM, Israel Tsadok <it...@gmail.com> wrote:

> Norman,
> To do something like this in windows, you need the following lines in
> run.bat:
>
> SETLOCAL ENABLEDELAYEDEXPANSION
>
> FOR %%j IN ("%REPO%"\*.jar) DO (
>  SET CLASSPATH=!CLASSPATH!;%%j
> )
>
> Hope you get the picture.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Israel Tsadok <it...@gmail.com>.
Norman,
To do something like this in windows, you need the following lines in run.bat:

SETLOCAL ENABLEDELAYEDEXPANSION

FOR %%j IN ("%REPO%"\*.jar) DO (
  SET CLASSPATH=!CLASSPATH!;%%j
)

Hope you get the picture.

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Norman Maurer <no...@apache.org>.
Hi Eric,

that would be cool . With shell this is no problem. But my windows cmd
knowledge stopped me from doing this for windows. Maybe we could try
to use a custom classloader which will just pick up every jar inthe
folder.

WDYT?

Bye
Norman

2010/5/10, Eric Charles <er...@u-mangate.com>:
> Hi Ranjib,
>
> The run.sh script located in bin directory set explicitly the classpath
> (no automatic discovery).
> Can you try to add you own jar to the list and see if it works.
>
> A nice feature would be james putting all jars in lib on the classpath
> (with jdk 1.6, simply set the directory on the classpath, otherwise a
> some bash commands must be used).
>
> Tks,
>
> Eric
>
>
> On 05/10/2010 06:28 PM, Ranjib Dey wrote:
>> Hi All,
>> I am trying to migrate our james based apps form james 2.3.2 to james 3(
>> which uses spring). Currently i am facing some trouble to incorporate our
>> custom mailets on james3. I have placed the necessary jar files inside lib
>> subdirectory, but james is  not able to pick up the classes.. although its
>> showing it has searched the packages..
>> following is the log
>> ________________________________
>> *Exception in thread "main"
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean
>> with name 'instanceFactory' defined in class path resource
>> [spring-beans.xml]: Initialization of bean failed; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean
>> with name 'jamesCamelContext': Invocation of init method failed; nested
>> exception is org.apache.commons.configuration.ConfigurationException:
>> Unable
>> to init matcher
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>>      at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>>      at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>      at
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>>      at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>>      at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
>>      at
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
>>      at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
>>      at
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>>      at
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>>      at
>> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
>>      at org.apache.james.container.spring.Main.main(Main.java:27)
>> Caused by: org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'jamesCamelContext': Invocation of init method
>> failed; nested exception is
>> org.apache.commons.configuration.ConfigurationException: Unable to init
>> matcher
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>>      at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>>      at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>      at
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>>      at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>>      at
>> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
>>      at
>> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>>      ... 12 more
>> Caused by: org.apache.commons.configuration.ConfigurationException: Unable
>> to init matcher
>>      at
>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
>>      at
>> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
>>      at
>> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
>>      at
>> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
>>      at
>> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
>>      at
>> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
>>      at
>> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
>>      ... 23 more
>> Caused by: org.apache.mailet.MailetException: Could not load matcher
>> (CrypMatcher);
>>    nested exception is:
>>      java.lang.ClassNotFoundException: Requested matcher not found:
>> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>> org.apache.james.mailet.crypto.matchers.
>> com.thoughtworks.imap.crypmatcher.
>>      at
>> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
>>      at
>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
>>      at
>> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
>>      ... 31 more
>> Caused by: java.lang.ClassNotFoundException: Requested matcher not found:
>> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
>> org.apache.james.mailet.crypto.matchers.
>> com.thoughtworks.imap.crypmatcher.
>>      at
>> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
>>      at
>> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
>>      ... 32 more
>> ___________*_______________
>> thanks in advance
>> ranjib
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Deploying custom mailets in James3 (Spring deployment)

Posted by Eric Charles <er...@u-mangate.com>.
Hi Ranjib,

The run.sh script located in bin directory set explicitly the classpath 
(no automatic discovery).
Can you try to add you own jar to the list and see if it works.

A nice feature would be james putting all jars in lib on the classpath 
(with jdk 1.6, simply set the directory on the classpath, otherwise a 
some bash commands must be used).

Tks,

Eric


On 05/10/2010 06:28 PM, Ranjib Dey wrote:
> Hi All,
> I am trying to migrate our james based apps form james 2.3.2 to james 3(
> which uses spring). Currently i am facing some trouble to incorporate our
> custom mailets on james3. I have placed the necessary jar files inside lib
> subdirectory, but james is  not able to pick up the classes.. although its
> showing it has searched the packages..
> following is the log
> ________________________________
> *Exception in thread "main"
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'instanceFactory' defined in class path resource
> [spring-beans.xml]: Initialization of bean failed; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'jamesCamelContext': Invocation of init method failed; nested
> exception is org.apache.commons.configuration.ConfigurationException: Unable
> to init matcher
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>      at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>      at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>      at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>      at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>      at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
>      at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
>      at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
>      at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>      at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>      at
> org.apache.james.container.spring.JamesServerApplicationContext.<init>(JamesServerApplicationContext.java:72)
>      at org.apache.james.container.spring.Main.main(Main.java:27)
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'jamesCamelContext': Invocation of init method
> failed; nested exception is
> org.apache.commons.configuration.ConfigurationException: Unable to init
> matcher
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>      at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>      at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>      at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>      at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>      at
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
>      at
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:88)
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
>      ... 12 more
> Caused by: org.apache.commons.configuration.ConfigurationException: Unable
> to init matcher
>      at
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:159)
>      at
> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:295)
>      at
> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:250)
>      at
> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:236)
>      at
> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:549)
>      at
> org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:904)
>      at
> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:359)
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
>      at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
>      ... 23 more
> Caused by: org.apache.mailet.MailetException: Could not load matcher
> (CrypMatcher);
>    nested exception is:
>      java.lang.ClassNotFoundException: Requested matcher not found:
> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
> org.apache.james.mailet.crypto.matchers. com.thoughtworks.imap.crypmatcher.
>      at
> org.apache.james.transport.AbstractLoader.loadFailed(AbstractLoader.java:146)
>      at
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:77)
>      at
> org.apache.james.transport.camel.AbstractProcessorRouteBuilder.configure(AbstractProcessorRouteBuilder.java:133)
>      ... 31 more
> Caused by: java.lang.ClassNotFoundException: Requested matcher not found:
> CrypMatcher.  Package searched:  org.apache.james.transport.matchers.
> org.apache.james.mailet.crypto.matchers. com.thoughtworks.imap.crypmatcher.
>      at
> org.apache.james.transport.AbstractLoader.classNotFound(AbstractLoader.java:133)
>      at
> org.apache.james.transport.JamesMatcherLoader.getMatcher(JamesMatcherLoader.java:73)
>      ... 32 more
> ___________*_______________
> thanks in advance
> ranjib
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org