I have a Spring Boot 2 application running some unit testing using Embendded Mongo (de.flapdoodle.embed.mongo).
The tests when I run locally using
/gradlew clean build
It runs normally.
However, when the same application is built on GitLab CI/CD I find the following error:
WafiraApplicationTests > contextLoads() FAILED
java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at
ConstructorResolver.java:800
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at
ConstructorResolver.java:800
Caused by: org.springframework.beans.factory.BeanCreationException at
BeanDefinitionValueResolver.java:342
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at
ConstructorResolver.java:800
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at
ConstructorResolver.java:800
Caused by: org.springframework.beans.factory.BeanCreationException at
AbstractAutowireCapableBeanFactory.java:1786
Caused by: java.io.IOException at ProcessBuilder.java:1142
Caused by: java.io.IOException at ProcessImpl.java:-2 DepositRepositoryTest > save() FAILED
java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
Caused by: org.springframework.beans.factory.BeanCreationException at
AbstractAutowireCapableBeanFactory.java:1786
Caused by: java.io.IOException at ProcessBuilder.java:1142
Caused by: java.io.IOException at ProcessImpl.java:-2 TransferRepositoryTest > save() FAILED
java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
Caused by: org.springframework.beans.factory.BeanCreationException at
AbstractAutowireCapableBeanFactory.java:1786
Caused by: java.io.IOException at ProcessBuilder.java:1142
Caused by: java.io.IOException at ProcessImpl.java:-2 ClientRepositoryTest > findByClientEmail() FAILED
This is an example of one test case below:
#DataMongoTest
public class DepositRepositoryTest {
#Autowired
private DepositRepository depositRepository;
#Test
void save(){
var deposit = DataGenerator.getDeposityEntityWithFixedValues();
depositRepository.save(deposit);
AtomicInteger atomicInteger = new AtomicInteger(0);
depositRepository.findAll().forEach(it -> atomicInteger.addAndGet(1));
assertThat(atomicInteger.get()).isEqualTo(1);
}
Any ideas?
Related
I have this error that I cannot seem to solve. I have searched everywhere, but no answers.
Here below you'll see a detailed description of the problem:
> Task :google_maps_flutter:testDebugUnitTest
io.flutter.plugins.googlemaps.CircleBuilderTest > density_AppliesToStrokeWidth PASSED
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
io.flutter.plugins.googlemaps.CircleControllerTest > controller_SetsStrokeDensity FAILED
org.mockito.exceptions.base.MockitoException at CircleControllerTest.java:20
Caused by: org.mockito.exceptions.base.MockitoException at CircleControllerTest.java:20
Caused by: java.lang.IllegalStateException at CircleControllerTest.java:20
Caused by: java.lang.IllegalArgumentException at CircleControllerTest.java:20
io.flutter.plugins.googlemaps.GoogleMapControllerTest > OnDestroyReleaseTheMap STANDARD_OUT
Downloading from maven
io.flutter.plugins.googlemaps.GoogleMapControllerTest > OnDestroyReleaseTheMap FAILED
java.lang.RuntimeException at ReflectionHelpers.java:223
Caused by: java.lang.RuntimeException at ReflectionHelpers.java:208
Caused by: java.lang.IllegalAccessException at FieldAccessorImpl.java:137
io.flutter.plugins.googlemaps.GoogleMapControllerTest > DisposeReleaseTheMap FAILED
java.lang.RuntimeException at ReflectionHelpers.java:223
Caused by: java.lang.RuntimeException at ReflectionHelpers.java:208
Caused by: java.lang.IllegalAccessException at FieldAccessorImpl.java:137
io.flutter.plugins.googlemaps.GoogleMapControllerTest > MethodCalledAfterControllerIsDestroyed FAILED
java.lang.RuntimeException at ReflectionHelpers.java:223
Caused by: java.lang.RuntimeException at ReflectionHelpers.java:208
Caused by: java.lang.IllegalAccessException at FieldAccessorImpl.java:137
io.flutter.plugins.googlemaps.GoogleMapControllerTest > InvalidateMapAfterMethodCalls FAILED
java.lang.RuntimeException at ReflectionHelpers.java:223
Caused by: java.lang.RuntimeException at ReflectionHelpers.java:208
Caused by: java.lang.IllegalAccessException at FieldAccessorImpl.java:137
io.flutter.plugins.googlemaps.GoogleMapControllerTest > InvalidateMapOnceAfterMethodCall FAILED
java.lang.RuntimeException at ReflectionHelpers.java:223
Caused by: java.lang.RuntimeException at ReflectionHelpers.java:208
Caused by: java.lang.IllegalAccessException at FieldAccessorImpl.java:137
io.flutter.plugins.googlemaps.MarkersControllerTest > controller_OnMarkerDragStart FAILED
org.mockito.exceptions.base.MockitoException at MarkersControllerTest.java:32
Caused by: org.mockito.exceptions.base.MockitoException at MarkersControllerTest.java:32
Caused by: java.lang.IllegalStateException at MarkersControllerTest.java:32
Caused by: java.lang.IllegalArgumentException at MarkersControllerTest.java:32
io.flutter.plugins.googlemaps.MarkersControllerTest > controller_OnMarkerDrag FAILED
org.mockito.exceptions.base.MockitoException at MarkersControllerTest.java:98
Caused by: org.mockito.exceptions.base.MockitoException at MarkersControllerTest.java:98
Caused by: java.lang.IllegalStateException at MarkersControllerTest.java:98
Caused by: java.lang.IllegalArgumentException at MarkersControllerTest.java:98
io.flutter.plugins.googlemaps.MarkersControllerTest > controller_OnMarkerDragEnd FAILED
org.mockito.exceptions.base.MockitoException at MarkersControllerTest.java:65
Caused by: org.mockito.exceptions.base.MockitoException at MarkersControllerTest.java:65
Caused by: java.lang.IllegalStateException at MarkersControllerTest.java:65
Caused by: java.lang.IllegalArgumentException at MarkersControllerTest.java:65
io.flutter.plugins.googlemaps.PolygonBuilderTest > density_AppliesToStrokeWidth PASSED
io.flutter.plugins.googlemaps.PolygonControllerTest > controller_SetsStrokeDensity FAILED
org.mockito.exceptions.base.MockitoException at PolygonControllerTest.java:20
Caused by: org.mockito.exceptions.base.MockitoException at PolygonControllerTest.java:20
Caused by: java.lang.IllegalStateException at PolygonControllerTest.java:20
Caused by: java.lang.IllegalArgumentException at PolygonControllerTest.java:20
io.flutter.plugins.googlemaps.PolylineBuilderTest > density_AppliesToStrokeWidth PASSED
io.flutter.plugins.googlemaps.PolylineControllerTest > controller_SetsStrokeDensity FAILED
org.mockito.exceptions.base.MockitoException at PolylineControllerTest.java:20
Caused by: org.mockito.exceptions.base.MockitoException at PolylineControllerTest.java:20
Caused by: java.lang.IllegalStateException at PolylineControllerTest.java:20
Caused by: java.lang.IllegalArgumentException at PolylineControllerTest.java:20
14 tests completed, 11 failed
I am using drools workbench 6.5.0 and trying to configure into Wildfly 10. I am gettings below error.
Cannot upload deployment: {"WFLYCTL0080: Failed services" =>
{"jboss.deployment.unit."kie-drools-wb-6.5.0.Final-wildfly10.war".WeldStartService"
=> "org.jboss.msc.service.StartException in service jboss.deployment.unit."kie-drools-wb-6.5.0.Final-wildfly10.war".WeldStartService:
Failed to start service Caused by:
org.jboss.weld.exceptions.DeploymentException: Exception List with 1
exceptions: Exception 0 : org.jboss.weld.exceptions.WeldException:
WELD-000049: Unable to invoke public void
org.kie.workbench.drools.backend.server.AppSetup.assertPlayground() on
org.kie.workbench.drools.backend.server.AppSetup#26107fd0 at
org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:100)
at
org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:81)
at
org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:126)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:171) at
org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) at
org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101)
at
org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.get(ContextualInstanceStrategy.java:141)
at
org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
at
org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125)
at
org.kie.workbench.drools.backend.server.AppSetup$Proxy$_$$WeldClientProxy.toString(Unknown
Source) at
org.uberfire.backend.server.cdi.SystemConfigProducer.runPostConstruct(SystemConfigProducer.java:162)
at
org.uberfire.backend.server.cdi.SystemConfigProducer.afterDeploymentValidation(SystemConfigProducer.java:143)
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.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
at
org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:144)
at
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:309)
at
org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:124)
at
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:287)
at
org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:265)
at
org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:271)
at
org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:260)
at
org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)
at
org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:148)
at
org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
at
org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:35)
at
org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
at
org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:450)
at
org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:96)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) Caused by:
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:498) at
org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:98)
... 37 more Caused by: java.lang.RuntimeException:
java.lang.RuntimeException: java.util.NoSuchElementException at
org.kie.workbench.drools.backend.server.AppSetup.assertPlayground(AppSetup.java:195)
... 42 more Caused by: java.lang.RuntimeException:
java.util.NoSuchElementException at
org.guvnor.structure.backend.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:283)
at
org.guvnor.structure.backend.repositories.RepositoryServiceImpl$Proxy$$$WeldClientProxy.createRepository(Unknown
Source) at
org.kie.workbench.drools.backend.server.AppSetup.createRepository(AppSetup.java:330)
at
org.kie.workbench.drools.backend.server.AppSetup.assertPlayground(AppSetup.java:119)
... 42 more Caused by: java.util.NoSuchElementException at
java.util.ArrayList$Itr.next(ArrayList.java:862) at
org.uberfire.java.nio.fs.jgit.JGitFileSystem$1$1.next(JGitFileSystem.java:194)
at
org.uberfire.java.nio.fs.jgit.JGitFileSystem$1$1.next(JGitFileSystem.java:173)
at
org.guvnor.structure.backend.repositories.git.GitRepositoryBuilder.getDefaultRoot(GitRepositoryBuilder.java:120)
at
org.guvnor.structure.backend.repositories.git.GitRepositoryBuilder.setBranches(GitRepositoryBuilder.java:98)
at
org.guvnor.structure.backend.repositories.git.GitRepositoryBuilder.build(GitRepositoryBuilder.java:63)
at
org.guvnor.structure.backend.repositories.git.GitRepositoryFactoryHelper.newRepository(GitRepositoryFactoryHelper.java:64)
at
org.guvnor.structure.backend.repositories.git.GitRepositoryFactoryHelper$Proxy$$$WeldClientProxy.newRepository(Unknown
Source) at
org.guvnor.structure.backend.repositories.RepositoryFactoryImpl.newRepository(RepositoryFactoryImpl.java:61)
at
org.guvnor.structure.backend.repositories.RepositoryFactoryImpl$Proxy$$$_WeldClientProxy.newRepository(Unknown
Source) at
org.guvnor.structure.backend.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:96)
at
org.guvnor.structure.backend.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:279)
... 45 more "}}
Machine : windows 10
Wildlfly Server : 10.0
Kie server 6.5.0 - working fine
Only problem is Drools work bench
Drools Workbench 6.5.0 is targeted Wildfly 8, see official documentation.
If you have to use Wildfly 10, please consider Drools Workbench 7.0.0
When i'm running the rules in ODM 8.8 getting the below exception. I am using the Decision engine 1.40
execution E It was not possible to create the ruleset: /MisApp/1.0/Mis/1.74.
com.ibm.rules.res.xu.internal.XUException: GBRXU0467E: The creation of EngineDefinition failed.
at com.ibm.rules.res.xu.engine.de.internal.XUEngineDynamicDefinitionFactory.createEngineDefinition(XUEngineDynamicDefinitionFactory.java:89)
at com.ibm.rules.res.xu.ruleset.internal.XURulesetFactory.createDERuleset(XURulesetFactory.java:250)
at com.ibm.rules.res.xu.ruleset.internal.XURulesetFactory.createRuleset(XURulesetFactory.java:117)
at com.ibm.rules.res.xu.ruleset.internal.RulesetParsingWork.run(RulesetParsingWork.java:89)
at com.ibm.ejs.j2c.work.WorkProxy$RunWork.run(WorkProxy.java:282)
at java.security.AccessController.doPrivileged(AccessController.java:422)
at javax.security.auth.Subject.doAs(Subject.java:494)
at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:133)
at com.ibm.ejs.j2c.work.WorkProxy$RunWork.run(WorkProxy.java:285)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:667)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Caused by: com.ibm.rules.engine.load.XUEngineDynamicLoader$CreationException: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: com.ibm.rules.generated.ruleflow.RuleflowDefinitionImpl.([Lcom.ibm.rules.engine.service.EngineService;)
at com.ibm.rules.engine.load.XUEngineDynamicLoaderImpl.loadJar(XUEngineDynamicLoaderImpl.java:213)
at com.ibm.rules.engine.load.XUEngineDynamicLoaderImpl.createEngineDefinitionFromDSAR(XUEngineDynamicLoaderImpl.java:77)
at com.ibm.rules.engine.load.XUEngineDynamicLoaderImpl.createEngineDefinition(XUEngineDynamicLoaderImpl.java:52)
at com.ibm.rules.res.xu.engine.de.internal.XUEngineDynamicDefinitionFactory.createEngineDefinition(XUEngineDynamicDefinitionFactory.java:82)
... 11 more
Caused by: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: com.ibm.rules.generated.ruleflow.RuleflowDefinitionImpl.([Lcom.ibm.rules.engine.service.EngineService;)
at java.security.AccessController.doPrivileged(AccessController.java:456)
at com.ibm.rules.engine.util.platform.JavaReflectionUtils.loadClassAndCreatesInstance(JavaReflectionUtils.java:103)
at com.ibm.rules.engine.load.NativeEngineLoader.createEngineDefinition(NativeEngineLoader.java:184)
at com.ibm.rules.engine.load.NativeEngineLoader.loadEngineFromJarStream(NativeEngineLoader.java:166)
at com.ibm.rules.engine.load.XUEngineDynamicLoaderImpl.loadJar(XUEngineDynamicLoaderImpl.java:211)
... 14 more
Caused by: java.lang.NoSuchMethodException: com.ibm.rules.generated.ruleflow.RuleflowDefinitionImpl.([Lcom.ibm.rules.engine.service.EngineService;)
at java.lang.Class.throwNoSuchMethodException(Class.java:461)
at java.lang.Class.getConstructor(Class.java:521)
at com.ibm.rules.engine.util.platform.JavaReflectionUtils$3.run(JavaReflectionUtils.java:121)
at java.security.AccessController.doPrivileged(AccessController.java:452)
... 18 more
[12/13/17 23:33:38:198 CST] 000001e4 execution E The interaction getXURulesetArchiveInformation has failed.
com.ibm.rules.res.xu.internal.XUException: GBRXU0467E: The creation of EngineDefinition failed.
at com.ibm.rules.res.xu.engine.de.internal.XUEngineDynamicDefinitionFactory.createEngineDefinition(XUEngineDynamicDefinitionFactory.java:89)
at com.ibm.rules.res.xu.ruleset.internal.XURulesetFactory.createDERuleset(XURulesetFactory.java:250)
at com.ibm.rules.res.xu.ruleset.internal.XURulesetFactory.createRuleset(XURulesetFactory.java:117)
at com.ibm.rules.res.xu.ruleset.internal.RulesetParsingWork.run(RulesetParsingWork.java:89)
at com.ibm.ejs.j2c.work.WorkProxy$RunWork.run(WorkProxy.java:282)
at java.security.AccessController.doPrivileged(AccessController.java:422)
at javax.security.auth.Subject.doAs(Subject.java:494)
at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:133)
at com.ibm.ejs.j2c.work.WorkProxy$RunWork.run(WorkProxy.java:285)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:667)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Caused by: com.ibm.rules.engine.load.XUEngineDynamicLoader$CreationException: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: com.ibm.rules.generated.ruleflow.RuleflowDefinitionImpl.([Lcom.ibm.rules.engine.service.EngineService;)
at com.ibm.rules.engine.load.XUEngineDynamicLoaderImpl.loadJar(XUEngineDynamicLoaderImpl.java:213)
at com.ibm.rules.engine.load.XUEngineDynamicLoaderImpl.createEngineDefinitionFromDSAR(XUEngineDynamicLoaderImpl.java:77)
at com.ibm.rules.engine.load.XUEngineDynamicLoaderImpl.createEngineDefinition(XUEngineDynamicLoaderImpl.java:52)
at com.ibm.rules.res.xu.engine.de.internal.XUEngineDynamicDefinitionFactory.createEngineDefinition(XUEngineDynamicDefinitionFactory.java:82)
... 11 more
Caused by: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: com.ibm.rules.generated.ruleflow.RuleflowDefinitionImpl.([Lcom.ibm.rules.engine.service.EngineService;)
I ported my Spring Data Neo4j 4 application to Spring Boot 1.5.1. At Embedded Tomcat 8.5.11 everything works fine but fails at Standalone Tomcat 8.5.11 with a following exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/example/domain/api/configuration/Neo4jConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.neo4j.ogm.session.SessionFactory]: Factory method 'sessionFactory' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
... 117 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.neo4j.ogm.session.SessionFactory]: Factory method 'sessionFactory' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 126 common frames omitted
Caused by: java.lang.NullPointerException: null
at org.neo4j.ogm.metadata.DomainInfo.registerDefaultMethodConverters(DomainInfo.java:379)
at org.neo4j.ogm.metadata.DomainInfo.postProcessMethods(DomainInfo.java:215)
at org.neo4j.ogm.metadata.DomainInfo.finish(DomainInfo.java:159)
at org.neo4j.ogm.scanner.ClassPathScanner.scan(ClassPathScanner.java:148)
at org.neo4j.ogm.metadata.DomainInfo.load(DomainInfo.java:338)
at org.neo4j.ogm.metadata.DomainInfo.<init>(DomainInfo.java:62)
at org.neo4j.ogm.MetaData.<init>(MetaData.java:48)
at org.neo4j.ogm.session.SessionFactory.<init>(SessionFactory.java:62)
at com.example.domain.api.configuration.Neo4jConfig.sessionFactory(Neo4jConfig.java:26)
at com.example.domain.api.configuration.Neo4jConfig$$EnhancerBySpringCGLIB$$59f65b77.CGLIB$sessionFactory$0(<generated>)
at com.example.domain.api.configuration.Neo4jConfig$$EnhancerBySpringCGLIB$$59f65b77$$FastClassBySpringCGLIB$$f50f6aaa.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
at com.example.domain.api.configuration.Neo4jConfig$$EnhancerBySpringCGLIB$$59f65b77.sessionFactory(<generated>)
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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 127 common frames omitted
This is my Neo4Config:
#Configuration
#EnableNeo4jRepositories(basePackages = "com.example.domain.repository")
#EnableTransactionManagement
public class Neo4jConfig {
final static Logger logger = LoggerFactory.getLogger(Neo4jConfig.class);
#Bean
public Neo4jTransactionManager transactionManager() throws Exception {
return new Neo4jTransactionManager(sessionFactory());
}
#Bean
public SessionFactory sessionFactory() {
return new SessionFactory("com.example.domain.model");
}
}
What can be a reason of this and how to solve it ?
UPDATED
Looks like this is an Eclipse incremental build issue. From console(via Maven commands) everything is working fine.
I am trying to run the example given in the official Oracle website of a RMI application.Here is my oldest post where I explain the previous problems I had Running a sample RMI application.
However, I still have this problem :
ComputeEngine exception:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: compute.Compute
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:419)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at engine.ComputeEngine.main(ComputeEngine.java:30)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: compute.Compute
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: compute.Compute
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.rmi.server.LoaderHandler$Loader.loadClass(LoaderHandler.java:1206)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at sun.rmi.server.LoaderHandler.loadClassForName(LoaderHandler.java:1219)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:729)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:673)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:610)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:255)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1556)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1512)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
... 13 more
This is the content of the ComuteEngine.java (server):
package engine;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import compute.Compute;
import compute.Task;
public class ComputeEngine implements Compute {
public ComputeEngine() {
super();
}
public <T> T executeTask(Task<T> t) {
return t.execute();
}
public static void main(String[] args) {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
}
try {
String name = "Compute";
Compute engine = new ComputeEngine();
Compute stub =
(Compute) UnicastRemoteObject.exportObject(engine, 0);
Registry registry = LocateRegistry.getRegistry();
registry.rebind(name, stub);
System.out.println("ComputeEngine bound");
} catch (Exception e) {
System.err.println("ComputeEngine exception:");
e.printStackTrace();
}
}
}
Does anyone know how to resolve that issue ?
I succeded to launch my program by adding :
LocateRegistry.createRegistry(1099);
before creating the security manager.However, launching simply the rmiregistry from my terminal didn't work. I think because of a communcation problem between the server and the rmiregistry, maybe because I have to add some classes to the classpath but I don't know how to do that properly.