Apache Ignite 2.8.0 spring services configuration null fields

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

Apache Ignite 2.8.0 spring services configuration null fields

myset
Hi,
In 2.8.0 maven version of ignite-core, I encountered one issue within spring
service configuration.
All service properties fields are null (Ex. testField1, testField2) at
runtime on TestServiceImpl - init() or execute().
In 2.7.6 version everything works well.

Ex.
...
                       
                        <bean
class="org.apache.ignite.services.ServiceConfiguration">
                            <property name="name" value="test.Service"/>
                            <property name="service">
                                <bean class="tests.TestServiceImpl">
                                    <property name="testField1" value="Field
1 value"/>
                                    <property name="testField2" value="Field
2 value"/>
                                </bean>
                            </property>
                            <property name="maxPerNodeCount" value="1"/>
                            <property name="totalCount" value="2"/>
                        </bean>                              
...


Thank you.





--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Regards
Cristian Gheorghe Florescu
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

ezhuravl
Hi,

I tried to reproduce the behaviour you described, but everything works fine
for me. Please check if I missed something:
https://github.com/ezhuravl/ignite-code-examples/tree/master/src/main/java/examples/service/parameters
https://github.com/ezhuravl/ignite-code-examples/blob/master/src/main/resources/config/service-parameters-example.xml

Evgenii

пн, 23 мар. 2020 г. в 13:54, myset <[hidden email]>:

> Hi,
> In 2.8.0 maven version of ignite-core, I encountered one issue within
> spring
> service configuration.
> All service properties fields are null (Ex. testField1, testField2) at
> runtime on TestServiceImpl - init() or execute().
> In 2.7.6 version everything works well.
>
> Ex.
> ...
>
>                         <bean
> class="org.apache.ignite.services.ServiceConfiguration">
>                             <property name="name" value="test.Service"/>
>                             <property name="service">
>                                 <bean class="tests.TestServiceImpl">
>                                     <property name="testField1"
> value="Field
> 1 value"/>
>                                     <property name="testField2"
> value="Field
> 2 value"/>
>                                 </bean>
>                             </property>
>                             <property name="maxPerNodeCount" value="1"/>
>                             <property name="totalCount" value="2"/>
>                         </bean>
> ...
>
>
> Thank you.
>
>
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

myset
Thank you for help ezhuravl,
Your proposal sample it is OK.
In my example tests.TestServiceImpl class extends another class with all the
fields (geters and seters) and work methods inside.

In 2.7.6 works in 2.8.0 @ runtime all fields are null on the same
conditions/environment (java 11.0.4).

If i put all fields and methods inside TestServiceImpl everithing works
well.

Maybe, it is a matter of inheritance and security access ?!!?

What do you think?



--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Regards
Cristian Gheorghe Florescu
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

myset
Hi everybody,
Some body encountered similar issue ?
It is a matter of serialization ?
It is possible to switch any service compatibility mode flag ?

--
Thank you



--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Regards
Cristian Gheorghe Florescu
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

Nikolay Izhikov-2
Hello.

Can you, please, clarify your issue?
Is there any stack trace of logs that can make issue more clear.
Can you, please, show us the code that is cause error?


> 28 марта 2020 г., в 21:43, myset <[hidden email]> написал(а):
>
> Hi everybody,
> Some body encountered similar issue ?
> It is a matter of serialization ?
> It is possible to switch any service compatibility mode flag ?
>
> --
> Thank you
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

myset
Thank you for answer Nikolay,
I receive various null pointer exceptions @ runtime on TestServiceImpl for
all fields extended from Test class
My class TestServiceImpl class is defined by the following pice of code

/public class TestServiceImpl extends Test implements Service, TestService/

Test - contains all my specific fields according with TestService
This scenario works well in 2.7.6 but not in 2.8.0







--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Regards
Cristian Gheorghe Florescu
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

Nikolay Izhikov-2
Hello.

Sill lack of information.

Please, send stack trace and piece of code that produce the error.

> 30 марта 2020 г., в 18:33, myset <[hidden email]> написал(а):
>
> Thank you for answer Nikolay,
> I receive various null pointer exceptions @ runtime on TestServiceImpl for
> all fields extended from Test class
> My class TestServiceImpl class is defined by the following pice of code
>
> /public class TestServiceImpl extends Test implements Service, TestService/
>
> Test - contains all my specific fields according with TestService
> This scenario works well in 2.7.6 but not in 2.8.0
>
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

myset
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Regards
Cristian Gheorghe Florescu
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

Nikolay Izhikov-2
Hello.

Sorry, I can’t see any code.

Can you create a gist and sent us link to it?

