[ 
https://issues.apache.org/jira/browse/FLINK-14985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16986081#comment-16986081
 ] 

Gary Yao commented on FLINK-14985:
----------------------------------

[~Rockey Cui] The attached project cannot be compiled

{noformat}
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.rockeycui.learn:flink-ehcache-test:[unknown-version] 
(/Users/gary/Downloads/flink-ehcache-test/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM: Failure to find 
com.rockeycui.learn:learn-flink:pom:1.0.0 in 
https://repo.maven.apache.org/maven2 was cached in the local repository, 
resolution will not be reattempted until the update interval of central has 
elapsed or updates are forced and 'parent.relativePath' points at wrong local 
POM @ line 5, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] 
http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
{noformat}

Furtherore, dependencies such as flink-core and flink-java should not be 
packaged into the user jar. Please have a look at the [Quickstart 
project|https://ci.apache.org/projects/flink/flink-docs-release-1.9/getting-started/tutorials/datastream_api.html#setting-up-a-maven-project]
 as a reference.

> FLNIK YARN per job with ehcache Exception
> -----------------------------------------
>
>                 Key: FLINK-14985
>                 URL: https://issues.apache.org/jira/browse/FLINK-14985
>             Project: Flink
>          Issue Type: Bug
>          Components: Deployment / YARN
>    Affects Versions: 1.9.1
>         Environment: openjdk-1.8.0.102-4.b14.el7.x86_64
> flink1.9.1
> Hadoop 3.0.0-cdh6.2.0
>            Reporter: Rockey Cui
>            Priority: Major
>         Attachments: flink-ehcache-test.zip
>
>
> I used ehcache in my project,I get the following exception when using per job 
> mode:
> ----
> java.lang.IllegalStateException: UserManagedCacheBuilder failed to 
> build.java.lang.IllegalStateException: UserManagedCacheBuilder failed to 
> build. at 
> org.ehcache.config.builders.UserManagedCacheBuilder.build(UserManagedCacheBuilder.java:182)
>  at 
> org.ehcache.config.builders.UserManagedCacheBuilder.build(UserManagedCacheBuilder.java:404)
>  at lookupabletable.cache.AllCache.init(AllCache.java:46) at 
> lookupabletable.function.AbstractTableFunction.initCache(AbstractTableFunction.java:83)
>  at 
> lookupabletable.function.AbstractTableFunction.open(AbstractTableFunction.java:65)
>  at LookupFunction$7.open(Unknown Source) at 
> org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36)
>  at 
> org.apache.flink.table.runtime.operators.join.lookup.LookupJoinRunner.open(LookupJoinRunner.java:68)
>  at 
> org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36)
>  at 
> org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)
>  at 
> org.apache.flink.streaming.api.operators.ProcessOperator.open(ProcessOperator.java:56)
>  at 
> org.apache.flink.streaming.runtime.tasks.StreamTask.openAllOperators(StreamTask.java:532)
>  at 
> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:396)
>  at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:705) at 
> org.apache.flink.runtime.taskmanager.Task.run(Task.java:530) at 
> java.lang.Thread.run(Thread.java:748)Caused by: 
> java.lang.IllegalStateException: 
> org.ehcache.core.spi.ServiceLocator$DependencyException: Failed to find 
> provider with satisfied dependency set for interface 
> org.ehcache.core.spi.store.Store$Provider [candidates 
> [org.ehcache.impl.internal.store.heap.OnHeapStoreProviderFactory@5a58dd22, 
> org.ehcache.impl.internal.store.offheap.OffHeapStoreProviderFactory@4d766540, 
> org.ehcache.impl.internal.store.disk.OffHeapDiskStoreProviderFactory@784d016d,
>  org.ehcache.impl.internal.store.tiering.TieredStoreProviderFactory@25b63026, 
> org.ehcache.impl.internal.store.loaderwriter.LoaderWriterStoreProviderFactory@776ed22b]]
>  at 
> org.ehcache.core.spi.ServiceLocator$DependencySet.build(ServiceLocator.java:350)
>  at 
> org.ehcache.config.builders.UserManagedCacheBuilder.build(UserManagedCacheBuilder.java:179)
>  ... 15 moreCaused by: 
> org.ehcache.core.spi.ServiceLocator$DependencyException: Failed to find 
> provider with satisfied dependency set for interface 
> org.ehcache.core.spi.store.Store$Provider [candidates 
> [org.ehcache.impl.internal.store.heap.OnHeapStoreProviderFactory@5a58dd22, 
> org.ehcache.impl.internal.store.offheap.OffHeapStoreProviderFactory@4d766540, 
> org.ehcache.impl.internal.store.disk.OffHeapDiskStoreProviderFactory@784d016d,
>  org.ehcache.impl.internal.store.tiering.TieredStoreProviderFactory@25b63026, 
> org.ehcache.impl.internal.store.loaderwriter.LoaderWriterStoreProviderFactory@776ed22b]]
>  at 
> org.ehcache.core.spi.ServiceLocator$DependencySet.lookupService(ServiceLocator.java:401)
>  at 
> org.ehcache.core.spi.ServiceLocator$DependencySet.build(ServiceLocator.java:322)
>  ... 16 more
> ----
> but No problem in standalone mode.
> Any help ?
>  
> My code-->
> public class AllCache extends AbstractCache<String, Row> {
>  private static final long serialVersionUID = -3639314692125067324L;
>  private PersistentUserManagedCache<String, Row> cache;
>  private String tempDir;
>  private LocalPersistenceService persistenceService;
>  public AllCache(CacheInfo cacheInfo) {
>  super(cacheInfo);
>  }
>  @Override
>  public void init() {
>  tempDir = System.getProperty("java.io.tmpdir") + File.separator
>  + cacheInfo.getCacheTmpDir() + File.separator
>  + UUID.randomUUID().toString() + File.separator
>  + Thread.currentThread().getId();
>  persistenceService = new DefaultLocalPersistenceService(
>  new DefaultPersistenceConfiguration(new File(tempDir)));
>  cache = UserManagedCacheBuilder.newUserManagedCacheBuilder(String.class, 
> Row.class)
>  .with(new UserManagedPersistenceContext<>("persistentCache", 
> persistenceService))
>  .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder()
>  .heap(cacheInfo.getCacheMaxMb(), MemoryUnit.MB)
>  .disk(10, MemoryUnit.GB, false)
>  ).build(true);
>  }
>  @Override
>  public Row get(String key) {
>  return cache.get(key);
>  }
>  @Override
>  public void put(String key, Row value) {
>  cache.put(key, value);
>  }
>  @Override
>  public void putAll(Map<String, Row> data) {
>  cache.putAll(data);
>  }
>  @Override
>  public void close() {
>  try {
>  cache.close();
>  cache.destroy();
>  persistenceService.stop();
>  } catch (Exception ignore) {
>  }
>  }
> }



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to