Skip to content
This repository was archived by the owner on Apr 16, 2022. It is now read-only.
This repository was archived by the owner on Apr 16, 2022. It is now read-only.

Can not Save basic Vertex #230

@mingjinc

Description

@mingjinc

Your issue may already be reported! Please search before creating a new one.

Expected Behavior

Client is inserted to db

Current Behavior

Occur error while save
Error message as below
Exception in thread "main" java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:816)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:797)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:324)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.ibm.ca.service.architecture.Application.main(Application.java:56)
Caused by: java.lang.IllegalArgumentException: should contain id property
at org.springframework.util.Assert.isTrue(Assert.java:118)
at com.microsoft.spring.data.gremlin.conversion.result.GremlinResultVertexReader.validate(GremlinResultVertexReader.java:36)
at com.microsoft.spring.data.gremlin.conversion.result.GremlinResultVertexReader.read(GremlinResultVertexReader.java:52)
at com.microsoft.spring.data.gremlin.conversion.source.AbstractGremlinSource.doGremlinResultRead(AbstractGremlinSource.java:144)
at com.microsoft.spring.data.gremlin.query.GremlinTemplate.recoverDomain(GremlinTemplate.java:341)
at com.microsoft.spring.data.gremlin.query.GremlinTemplate.findByIdInternal(GremlinTemplate.java:231)
at com.microsoft.spring.data.gremlin.query.GremlinTemplate.findById(GremlinTemplate.java:242)
at com.microsoft.spring.data.gremlin.query.GremlinTemplate.existsById(GremlinTemplate.java:370)
at com.microsoft.spring.data.gremlin.query.GremlinTemplate.notExistsById(GremlinTemplate.java:365)
at com.microsoft.spring.data.gremlin.query.GremlinTemplate.save(GremlinTemplate.java:274)
at com.microsoft.spring.data.gremlin.repository.support.SimpleGremlinRepository.save(SimpleGremlinRepository.java:45)
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.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:359)
at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:200)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:644)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:608)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy44.save(Unknown Source)
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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy44.save(Unknown Source)
at com.ibm.ca.service.architecture.Application.run(Application.java:71)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:813)
... 5 more

Possible Solution

  • placeholder

Steps to Reproduce (for bugs)

  • step-1
  • step-2
  • ...

Snapshot Code for Reproduce

@Vertex(label = "Client")
public class Client {

    @Id
    private String id;
    
    private String _id;

    private String name;
   
    private String userId;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String get_id() {
		return _id;
	}

	public void set_id(String _id) {
		this._id = _id;
	}
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
         }
}



@SpringBootApplication
public class Application implements CommandLineRunner {

    @Autowired
    private ClientRepository repository;
    
	public static void main(String[] args) {
       
        	SpringApplication.run(Application.class, args);
      
    }

    public void run(String... var1) throws Exception {
        final Client client = new Client();
        client.setId("1211");
        client.set_id("xxxxxxxxxxxxxxxx");
        client.setName("dsfdfsadfd");
        client.setUserId("sdafsdaf");
        
        repository.save(client);
 
    }
}



## Branch
* placeholder

## Your Environment
* Version used:
* Operating System and version (desktop or mobile):
* SDK version:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions