[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715069#comment-16715069 ] ASF GitHub Bot commented on IGNITE-3935: Github user zstan closed the pull request at: https://github.com/apache/ignite/pull/3190 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda >Assignee: Denis Mekhanikov >Priority: Major > Fix For: 2.4 > > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor { > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16365699#comment-16365699 ] ASF GitHub Bot commented on IGNITE-3935: Github user 1vanan closed the pull request at: https://github.com/apache/ignite/pull/2220 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda >Assignee: Denis Mekhanikov >Priority: Major > Fix For: 2.4 > > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16330242#comment-16330242 ] ASF GitHub Bot commented on IGNITE-3935: Github user asfgit closed the pull request at: https://github.com/apache/ignite/pull/3378 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda >Assignee: Denis Mekhanikov >Priority: Major > Fix For: 2.4 > > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16330241#comment-16330241 ] Alexey Goncharuk commented on IGNITE-3935: -- Thanks, Denis, merged your changes to master and ignite-2.4 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda >Assignee: Denis Mekhanikov >Priority: Major > Fix For: 2.4 > > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16326289#comment-16326289 ] Denis Mekhanikov commented on IGNITE-3935: -- Fix for {{StreamTransformer.from()}} method is ready: https://github.com/apache/ignite/pull/3378 Please review. > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda >Assignee: Denis Mekhanikov >Priority: Major > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16326280#comment-16326280 ] ASF GitHub Bot commented on IGNITE-3935: GitHub user dmekhanikov opened a pull request: https://github.com/apache/ignite/pull/3378 IGNITE-3935: Fix P2P class loading for StreamTransformer.from() You can merge this pull request into a Git repository by running: $ git pull https://github.com/gridgain/apache-ignite ignite-3935-1 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/3378.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3378 commit 44bae8f97be94be40584a7500339663e25133fad Author: Denis MekhanikovDate: 2018-01-15T10:22:41Z ignite-3935 fix P2P class loading for StreamTransformer.from() commit c3d52c511169c3624aaf1ebd39c0e93022f9a242 Author: Denis Mekhanikov Date: 2018-01-15T14:14:55Z ignite-3935 add test for P2P class loading for stream transformer > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda >Assignee: Denis Mekhanikov >Priority: Major > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor { > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16326012#comment-16326012 ] Denis Mekhanikov commented on IGNITE-3935: -- {{GridPeerDeployAware}} interface solves this problem for internal types, that may contain some user classes. The problem with {{StreamTransformer}} is that the object, returned from {{StreamTransformer.from()}} doesn't implement {{GridPeerDeployAware}} interface. > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda >Assignee: Denis Mekhanikov >Priority: Major > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16285127#comment-16285127 ] Stanilovsky Evgeny commented on IGNITE-3935: tc seems ok https://ci.ignite.apache.org/viewLog.html?buildId=988186=buildResultsDiv=Ignite20Tests_IgniteBasic test mentioned in this issue are passed too. > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16279173#comment-16279173 ] ASF GitHub Bot commented on IGNITE-3935: GitHub user corney opened a pull request: https://github.com/apache/ignite/pull/3149 [IGNITE-3935] test case implemented You can merge this pull request into a Git repository by running: $ git pull https://github.com/corney/ignite IGNITE-3935-verification-for-deserialization Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/3149.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3149 commit 18a8fdde68726e222e3e95541787d890a48598e1 Author: Дмитрий КаряевDate: 2017-12-05T20:59:28Z [IGNITE-3935] test case implemented > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor { > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16173801#comment-16173801 ] ASF GitHub Bot commented on IGNITE-3935: Github user knovik closed the pull request at: https://github.com/apache/ignite/pull/2708 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16173799#comment-16173799 ] ASF GitHub Bot commented on IGNITE-3935: GitHub user knovik opened a pull request: https://github.com/apache/ignite/pull/2708 IGNITE-3935 Test on deserialization from different nodes ClassloaderSwitchSelfTest.java implements a test-case where class loaders should be switched to the peer-class-loading loader refering to IGNITE-3935 issue. You can merge this pull request into a Git repository by running: $ git pull https://github.com/knovik/ignite IGNITE-3935 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/2708.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2708 commit 107fff32693f18a73e9543bae9f496efd74cc6eb Author: koctbikDate: 2017-09-19T15:00:38Z IGNITE-3935 Testcase on class loader switching included in test suit CacheExamples commit f7cd9116aab05c0e430ef5f5cd892b4a4b0f2a9e Author: knovik Date: 2017-09-20T20:29:25Z This closes pull req > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor { > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16128895#comment-16128895 ] ASF GitHub Bot commented on IGNITE-3935: Github user red-batmen closed the pull request at: https://github.com/apache/ignite/pull/2456 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16128893#comment-16128893 ] ASF GitHub Bot commented on IGNITE-3935: GitHub user red-batmen opened a pull request: https://github.com/apache/ignite/pull/2456 Add test for https://issues.apache.org/jira/browse/IGNITE-3935 Writing test for IGNITE-3935 You can merge this pull request into a Git repository by running: $ git pull https://github.com/red-batmen/ignite IGNITE-3935 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/2456.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2456 commit 216dfb7fada63b983f2816af28ddabd297c0da22 Author: Alex BorodaDate: 2017-08-16T14:31:59Z Add test for https://issues.apache.org/jira/browse/IGNITE-3935 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor { > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16107898#comment-16107898 ] ASF GitHub Bot commented on IGNITE-3935: Github user xtern closed the pull request at: https://github.com/apache/ignite/pull/2369 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16107895#comment-16107895 ] ASF GitHub Bot commented on IGNITE-3935: GitHub user xtern opened a pull request: https://github.com/apache/ignite/pull/2369 IGNITE-3935 test You can merge this pull request into a Git repository by running: $ git pull https://github.com/xtern/ignite test/ignite-3935 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/2369.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2369 commit 9aa2f6dcc6ee478c284b8b48d3a828bb9e473b85 Author: Pereslegin PavelDate: 2017-07-31T20:14:21Z IGNITE-3935 test > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor { > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16070384#comment-16070384 ] ASF GitHub Bot commented on IGNITE-3935: GitHub user Grigory2000 opened a pull request: https://github.com/apache/ignite/pull/2221 IGNITE-3935 Added test for Ignite-3935 issue. You can merge this pull request into a Git repository by running: $ git pull https://github.com/Grigory2000/ignite Ignite-3935 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/2221.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2221 commit 66ede2de4fafbc9ae63abaac8623d4fb89f267f9 Author: GrigoryDate: 2017-06-30T14:32:13Z StreamingExample for reproducing the issue added commit 7e06da526adb96bf09a094107118041654ca6ed7 Author: Grigory Date: 2017-06-30T16:26:11Z Added self test/testsuite according to other tests > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor { > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16068875#comment-16068875 ] ASF GitHub Bot commented on IGNITE-3935: GitHub user 1vanan opened a pull request: https://github.com/apache/ignite/pull/2220 Ignite 3935 Issue https://issues.apache.org/jira/browse/IGNITE-3935 You can merge this pull request into a Git repository by running: $ git pull https://github.com/1vanan/ignite ignite-3935 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/2220.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2220 commit 0c0ebb844de5f392e10522d1f6abe70b82dcfb04 Author: ivananDate: 2017-06-29T19:31:16Z initial commit commit dab3fc1a702ec125b1a26dfc5c1a155cd245ed60 Author: ivanan Date: 2017-06-29T19:51:27Z StreamingExample & StreamingExampleSelfTest was added > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor { > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16063124#comment-16063124 ] ASF GitHub Bot commented on IGNITE-3935: GitHub user onishkov opened a pull request: https://github.com/apache/ignite/pull/2195 Add unit-test for https://issues.apache.org/jira/browse/IGNITE-3935 Added unit-test corresponding to the problem https://issues.apache.org/jira/browse/IGNITE-3935 (ClassLoaders are not switched during object deserialization) You can merge this pull request into a Git repository by running: $ git pull https://github.com/onishkov/ignite ignite-3935 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/2195.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2195 commit 8522a4b7dd45b1de69de38ad6e0cc93475aba8c5 Author: onishkovDate: 2017-06-26T14:01:27Z Add unit-test for https://issues.apache.org/jira/browse/IGNITE-3935 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor { > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-3935) ClassLoaders are not switched during object deserialization
[ https://issues.apache.org/jira/browse/IGNITE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15505836#comment-15505836 ] Denis Magda commented on IGNITE-3935: - The issue was reported from a StackOverflow discussion http://stackoverflow.com/questions/39539835/apache-ignite-serialization-error-related-to-data-streaming/39547964?noredirect=1#comment66427481_39547964 > ClassLoaders are not switched during object deserialization > --- > > Key: IGNITE-3935 > URL: https://issues.apache.org/jira/browse/IGNITE-3935 > Project: Ignite > Issue Type: Bug > Components: binary >Affects Versions: 1.6 >Reporter: Denis Magda > > If an object is being deserialized with ClassLoader A then this ClassLoader A > will be used for the deserialization of the whole object's state, i.e., > including all its fields that can be custom objects loaded by ClassLoader B. > In a basic scenario we can have an object of some Ignite class that is > presented in the classpath. That Ignite class may enclose an object that is > loaded by peer-class-loading class loader. The deserialization will fail > because Ignite won't switch to the peer-class-loading loader when it's needed. > To reproduce the issue do the following: > 1. Start a remote ignite node using {{./ignite.sh > ../examples/config/example-ignite.xml}} > 2. Run the code below > {code} > public class StreamingExample {` > public static class StreamingExampleCacheEntryProcessor implements > CacheEntryProcessor{ > @Override > public Object process(MutableEntry e, Object... arg) throws > EntryProcessorException { > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(StreamTransformer.from(new > StreamingExampleCacheEntryProcessor())); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > {code} > However if to modify this code to the following everything will work fine > {code} > public class StreamingExample { > public static class StreamingExampleCacheEntryProcessor extends > StreamTransformer { > @Override > public Object process(MutableEntry e, Object... arg) > throws EntryProcessorException { > System.out.println("Executed!"); > Long val = e.getValue(); > e.setValue(val == null ? 1L : val + 1); > return null; > } > } > public static void main(String[] args) throws IgniteException, > IOException { > Ignition.setClientMode(true); > try (Ignite ignite = > Ignition.start("examples/config/example-ignite.xml")) { > IgniteCache stmCache = > ignite.getOrCreateCache("mycache"); > try (IgniteDataStreamer stmr = > ignite.dataStreamer(stmCache.getName())) { > stmr.allowOverwrite(true); > stmr.receiver(new StreamingExampleCacheEntryProcessor()); > stmr.addData("word", 1L); > System.out.println("Finished"); > } > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)