Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpringMongoData fails to find the Model #1

Open
psramkumar opened this issue Apr 9, 2016 · 0 comments
Open

SpringMongoData fails to find the Model #1

psramkumar opened this issue Apr 9, 2016 · 0 comments

Comments

@psramkumar
Copy link

Spring Configuration

`@Configuration
@componentscan(basePackages={"com.triadic"})
@EnableMongoRepositories(basePackages= "com.triadic.repository")
@propertysource("classpath:application.conf")
public class ApplicationConfig extends AbstractMongoConfiguration {

@Override
protected String getDatabaseName() {
    return "new_schema";
}

@Override
public Mongo mongo() throws Exception {
    return new MongoClient("127.0.0.1", 27017);
}

}`

*Repository *

public interface UserProfileRepository extends MongoRepository<UserProfile, String> {}

*Error:- *

Caused by: java.lang.ClassNotFoundException: com.triadic.repository.model.UserProfile at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.springframework.util.ClassUtils.forName(ClassUtils.java:250) at org.springframework.data.mongodb.config.AbstractMongoConfiguration.getInitialEntitySet(AbstractMongoConfiguration.java:225) at org.springframework.data.mongodb.config.AbstractMongoConfiguration.mongoMappingContext(AbstractMongoConfiguration.java:156) at com.triadic.ApplicationConfig$$EnhancerBySpringCGLIB$$acc47b5b.CGLIB$mongoMappingContext$7(<generated>) at com.triadic.ApplicationConfig$$EnhancerBySpringCGLIB$$acc47b5b$$FastClassBySpringCGLIB$$65261ae5.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)

Enabled Module in config. as same as your sample

did i missed anything here ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant