You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tereza Nedelescu <tn...@tagged.com> on 2011/08/17 04:17:20 UTC

nagiosSettings: cannot set encryption

Hi,

I am trying to send information to nagios, and for that I need to specify
the encryption. I use the following code :

<bean id="nagSetting" class="com.googlecode.jsendnsca.NagiosSettings" >
  	 * <property name="encryptor"
value="com.googlecode.jsendnsca.encryption.Encryption.TRIPLE_DES"/>*
  	  <property name="password" value="secret" />
  </bean>

Using the bean: 

<camel:route>
         <camel:from uri="file:path/input?noop=true" />
         <camel:convertBodyTo type="java.lang.String"/>
         <camel:to uri="nagios://nagHost:5667?nagiosSettings=nagSettings" />
</camel:route>

I am getting the following error, so it cannot convert String to Encryptor :

 /nested exception is
org.springframework.beans.ConversionNotSupportedException: Failed to convert
property value of type 'java.lang.String' to required type
'com.googlecode.jsendnsca.encryption.Encryptor' for property 'encryptor';
nested exception is java.lang.IllegalStateException: Cannot convert value of
type [java.lang.String] to required type
[com.googlecode.jsendnsca.encryption.Encryptor] for property 'encryptor': no
matching editors or conversion strategy found/

I think there is something wrong with the line I bolded. Spring should be
doing an automatic cast, but it's not working in this case. Could you help
me figure out why or provide me with another way to set the encryption type
for nagios ?


Thank you,
Tereza




                      

--
View this message in context: http://camel.465427.n5.nabble.com/nagiosSettings-cannot-set-encryption-tp4706513p4706513.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: nagiosSettings: cannot set encryption

Posted by Tereza Nedelescu <tn...@tagged.com>.
Thanks, I tried that, but now I see that the error is at the bean level. It
cannot create the "nagSettings" bean. I commented out the route to Nagios,
and I left only the bean definition. Unfortunately, the error was still
there: 

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'nagSetting' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested
exception is org.springframework.beans.ConversionNotSupportedException:
Failed to convert property value of type 'java.lang.String' to required type
'com.googlecode.jsendnsca.encryption.Encryptor' for property 'encryptor';
nested exception is java.lang.IllegalStateException: Cannot convert value of
type [java.lang.String] to required type
[com.googlecode.jsendnsca.encryption.Encryptor] for property 'encryptor': no
matching editors or conversion strategy found


--
View this message in context: http://camel.465427.n5.nabble.com/nagiosSettings-cannot-set-encryption-tp4706513p4709203.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: nagiosSettings: cannot set encryption

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Aug 17, 2011 at 4:17 AM, Tereza Nedelescu <tn...@tagged.com> wrote:
> Hi,
>
> I am trying to send information to nagios, and for that I need to specify
> the encryption. I use the following code :
>
> <bean id="nagSetting" class="com.googlecode.jsendnsca.NagiosSettings" >
>         * <property name="encryptor"
> value="com.googlecode.jsendnsca.encryption.Encryption.TRIPLE_DES"/>*
>          <property name="password" value="secret" />
>  </bean>
>
> Using the bean:
>
> <camel:route>
>         <camel:from uri="file:path/input?noop=true" />
>         <camel:convertBodyTo type="java.lang.String"/>
>         <camel:to uri="nagios://nagHost:5667?nagiosSettings=nagSettings" />
> </camel:route>
>
> I am getting the following error, so it cannot convert String to Encryptor :
>
>  /nested exception is
> org.springframework.beans.ConversionNotSupportedException: Failed to convert
> property value of type 'java.lang.String' to required type
> 'com.googlecode.jsendnsca.encryption.Encryptor' for property 'encryptor';
> nested exception is java.lang.IllegalStateException: Cannot convert value of
> type [java.lang.String] to required type
> [com.googlecode.jsendnsca.encryption.Encryptor] for property 'encryptor': no
> matching editors or conversion strategy found/
>
> I think there is something wrong with the line I bolded. Spring should be
> doing an automatic cast, but it's not working in this case. Could you help
> me figure out why or provide me with another way to set the encryption type
> for nagios ?
>

Try with # to indicate a reference lookup
   <camel:to uri="nagios://nagHost:5667?nagiosSettings=#nagSettings" />

>
> Thank you,
> Tereza
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/nagiosSettings-cannot-set-encryption-tp4706513p4706513.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: nagiosSettings: cannot set encryption

Posted by Tereza Nedelescu <tn...@tagged.com>.
I solved the error above with the following code :
  <bean id="TripleDES"
class="com.googlecode.jsendnsca.encryption.TripleDESEncryptor" />
  
  <bean id="nagSettings"
class="com.googlecode.jsendnsca.core.NagiosSettings" >
          <property name="encryptor" ref="TripleDES" /> 
          <property name="password" value="secret" />
  </bean>

--
View this message in context: http://camel.465427.n5.nabble.com/nagiosSettings-cannot-set-encryption-tp4706513p4710134.html
Sent from the Camel - Users mailing list archive at Nabble.com.