> 30 марта 2020 г., в 20:19, myset <[hidden email]> написал(а):
>
> Please see the code bellow:
>
> *Ignite service definition</u>
> ...
>
> ...
> *TestService interface*
>
>
> *Test class*
>
>
> *TestServiceImpl class*
>
>
>
> *Exceptions @ runtime with ignite 2.8.0*
>
>
>
> Thank you
>
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

myset
Stripped ...

Please check the gist with code snippets

https://gist.github.com/myset/696461e135d9c8a32588ff2a534d7eb8


Thank you Nikolay



--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Regards
Cristian Gheorghe Florescu
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

Ilya Kasnacheev
Hello!

I think it is a Spring issue, not Ignite issue. We have bumped Spring
version in 2.8.

Regards,
--
Ilya Kasnacheev


пн, 30 мар. 2020 г. в 22:56, myset <[hidden email]>:

> Stripped ...
>
> Please check the gist with code snippets
>
> https://gist.github.com/myset/696461e135d9c8a32588ff2a534d7eb8
>
>
> Thank you Nikolay
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

myset
Hi Ilya,

Only for testing purpose, I'd tried ignite-core 2.8.0 with ignite-spring
2.7.6 but results are the same, fields are null.

My environment contain spring version is 5.2.4.RELEASE
Using same environment (java 11.0.4, spring 5.2.4) all works fine in 2.7.6

Please let me know if you find something new on this.

--
Regards



-----

--
Cristian Gheorghe Florescu
--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Regards
Cristian Gheorghe Florescu
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

myset
So igniters,

There are any issue on this ?
Should I wait for further release ?



-----
--
Regards
Cristian Gheorghe Florescu
--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Regards
Cristian Gheorghe Florescu
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

daradurvs
Hi, I looked through your example and can't reproduce it.
Properties injection works fine.

I suppose that you have run Ignite out of Spring context.

Please check your Spring context configuration file once again.

Here is an example:
https://github.com/apache/ignite/blob/53e47e9191d717b3eec495e6246cd957a8d33c7d/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java



On Tue, Apr 7, 2020 at 12:13 PM myset <[hidden email]> wrote:

> So igniters,
>
> There are any issue on this ?
> Should I wait for further release ?
>
>
>
> -----
> --
> Regards
> Cristian Gheorghe Florescu
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>


--
Best Regards,
Vyacheslav D.
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

daradurvs
Sorry, wrong link in previous email.

Here is an example:
https://github.com/apache/ignite/blob/master/modules/spring/src/test/java/org/apache/ignite/spring/injection/spring-bean.xml

On Tue, Apr 21, 2020 at 8:02 PM Vyacheslav Daradur <[hidden email]>
wrote:

> Hi, I looked through your example and can't reproduce it.
> Properties injection works fine.
>
> I suppose that you have run Ignite out of Spring context.
>
> Please check your Spring context configuration file once again.
>
> Here is an example:
>
> https://github.com/apache/ignite/blob/53e47e9191d717b3eec495e6246cd957a8d33c7d/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java
>
>
>
> On Tue, Apr 7, 2020 at 12:13 PM myset <[hidden email]> wrote:
>
>> So igniters,
>>
>> There are any issue on this ?
>> Should I wait for further release ?
>>
>>
>>
>> -----
>> --
>> Regards
>> Cristian Gheorghe Florescu
>> --
>> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>>
>
>
> --
> Best Regards,
> Vyacheslav D.
>


--
Best Regards,
Vyacheslav D.
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

myset
Thank you Vyacheslav,
Still reproduced in 2.8.0 and in 2.7.6 is not.
Please take a look carefully at the gist example code.

public class TestServiceImpl extends *Test* implements Service,TestService




-----
Regards
Cristian Gheorghe Florescu
--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Regards
Cristian Gheorghe Florescu
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

daradurvs
Now I see.

Your parent class (called Test in your example) *should implement
'Serializable' interface*, this will help for your case.

We changed default marshaller for services in 2.8, because they have to
be 'Serializable' according to API. 'JdkMarshaller' is default marshaller
for services now.

I think 'BinaryMarshaller' was configured in your case, it marshals
everything even non-serializable objects :)

On Tue, Apr 21, 2020 at 8:41 PM myset <[hidden email]> wrote:

> Thank you Vyacheslav,
> Still reproduced in 2.8.0 and in 2.7.6 is not.
> Please take a look carefully at the gist example code.
>
> public class TestServiceImpl extends *Test* implements Service,TestService
>
>
>
>
> -----
> Regards
> Cristian Gheorghe Florescu
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>


--
Best Regards,
Vyacheslav D.
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 2.8.0 spring services configuration null fields

myset
Thank you Vyacheslav,

Case closed. It works fine in 2.8.0 if service extended Test class
implements Serializable.

/Keep up good work "Igniters"/



-----
Regards
Cristian Gheorghe Florescu
--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Regards
Cristian Gheorghe Florescu