Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Samples doesn't work #23

Closed
ran-vijay opened this issue Jan 27, 2015 · 4 comments
Closed

Samples doesn't work #23

ran-vijay opened this issue Jan 27, 2015 · 4 comments
Assignees

Comments

@ran-vijay
Copy link

I tried to run the samples provided i.e. spring-boot-orientdb-shiro and spring-boot-orientdb-hello, and neither of them run. As described in the README, I used 'mvn clean package spring-boot:run'. Looks like some bean-wiring problem in spring-boot.

detailed stack trace:

[WARNING]
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.springframework.boot.maven.RunMojo$LaunchRunner.run(RunMojo.java:408)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentTemplate' defined in class path resource [org/springframework/boot/autoconfigure/orient/OrientAutoConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.data.orient.document.OrientDocumentDatabaseFactory]: : No qualifying bean of type [org.springframework.data.orient.document.OrientDocumentDatabaseFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.data.orient.document.OrientDocumentDatabaseFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:464)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1111)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
at org.springframework.boot.orient.sample.shiro.Application.main(Application.java:27)
... 6 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.data.orient.document.OrientDocumentDatabaseFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1308)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1054)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 23 more

@ryangardner
Copy link

I was able to run the spring-boot-shiro-orientdb example following the instructions on its page. I did have to change the in the samples pom to match the 0.10-SNAPSHOT of the spring-data-orient that was being built, but after doing that it worked fine and I didn't have the error you have listed here.

@lucastanziano
Copy link

Following the instructions I have problems running spring-boot-orientb-hello:
Info:

Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.7.0_76\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"

[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: org.springframework.boot.samples:spring-boot-orientdb-hello:jar:0.10.0-SNAPSHOT
[DEBUG] Tasks: [clean, package, spring-boot:run]
[DEBUG] Style: Regular
[DEBUG] =======================================================================

[DEBUG] Could not find metadata org.springframework.boot:spring-boot-orientdb-autoconfigure:0.10.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\fzwhk7.m2\repository)
[DEBUG] Failure to find org.springframework.boot:spring-boot-orientdb-autoconfigure:0.10.0-SNAPSHOT/maven-metadata.xml in http://repo.spring.io/libs-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of spring-libs-snapshot has elapsed or updates are forced
[DEBUG] Could not find metadata org.springframework.boot:spring-boot-orientdb-autoconfigure:0.10.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\fzwhk7.m2\repository)
[DEBUG] Failure to find org.springframework.boot:spring-boot-orientdb-autoconfigure:0.10.0-SNAPSHOT/maven-metadata.xml in http://repo.spring.io/libs-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of spring-libs-snapshot has elapsed or updates are forced
[WARNING] The POM for org.springframework.boot:spring-boot-orientdb-autoconfigure:jar:0.10.0-SNAPSHOT is missing, no dependency information available

[ERROR] Failed to execute goal on project spring-boot-orientdb-hello: Could not resolve dependencies for project org.springframework.boot.samples:spring-boot-orientdb-hello:jar:0.10.0-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-orientdb-autoconfigure:jar:0.10.0-SNAPSHOT in http://repo.spring.io/libs-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of spring-libs-snapshot has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project spring-boot-orientdb-hello: Could not resolve dependencies for project org.springframework.boot.samples:spring-boot-orientdb-hello:jar:0.10.0-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-orientdb-autoconfigure:jar:0.10.0-SNAPSHOT in http://repo.spring.io/libs-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of spring-libs-snapshot has elapsed or updates are forced
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project org.springframework.boot.samples:spring-boot-orientdb-hello:jar:0.10.0-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-orientdb-autoconfigure:jar:0.10.0-SNAPSHOT in http://repo.spring.io/libs-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of spring-libs-snapshot has elapsed or updates are forced

Can you please provide more detailed information about steps and requirements to run the examples?

@normunds
Copy link

Looks like ryangardner have used an earlier version. The current version seems to have autoconfiguration module broken by adding document methods. If you remove them, recompile, shiro sample at least will get up without exceptions. For hello you also need to add application.yml (same as in shiro sample) and change @componentscan("org.hello") and @EnableOrientRepositories("org.hello.repository") to use the current package name "org.springframework.boot.orientdb.hello".

@pires
Copy link
Contributor

pires commented Aug 7, 2015

spring-boot-orientdb-shiro sample has been improved (added tests) and thanks to @ancore #25 this issue can be closed.

/cc @lvca

@lvca lvca closed this as completed Aug 7, 2015
@lvca lvca self-assigned this Aug 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants