arangodb / spring-data

Spring Data ArangoDB
https://www.arangodb.com/docs/stable/drivers/spring-data-getting-started.html
Apache License 2.0
110 stars 56 forks source link

Error when using VST Protocol #300

Closed bobaikato closed 3 months ago

bobaikato commented 6 months ago

I am getting a frequent Stream Close error. And I review the recommended solution here: https://github.com/arangodb/arangodb-java-driver/issues/446

But when using VST I get the following error:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arangoTemplate' defined in class path resource [com/arangodb/springframework/boot/autoconfigure/ArangoAutoConfiguration$ArangoBootConfiguration.class]: Failed to instantiate [com.arangodb.springframework.core.ArangoOperations]: Factory method 'arangoTemplate' threw exception with message: No ProtocolProvider found for protocol: VST

Caused by: com.arangodb.ArangoDBException: No ProtocolProvider found for protocol: VST
    at com.arangodb.ArangoDB$Builder.protocolProvider(ArangoDB.java:639) ~[core-7.5.1.jar:7.5.1]
    at com.arangodb.ArangoDB$Builder.build(ArangoDB.java:366) ~[core-7.5.1.jar:7.5.1]
    at com.arangodb.springframework.config.ArangoConfiguration.arangoTemplate(ArangoConfiguration.java:77) ~[arangodb-spring-data-4.1.0.jar:4.1.0]
    at com.arangodb.springframework.boot.autoconfigure.ArangoAutoConfiguration$ArangoBootConfiguration$$SpringCGLIB$$0.CGLIB$arangoTemplate$16(<generated>) ~[arangodb-spring-boot-starter-3.2-0.jar:na]
    at com.arangodb.springframework.boot.autoconfigure.ArangoAutoConfiguration$ArangoBootConfiguration$$SpringCGLIB$$FastClass$$0.invoke(<generated>) ~[arangodb-spring-boot-starter-3.2-0.jar:na]
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:258) ~[spring-core-6.1.3.jar:6.1.3]
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-6.1.3.jar:6.1.3]
    at com.arangodb.springframework.boot.autoconfigure.ArangoAutoConfiguration$ArangoBootConfiguration$$SpringCGLIB$$0.arangoTemplate(<generated>) ~[arangodb-spring-boot-starter-3.2-0.jar:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140) ~[spring-beans-6.1.3.jar:6.1.3]

But the protocol does exist in the Protocol class

/*
 * DISCLAIMER
 *
 * Copyright 2016 ArangoDB GmbH, Cologne, Germany
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Copyright holder is ArangoDB GmbH, Cologne, Germany
 */

package com.arangodb;

/**
 * @author Mark Vollmary
 */
public enum Protocol {

    /**
     * VelocyStream
     *
     * @see <a href="https://github.com/arangodb/velocystream">VelocyStream specification</a>
     */
    VST,

    /**
     * HTTP 1.1 with JSON body
     */
    HTTP_JSON,

    /**
     * HTTP 1.1 with VelocyPack body
     *
     * @see <a href="https://github.com/arangodb/velocypack">VelocyPack specification</a>
     */
    HTTP_VPACK,

    /**
     * HTTP 2 with JSON body
     */
    HTTP2_JSON,

    /**
     * HTTP 2 with VelocyPack body
     *
     * @see <a href="https://github.com/arangodb/velocypack">VelocyPack specification</a>
     */
    HTTP2_VPACK,

}
rashtao commented 6 months ago

You need to include the dependency on com.arangodb:vst-protocol, see https://docs.arangodb.com/3.11/develop/drivers/java/reference-version-7/changes-in-version-7/#modules

rashtao commented 3 months ago

Closing as clarified, please reopen in case of further questions.