4 Replies Latest reply on Dec 4, 2013 10:52 PM by Los Morales

    Camel TypeConversionException when more than one SY app deployed

    Los Morales Newbie

      I have a working SY app that has a composite service with a SQL binding. The SQL just pulls records from a table. The records get "converted" nicely into an array of Person objects.  This all works nice and neat.  Now when I deploy another SY app on JBoss, seems like it conflicts with my current app such that I get this error: 

       

      org.apache.camel.TypeConversionException: Error during type conversion from type: java.util.ArrayList to the required type: com.petsw.test.user.Person[] with value......... due null

      ...

      ...

      Caused by: java.lang.ArrayStoreException

       

       

      Any ideas on why this would be happening?  I haven't changed anything in the original SY app.  Again It works just fine when there is no other SY application, otherwise it creates the error above.    

        • 1. Re: Camel TypeConversionException when more than one SY app deployed
          Keith Babo Master

          Which version of SY?  Are the apps communicating with one another through binding.sca or are they completely separate?  Can you attach the apps in question so we can have a look? 

          • 2. Re: Camel TypeConversionException when more than one SY app deployed
            Los Morales Newbie

            SY version 1.1.0.CR1

            JRE 1.6.0_34

             

            Completely separate apps.  The second SY is just a standard REST binding app while this app that I'm having issues with is a SQL binding app.  The SQL binding app eventually calls a REST service from the second SY app.

             

             

            Caused by: java.lang.ArrayStoreException

              at java.lang.System.arraycopy(Native Method) [rt.jar:1.6.0_34]

              at java.util.ArrayList.toArray(Unknown Source) [rt.jar:1.6.0_34]

              at org.apache.camel.impl.converter.ArrayTypeConverter.convertTo(ArrayTypeConverter.java:44) [camel-core-2.10.0.jar:2.10.0]

              at org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:289) [camel-core-2.10.0.jar:2.10.0]

              at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:111) [camel-core-2.10.0.jar:2.10.0]

              ... 44 more

            • 3. Re: Camel TypeConversionException when more than one SY app deployed
              Keith Babo Master

              That's strange, indeed.  Can you attach an example application which reproduces the issue?  Two separate apps will have two separate CamelContexts, so I wouldn't expect any collision here from a converter standpoint.

              • 4. Re: Camel TypeConversionException when more than one SY app deployed
                Los Morales Newbie

                Ok, I narrowed this issue down.

                 

                I have a standard library that contains my POJOs and I have the TypeConverter included in this library.  In my other SY app, I use the standard library and the ArrayStoreException shows up when trying to do the SQL binding.  I think that my SY app with the SQL binding doesn't "know" about the TypeConverter included in the standard library so it fails.  This is my thinking but when I included the appropriate POJO converter in the SY app itself, same issue.  Any ideas?

                 

                In my TypeConverter file in the SY app I have two converters.  I put one on each line and that didn't work.  I also listed them comma-separatedly and that didn't work either.  Can I have more than one converter in the TypeConverter file?

                 

                Update: When I moved the related converter classes from the standard library over to the SY app, I got it to work.  Problem with this is now for my other SY apps that deal with the POJOs from the standard library, I need to copy/paste the converter classes instead of keeping them in one place in the standard library where they should belong.  Any ideas on this?