flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hsaputra <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-2509] Add class loader info to exceptio...
Date Wed, 12 Aug 2015 04:06:38 GMT
Github user hsaputra commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1008#discussion_r36825210
  
    --- Diff: flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/graph/StreamConfig.java
---
    @@ -198,12 +199,26 @@ public void setStreamOperator(StreamOperator<?> operator)
{
     			}
     		}
     	}
    -
    -	@SuppressWarnings({ "unchecked" })
    +	
     	public <T> T getStreamOperator(ClassLoader cl) {
     		try {
    -			return (T) InstantiationUtil.readObjectFromConfig(this.config, SERIALIZEDUDF, cl);
    -		} catch (Exception e) {
    +			@SuppressWarnings("unchecked")
    +			T result = (T) InstantiationUtil.readObjectFromConfig(this.config, SERIALIZEDUDF,
cl);
    +			return result;
    +		}
    +		catch (ClassNotFoundException e) {
    +			String classLoaderInfo = ClassLoaderUtil.getUserCodeClassLoaderInfo(cl);
    +			boolean loadableDoubleCheck = ClassLoaderUtil.validateClassLoadable(e, cl);
    +			
    +			String exceptionMessage = "Cannot load user class: " + e.getMessage()
    +					+ "\nClassLoader info: " + classLoaderInfo + 
    +					(loadableDoubleCheck ? 
    +							"Class was actually found in classloader - deserialization issue." :
    +							"Class not resolveable through given classloader.");
    --- End diff --
    
    small nit on message: Class was not resolvable


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message