I am trrying to configure cache on wildfly 18 - However am facing issue which i assume its regarding the dependencies version or removed method in jgroups along with infinispan modules.
Error
Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
And also
Caused by: java.lang.NoSuchMethodError: org.jgroups.JChannel.<init>(Ljava/net/URL;)V
WildFly 18.0.1 has the following included Infinispan jars:
./modules/system/layers/base/org/infinispan/commons/main/infinispan-commons-9.4.16.Final.jar
./modules/system/layers/base/org/infinispan/main/infinispan-core-9.4.16.Final.jar
Also for JGroups has:
./modules/system/layers/base/org/jgroups/main/jgroups-4.1.4.Final.jar
It seems Infinispan 9.4.16 is dependent on a different version of JGroups:
<version.jgroups>4.0.20.Final</version.jgroups>
See the link https://github.com/infinispan/infinispan/blob/9.4.16.Final/build-configuration/pom.xml#L180
As a results when i try to start the server i get below errors
2020-03-29 18:38:25,808 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 80) MSC000001: Failed to start service jboss.deployment.unit."-frontend-war.war".component.CacheContainerBean.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."-frontend-war.war".component.CacheContainerBean.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)
at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)
at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:127)
at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:141)
at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
... 8 more
Caused by: javax.ejb.EJBException: org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:246)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:388)
at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:68)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.ejb3.component.singleton.StartupCountDownInterceptor.processInvocation(StartupCountDownInterceptor.java:25)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
... 13 more
Caused by: org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
at org.infinispan.manager.DefaultCacheManager.internalStart(DefaultCacheManager.java:712)
at org.infinispan.manager.DefaultCacheManager.start(DefaultCacheManager.java:677)
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:269)
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:227)
at xa.comp.util.CacheContainerBean.container(CacheContainerBean.java:50)
at xa.comp.util.CacheContainerBean.generateCache(CacheContainerBean.java:93)
at xa.comp.util.CacheContainerBean.init(CacheContainerBean.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:79)
at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:126)
at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:112)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:81)
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:89)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:111)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:237)
... 28 more
Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
at org.infinispan.commons.util.SecurityActions.lambda$invokeAccessibly$0(SecurityActions.java:83)
at org.infinispan.commons.util.SecurityActions.doPrivileged(SecurityActions.java:71)
at org.infinispan.commons.util.SecurityActions.invokeAccessibly(SecurityActions.java:76)
at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:181)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:534)
at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:723)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:565)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:520)
at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:723)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:576)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:520)
at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:723)
at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:428)
at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:325)
at org.infinispan.manager.DefaultCacheManager.internalStart(DefaultCacheManager.java:709)
... 60 more
Caused by: java.lang.NoSuchMethodError: org.jgroups.JChannel.<init>(Ljava/net/URL;)V
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.buildChannel(JGroupsTransport.java:590)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.initChannel(JGroupsTransport.java:403)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.start(JGroupsTransport.java:387)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.infinispan.commons.util.SecurityActions.lambda$invokeAccessibly$0(SecurityActions.java:79)
... 74 more
2020-03-29 18:38:25,852 ERROR [org.jboss.as.controller.management-operation] (main) WFLYCTL0013: Operation ("add") failed - address: (("deployment" => "-frontend-war.war")) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"-frontend-war.war\".component.CacheContainerBean.START" => "java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: javax.ejb.EJBException: org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
Caused by: org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
Caused by: java.lang.NoSuchMethodError: org.jgroups.JChannel.<init>(Ljava/net/URL;)V"}}
2020-03-29 18:38:25,853 ERROR [org.jboss.as.server] (main) WFLYSRV0021: Deploy of deployment "-frontend-war.war" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"-frontend-war.war\".component.CacheContainerBean.START" => "java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: javax.ejb.EJBException: org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
Caused by: org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type JGroupsTransport
Caused by: java.lang.NoSuchMethodError: org.jgroups.JChannel.<init>(Ljava/net/URL;)V"}}
I encountered the same issue while upgrading from wildfly 10 to wildfly 18 ; I use xml configuration files for infinispan and jgroups.
If you don't need a custom jgroups.xml file, juste use the default-jgroups-udp.xml, located in infinispan-core-9.4.16.Final.jar/default-configs.
By looking to infinispan and jgroups source code, I found a way to avoid invoking the missing method.
I set up the following workaround :
import com.google.common.io.ByteSource;
import org.apache.deltaspike.core.api.config.ConfigProperty;
import org.infinispan.commons.util.FileLookupFactory;
import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
import org.infinispan.configuration.parsing.ParserRegistry;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.cache.CacheManager;
import javax.cache.Caching;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.nio.charset.StandardCharsets;
#ApplicationScoped
public class IspnCacheManagerProducer {
private String configurationFile = "/path/to/file/cache.xml";
private String jgroupsConfigurationFile = "/path/to/file/jgroups.xml";
private EmbeddedCacheManager cacheManager;
#PostConstruct
private void init() {
try {
InputStream is;
is = new FileInputStream(new File(jgroupsConfigurationFile));
ByteSource byteSource = new ByteSource() {
#Override
public InputStream openStream() {
return is;
}
};
String text = byteSource.asCharSource(StandardCharsets.UTF_8).read();
is.close();
InputStream configurationStream = FileLookupFactory.newInstance().lookupFileStrict(configurationFile, Thread.currentThread().getContextClassLoader());
ConfigurationBuilderHolder holder = new ParserRegistry().parse(configurationStream);
holder.getGlobalConfigurationBuilder().transport().addProperty(JGroupsTransport.CONFIGURATION_STRING, text);
holder.getGlobalConfigurationBuilder().transport().removeProperty(JGroupsTransport.CONFIGURATION_FILE);
cacheManager = new DefaultCacheManager(holder, true);
configurationStream.close();
} catch(IOException e) {
throw new RuntimeException("Exception occured during cache manager initialization", e);
}
}
}
If you use it with custom jgroups file, you will also have to remove the < jgroups > tags in the cache.xml file.
With wildfly10 / infinispan 8, my code was as following. My jgroups.xml file was addressed in the config.xml file.
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import java.io.IOException;
#ApplicationScoped
public class IspnCacheManagerProducer {
private String configurationFile = "/path/to/file/cache.xml";
private EmbeddedCacheManager cacheManager;
#PostConstruct
private void init() {
try {
cacheManager = new DefaultCacheManager(configurationFile);
} catch(IOException e) {
throw new RuntimeException("Exception occured during cache manager initialization", e);
}
}
}
Related
I have created a tasklet to download a file at SFTP server using Spring-Integration-Batch. While running the batch, it seems remote directory is not setting correctly in AbstractInboundFileSynchronizer because of which program is trying to synchronize null with local directory.
When I tried calling afterPropertiesSet() of AbstractInboundFileSynchronizer just before synchronizeToLocalDirectory(), then it downloaded the files with warning as "No beanFactory".
Below is the tasklet I am running:
public class FtpFileDownloadTasklet implements Tasklet {
#Value("${ftp.source.directory}")
private String remoteDirectory;
#Value("${ftp.dest.directory}")
private String localDirectory;
#Value("${ftp.source.file.extn}")
private String sourceFileExtn;
#Autowired
private SessionFactory<LsEntry> sftpSessionFactory;
private SftpInboundFileSynchronizer fileSynchronizer;
#Override
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
if (sftpSessionFactory.getSession().isOpen()) {
fileSynchronizer = new SftpInboundFileSynchronizer(sftpSessionFactory);
fileSynchronizer.setDeleteRemoteFiles(false);
fileSynchronizer.setFilter(new SftpSimplePatternFileListFilter("*" + sourceFileExtn));
fileSynchronizer.setRemoteDirectory(remoteDirectory);
fileSynchronizer.synchronizeToLocalDirectory(new File(localDirectory));
}
return RepeatStatus.FINISHED;
}
}
My Session factory:
#Bean
public SessionFactory<LsEntry> sftpSessionFactory() {
DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory();
factory.setHost(host);
factory.setPort(port);
factory.setUser(username);
factory.setPassword(password);
factory.setAllowUnknownKeys(true);
return new CachingSessionFactory<LsEntry>(factory);
}
But, without a call to afterPropertiesSet(), I am getting below error:
org.springframework.messaging.MessagingException: Problem occurred while synchronizing 'null' to local directory; nested exception is org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is org.springframework.core.NestedIOException: Failed to list files; nested exception is 4:
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:315) ~[spring-integration-file-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:293) ~[spring-integration-file-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at com.ftp.demo.tasklet.FtpFileDownloadTasklet.execute(FtpFileDownloadTasklet.java:52) ~[classes/:na]
at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:407) ~[spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:331) ~[spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:273) ~[spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82) ~[spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375) ~[spring-batch-infrastructure-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215) ~[spring-batch-infrastructure-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145) ~[spring-batch-infrastructure-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:258) ~[spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:203) ~[spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148) [spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:399) [spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:135) [spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:313) [spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:144) [spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) [spring-core-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:137) [spring-batch-core-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at com.ftp.demo.main.SpringBatchIntegrationftpDemoApplication.main(SpringBatchIntegrationftpDemoApplication.java:44) [classes/:na]
Caused by: org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is org.springframework.core.NestedIOException: Failed to list files; nested exception is 4:
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:446) ~[spring-integration-file-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:308) ~[spring-integration-file-5.1.4.RELEASE.jar:5.1.4.RELEASE]
... 20 common frames omitted
Caused by: org.springframework.core.NestedIOException: Failed to list files; nested exception is 4:
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:103) ~[spring-integration-sftp-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:50) ~[spring-integration-sftp-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.integration.file.remote.session.CachingSessionFactory$CachedSession.list(CachingSessionFactory.java:230) ~[spring-integration-file-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.transferFilesFromRemoteToLocal(AbstractInboundFileSynchronizer.java:323) ~[spring-integration-file-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.lambda$synchronizeToLocalDirectory$0(AbstractInboundFileSynchronizer.java:309) ~[spring-integration-file-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:437) ~[spring-integration-file-5.1.4.RELEASE.jar:5.1.4.RELEASE]
... 21 common frames omitted
Caused by: com.jcraft.jsch.SftpException:
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1747) ~[jsch-0.1.55.jar:na]
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1553) ~[jsch-0.1.55.jar:na]
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:91) ~[spring-integration-sftp-5.1.4.RELEASE.jar:5.1.4.RELEASE]
... 26 common frames omitted
Caused by: java.lang.NullPointerException: null
at com.jcraft.jsch.ChannelSftp.remoteAbsolutePath(ChannelSftp.java:2943) ~[jsch-0.1.55.jar:na]
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1572) ~[jsch-0.1.55.jar:na]
... 28 common frames omitted
In the execute method instead of
fileSynchronizer.synchronizeToLocalDirectory(new File(localDirectory));
}
Use
fileSynchronizer.setFilter(
new SftpPersistentAcceptOnceFileListFilter(new SimpleMetadataStore(), "rotate")
);
It will sync your local directory with a remote file.
Below is the code for my attempt to run aggregates on hazelcast using Hazelcast Client. The first aggregate works out just fine, but the 2nd one throws an java.io.NotSerializableException: co.near.hazelcast.AggregateExperiment
My code:
public class AggregateExperiment {
public void runTest(){
ClientConfig clientConfig = new ClientConfig();
clientConfig.addAddress("127.0.0.1:5701");
clientConfig.setClassLoader(this.getClass().getClassLoader());
HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
IMap<String, Integer> map = client.getMap("customers");
Supplier<String, Integer, Integer> supplier = Supplier.all();
// Choose the average aggregation
Aggregation<String, Integer, Integer> aggregation = Aggregations.integerAvg();
int average = map.aggregate(supplier, aggregation);
System.out.println("Average of inputs = "+average);
supplier = Supplier.fromKeyPredicate(new MyKeyPredicate());
// Choose the sum aggregation
aggregation = Aggregations.integerSum();
average = map.aggregate(supplier, aggregation );
System.out.println("Average of inputs = "+average);
}
public class MyKeyPredicate implements KeyPredicate<String> {
public boolean evaluate(String key) {
return Integer.parseInt(key) % 4 == 0;
}
}
}
Error messages :
Average of inputs = 1
[WARNING]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.hazelcast.core.HazelcastException: java.util.concurrent.ExecutionException: com.hazelcast.nio.serialization.HazelcastSerializationException: java.io.NotSerializableException: co.near.hazelcast.AggregateExperiment
at com.hazelcast.client.proxy.ClientMapProxy.aggregate(ClientMapProxy.java:988)
at com.hazelcast.client.proxy.ClientMapProxy.aggregate(ClientMapProxy.java:960)
at co.near.hazelcast.AggregateExperiment.runTest(AggregateExperiment.java:31)
at co.near.hazelcast.MainExperiment.main(MainExperiment.java:131)
... 6 more
Caused by: java.util.concurrent.ExecutionException: com.hazelcast.nio.serialization.HazelcastSerializationException: java.io.NotSerializableException: co.near.hazelcast.AggregateExperiment
at com.hazelcast.client.spi.impl.ClientInvocationFuture.resolveException(ClientInvocationFuture.java:188)
at com.hazelcast.client.spi.impl.ClientInvocationFuture.resolveResponse(ClientInvocationFuture.java:160)
at com.hazelcast.client.spi.impl.ClientInvocationFuture.access$000(ClientInvocationFuture.java:41)
at com.hazelcast.client.spi.impl.ClientInvocationFuture$1.run(ClientInvocationFuture.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)
Caused by: com.hazelcast.nio.serialization.HazelcastSerializationException: java.io.NotSerializableException: co.near.hazelcast.AggregateExperiment
at com.hazelcast.nio.serialization.SerializationServiceImpl.handleException(SerializationServiceImpl.java:380)
at com.hazelcast.nio.serialization.SerializationServiceImpl.writeObject(SerializationServiceImpl.java:307)
at com.hazelcast.nio.serialization.ByteArrayObjectDataOutput.writeObject(ByteArrayObjectDataOutput.java:315)
at com.hazelcast.mapreduce.aggregation.impl.KeyPredicateSupplier.writeData(KeyPredicateSupplier.java:79)
at com.hazelcast.nio.serialization.DataSerializer.write(DataSerializer.java:140)
at com.hazelcast.nio.serialization.DataSerializer.write(DataSerializer.java:39)
at com.hazelcast.nio.serialization.StreamSerializerAdapter.write(StreamSerializerAdapter.java:37)
at com.hazelcast.nio.serialization.SerializationServiceImpl.writeObject(SerializationServiceImpl.java:305)
at com.hazelcast.nio.serialization.ByteArrayObjectDataOutput.writeObject(ByteArrayObjectDataOutput.java:315)
at com.hazelcast.mapreduce.aggregation.impl.SupplierConsumingMapper.writeData(SupplierConsumingMapper.java:75)
at com.hazelcast.nio.serialization.DataSerializer.write(DataSerializer.java:140)
at com.hazelcast.nio.serialization.DataSerializer.write(DataSerializer.java:39)
at com.hazelcast.nio.serialization.StreamSerializerAdapter.write(StreamSerializerAdapter.java:37)
at com.hazelcast.nio.serialization.SerializationServiceImpl.writeObject(SerializationServiceImpl.java:305)
at com.hazelcast.nio.serialization.ByteArrayObjectDataOutput.writeObject(ByteArrayObjectDataOutput.java:315)
at com.hazelcast.mapreduce.impl.client.ClientMapReduceRequest.writeData(ClientMapReduceRequest.java:204)
at com.hazelcast.mapreduce.impl.client.ClientMapReduceRequest.write(ClientMapReduceRequest.java:173)
at com.hazelcast.client.impl.client.ClientRequest.writePortable(ClientRequest.java:86)
at com.hazelcast.nio.serialization.PortableSerializer.writeInternal(PortableSerializer.java:62)
at com.hazelcast.nio.serialization.PortableSerializer.write(PortableSerializer.java:53)
at com.hazelcast.nio.serialization.PortableSerializer.write(PortableSerializer.java:29)
at com.hazelcast.nio.serialization.StreamSerializerAdapter.write(StreamSerializerAdapter.java:37)
at com.hazelcast.nio.serialization.SerializationServiceImpl.toData(SerializationServiceImpl.java:227)
at com.hazelcast.nio.serialization.SerializationServiceImpl.toData(SerializationServiceImpl.java:207)
at com.hazelcast.client.spi.impl.ClientInvocationServiceSupport.send(ClientInvocationServiceSupport.java:104)
at com.hazelcast.client.spi.impl.ClientSmartInvocationServiceImpl.invokeOnRandomTarget(ClientSmartInvocationServiceImpl.java:60)
at com.hazelcast.client.spi.impl.ClientInvocation.invokeOnSelection(ClientInvocation.java:163)
at com.hazelcast.client.spi.impl.ClientInvocation.invoke(ClientInvocation.java:147)
at com.hazelcast.client.proxy.ClientMapReduceProxy$ClientJob.invoke(ClientMapReduceProxy.java:124)
at com.hazelcast.mapreduce.impl.AbstractJob.submit(AbstractJob.java:119)
at com.hazelcast.mapreduce.impl.AbstractJob$ReducingSubmittableJobImpl.submit(AbstractJob.java:348)
at com.hazelcast.client.proxy.ClientMapProxy.aggregate(ClientMapProxy.java:985)
at com.hazelcast.client.proxy.ClientMapProxy.aggregate(ClientMapProxy.java:960)
at co.near.hazelcast.AggregateExperiment.runTest(AggregateExperiment.java:31)
at co.near.hazelcast.MainExperiment.main(MainExperiment.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
at java.lang.Thread.run(Thread.java:745)
at ------ End remote and begin local stack-trace ------.(Unknown Source)
at com.hazelcast.client.spi.impl.ClientInvocationFuture.resolveException(ClientInvocationFuture.java:175)
... 8 more
Caused by: java.io.NotSerializableException: co.near.hazelcast.AggregateExperiment
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at com.hazelcast.nio.serialization.DefaultSerializers$ObjectSerializer.write(DefaultSerializers.java:223)
at com.hazelcast.nio.serialization.StreamSerializerAdapter.write(StreamSerializerAdapter.java:37)
at com.hazelcast.nio.serialization.SerializationServiceImpl.writeObject(SerializationServiceImpl.java:305)
at com.hazelcast.nio.serialization.ByteArrayObjectDataOutput.writeObject(ByteArrayObjectDataOutput.java:315)
at com.hazelcast.mapreduce.aggregation.impl.KeyPredicateSupplier.writeData(KeyPredicateSupplier.java:79)
at com.hazelcast.nio.serialization.DataSerializer.write(DataSerializer.java:140)
at com.hazelcast.nio.serialization.DataSerializer.write(DataSerializer.java:39)
at com.hazelcast.nio.serialization.StreamSerializerAdapter.write(StreamSerializerAdapter.java:37)
at com.hazelcast.nio.serialization.SerializationServiceImpl.writeObject(SerializationServiceImpl.java:305)
at com.hazelcast.nio.serialization.ByteArrayObjectDataOutput.writeObject(ByteArrayObjectDataOutput.java:315)
at com.hazelcast.mapreduce.aggregation.impl.SupplierConsumingMapper.writeData(SupplierConsumingMapper.java:75)
at com.hazelcast.nio.serialization.DataSerializer.write(DataSerializer.java:140)
at com.hazelcast.nio.serialization.DataSerializer.write(DataSerializer.java:39)
at com.hazelcast.nio.serialization.StreamSerializerAdapter.write(StreamSerializerAdapter.java:37)
at com.hazelcast.nio.serialization.SerializationServiceImpl.writeObject(SerializationServiceImpl.java:305)
at com.hazelcast.nio.serialization.ByteArrayObjectDataOutput.writeObject(ByteArrayObjectDataOutput.java:315)
at com.hazelcast.mapreduce.impl.client.ClientMapReduceRequest.writeData(ClientMapReduceRequest.java:204)
at com.hazelcast.mapreduce.impl.client.ClientMapReduceRequest.write(ClientMapReduceRequest.java:173)
at com.hazelcast.client.impl.client.ClientRequest.writePortable(ClientRequest.java:86)
at com.hazelcast.nio.serialization.PortableSerializer.writeInternal(PortableSerializer.java:62)
at com.hazelcast.nio.serialization.PortableSerializer.write(PortableSerializer.java:53)
at com.hazelcast.nio.serialization.PortableSerializer.write(PortableSerializer.java:29)
at com.hazelcast.nio.serialization.StreamSerializerAdapter.write(StreamSerializerAdapter.java:37)
at com.hazelcast.nio.serialization.SerializationServiceImpl.toData(SerializationServiceImpl.java:227)
at com.hazelcast.nio.serialization.SerializationServiceImpl.toData(SerializationServiceImpl.java:207)
at com.hazelcast.client.spi.impl.ClientInvocationServiceSupport.send(ClientInvocationServiceSupport.java:104)
at com.hazelcast.client.spi.impl.ClientSmartInvocationServiceImpl.invokeOnRandomTarget(ClientSmartInvocationServiceImpl.java:60)
at com.hazelcast.client.spi.impl.ClientInvocation.invokeOnSelection(ClientInvocation.java:163)
at com.hazelcast.client.spi.impl.ClientInvocation.invoke(ClientInvocation.java:147)
at com.hazelcast.client.proxy.ClientMapReduceProxy$ClientJob.invoke(ClientMapReduceProxy.java:124)
at com.hazelcast.mapreduce.impl.AbstractJob.submit(AbstractJob.java:119)
at com.hazelcast.mapreduce.impl.AbstractJob$ReducingSubmittableJobImpl.submit(AbstractJob.java:348)
at com.hazelcast.client.proxy.ClientMapProxy.aggregate(ClientMapProxy.java:985)
at com.hazelcast.client.proxy.ClientMapProxy.aggregate(ClientMapProxy.java:960)
at co.near.hazelcast.AggregateExperiment.runTest(AggregateExperiment.java:31)
at co.near.hazelcast.MainExperiment.main(MainExperiment.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
at java.lang.Thread.run(Thread.java:745)
Any help is much appreciated. Thanks
Instances of the inner class MyKeyPredicate contain an implicit reference to parent AggregateExperiment instance. This makes MyKeyPredicate not serializable. You should make MyKeyPredicate static:
public static class MyKeyPredicate implements KeyPredicate<String> {
...
Hazelcast as of now does not support distributed classloading which would be needed for the code above to work properly.
An issue is github is already opened for the same https://github.com/hazelcast/hazelcast/issues/7394
For now, those who really want to use Hazelcast in this manner can explore https://github.com/serkan-ozal/hermgen as well
I have a HiveStorageHandler if I do select * from myTable it returns all the rows in the underlying storage.
When I do something like select col1 from myTable the underlying mapreduce job throws an exception:
java.lang.RuntimeException: Error in configuring object
at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:413)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1438)
at org.apache.hadoop.mapred.Child.main(Child.java:262)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
... 9 more
Caused by: java.lang.RuntimeException: Error in configuring object
at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:34)
... 14 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
... 17 more
Caused by: java.lang.RuntimeException: Map operator initialization failed
at org.apache.hadoop.hive.ql.exec.ExecMapper.configure(ExecMapper.java:119)
... 22 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: Configuration and input path are inconsistent
at org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:526)
at org.apache.hadoop.hive.ql.exec.ExecMapper.configure(ExecMapper.java:90)
... 22 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Configuration and input path are inconsistent
at org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:520)
... 23 more
2015-02-12 15:45:51,881 INFO org.apache.hadoop.mapred.Task: Runnning cleanup for the task
If I introduce a HiveMetaHook.preCreateTable and set the location to what my input-path on hdfs is then it works. But my path changes dynamically, and I can't constantly update this property:
#Override
public void preCreateTable(Table tbl) throws MetaException {
if (tbl.getSd().getLocation() != null) {
throw new MetaException("LOCATION should be null.");
}
tbl.getSd().setLocation(*hard-coded-input-path*);
}
I did this based on the following posting.
This was happening because I was changing the the mapred.input.dir on the fly to point to a particular file on hdfs. Now, once i'm finished with own calculations, I set the mapred.input.dir back to what hive had set it to.
I have my own Split for this InputFormat. So every-time FileSplit.getPath() is invoked I return what hive expects which is the original mapred.input.dir and now everything works.
class MySplit extends org.apache.hadoop.mapred.FileSplit {
public MySplit(InputSplit actualSplit, String hiveInputPath) {
super (new Path(hiveInputPath), 0,0, (String[]) null);
this.actualSplit = actualSplit;
}
//do not override getPath that way hiveInputPath is returned
InputSplit getActualSplit() {
return actualSplit;
}
....
}
Suddenly I got this strange error right after I confirm DB evolution for my Play-Framework project:
Unexpected exception
NullPointerException: null
No source available, here is the exception stack trace:
->java.lang.NullPointerException:
com.avaje.ebean.Ebean.save(Ebean.java:533)
Global.onStart(Global.java:18)
play.core.j.JavaGlobalSettingsAdapter.onStart(JavaGlobalSettingsAdapter.scala:22)
play.api.GlobalPlugin.onStart(GlobalSettings.scala:220)
play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
scala.collection.immutable.List.foreach(List.scala:383)
play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
play.api.Play$$anonfun$start$1.apply(Play.scala:91)
play.api.Play$$anonfun$start$1.apply(Play.scala:91)
play.utils.Threads$.withContextClassLoader(Threads.scala:21)
play.api.Play$.start(Play.scala:90)
play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:157)
play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:130)
scala.Option.map(Option.scala:145)
play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:130)
play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:128)
scala.util.Success.flatMap(Try.scala:230)
play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:128)
play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:120)
scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361)
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
I don't know how to debug this error, there is nothing that points to any of my files.
Here is output I get in consoel:
! #6kekc98dk - Internal server error, for (GET) [/] ->
play.api.db.evolutions.InvalidDatabaseRevision: Database 'default' needs evolution![An SQL script need to be run on your database.]
at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1$$anonfun$apply$1.apply$mcV$sp(Evolutions.scala:510) ~[play-jdbc_2.11-2.3.6.jar:2.3.6]
at play.api.db.evolutions.EvolutionsPlugin.withLock(Evolutions.scala:531) ~[play-jdbc_2.11-2.3.6.jar:2.3.6]
at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:485) ~[play-jdbc_2.11-2.3.6.jar:2.3.6]
at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:483) ~[play-jdbc_2.11-2.3.6.jar:2.3.6]
at scala.collection.immutable.List.foreach(List.scala:383) ~[scala-library-2.11.1.jar:na]
[warn] play - Error stopping plugin
java.lang.NullPointerException: null
at play.libs.ws.ning.NingWSPlugin.onStop(NingWSPlugin.java:31) ~[play-java-ws_2.11-2.3.6.jar:2.3.6]
at play.api.Play$$anonfun$stop$1$$anonfun$apply$1$$anonfun$apply$mcV$sp$2.apply(Play.scala:108) [play_2.11-2.3.6.jar:2.3.6]
at play.api.Play$$anonfun$stop$1$$anonfun$apply$1$$anonfun$apply$mcV$sp$2.apply(Play.scala:107) [play_2.11-2.3.6.jar:2.3.6]
at scala.collection.immutable.List.foreach(List.scala:383) [scala-library-2.11.1.jar:na]
at play.api.Play$$anonfun$stop$1$$anonfun$apply$1.apply$mcV$sp(Play.scala:107) [play_2.11-2.3.6.jar:2.3.6]
[info] play - database [default] connected at jdbc:h2:mem:play
[error] application -
! #6kekd052e - Internal server error, for (GET) [/] ->
play.api.UnexpectedException: Unexpected exception[NullPointerException: null]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:166) ~[play_2.11-2.3.6.jar:2.3.6]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:130) ~[play_2.11-2.3.6.jar:2.3.6]
at scala.Option.map(Option.scala:145) ~[scala-library-2.11.1.jar:na]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:130) ~[play_2.11-2.3.6.jar:2.3.6]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:128) ~[play_2.11-2.3.6.jar:2.3.6]
Caused by: java.lang.NullPointerException: null
at com.avaje.ebean.Ebean.save(Ebean.java:533) ~[avaje-ebeanorm-3.3.4.jar:na]
at Global.onStart(Global.java:18) ~[na:na]
at play.core.j.JavaGlobalSettingsAdapter.onStart(JavaGlobalSettingsAdapter.scala:22) ~[play_2.11-2.3.6.jar:2.3.6]
at play.api.GlobalPlugin.onStart(GlobalSettings.scala:220) ~[play_2.11-2.3.6.jar:2.3.6]
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91) ~[play_2.11-2.3.6.jar:2.3.6]
Global.java :
import com.avaje.ebean.Ebean;
import models.MediumModel;
import models.MobileAppModule;
import models.LandingModule;
import play.Application;
import play.GlobalSettings;
import play.libs.Yaml;
import java.util.List;
/**
* Created by usr on 11/11/14.
*/
public class Global extends GlobalSettings{
#Override
public void onStart(Application app) {
if (MediumModel.find.findRowCount() == 0) {
Ebean.save((List) Yaml.load("initial-medium-data.yml"));
}
if (MobileAppModule.find.findRowCount() == 0) {
Ebean.save((List) Yaml.load("initial-app-data.yml"));
}
if (LandingModule.find.findRowCount() == 0) {
Ebean.save((List) Yaml.load("initial-frontend-data.yml"));
}
}
}
This line in Global.java returns null, thus exception is thrown in Ebean class:
Yaml.load("initial-medium-data.yml")
Make sure, initial-medium-data.yml is on your classpath, path to the file is correct and file itself is not empty.
I'm trying to run through this ApacheCXF Tutorial that I found at http://kevinboone.net/cxftest.html
using Intellij.
When compiling the code I keep getting.
Error:
(17, 34) java: cannot find symbol
symbol: class TestMeSoapPortImpl
location: class com.cxftest.server.TestmePort_TestMeSoapPort_Server
I have no idea why.
public class TestmePort_TestMeSoapPort_Server{
protected TestmePort_TestMeSoapPort_Server() throws java.lang.Exception {
System.out.println("Starting Server");
Object implementor = new TestMeSoapPortImpl();
String address = "http://127.0.0.1:9000/cxftest/testme";
Endpoint.publish(address, implementor);
}
public static void main(String args[]) throws java.lang.Exception {
new TestmePort_TestMeSoapPort_Server();
System.out.println("Server ready...");
Thread.sleep(5 * 60 * 1000);
System.out.println("Server exiting");
System.exit(0);
}
}
---------- Structure
A. com.cxftext.server
cxftest.wsdl
CXFTestImpl (Class)
CXFTestService (Class)
ObjectFactory (Class)
package-info.java
Server (Class)
TestMe (Class)
TestmePort (Interface)
TestmePort_TestMeSoapPort_Server (Class)
TestMeResponse (Class)
{
Starting Server
Sep 16, 2014 12:42:41 PM org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: Creating Service {http://kevinboone.net/cxftest}CXFTestService from WSDL: file: com/cxftest/server/cxftest.wsdl
Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:371)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:152)
at javax.xml.ws.Endpoint.publish(Endpoint.java:240)
at com.cxftest.server.Server.(Server.java:15)
at com.cxftest.server.Server.main(Server.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:87)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:391)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:525)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:261)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334)
... 10 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'file: com/cxftest/server/cxftest.wsdl'.: java.io.FileNotFoundException: com\cxftest\server\cxftest.wsdl (The system cannot find the path specified)
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2198)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2390)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2422)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:231)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:163)
at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:85)
... 19 more
Caused by: java.io.FileNotFoundException: com\cxftest\server\cxftest.wsdl (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:146)
at java.io.FileInputStream.(FileInputStream.java:101)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:613)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188)
... 24 more
Process finished with exit code 1
}
My goal is to perform all tasks in Intellij and become familiar with ApacheCXF using the wsdl2java tool.
Thank you