Announcement Announcement Module
No announcement yet.
java.lang.NoSuchFieldError: NO_CREDENTIALS Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.NoSuchFieldError: NO_CREDENTIALS

    I'm using the latest snapshot builds:

    After updating to the latest snapshot releases, I'm now unable to create any MongoDB instances - failing with the following exception:

    Caused by: java.lang.NoSuchFieldError: NO_CREDENTIALS
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
    	at java.lang.reflect.Constructor.newInstance(
    	at org.springframework.beans.BeanUtils.instantiateClass(
    	... 90 more
    This appears to be some sort of version issue with the JARs, as has no reference to NO_CREDENTIALS:

    	public SimpleMongoDbFactory(Mongo mongo, String databaseName) {
    		Assert.notNull(mongo, "Mongo must not be null");
    		Assert.hasText(databaseName, "Database name must not be empty");
    				"Database name must only contain letters, numbers, underscores and dashes!");
    		this.mongo = mongo;
    		this.databaseName = databaseName;
    Looking at the pom, the snapshot has been resolved to:
    spring-data-mongodb : 1.1.0.BUILD-20120402.133938-18

    Unforutnately, this is a blocker for us - so any assistance is greatly appreciated.

  • #2
    Make sure you're using Spring Data Commons latest snapshot as well. The API has changed accordingly there. Please do not cross post issues to bot the JIRA and forums concurrently as I otherwise have to always answer questions twice .


    • #3
      Thanks Oliver.

      Please do not cross post issues to bot the JIRA and forums concurrently as I otherwise have to always answer questions twice
      Understood - sorry about that.

      spring-data-commons-core is linked as 1.3.0.M1 (managed from 1.3.0.BUILD-SNAPSHOT), inheriteted from spring-data-mongodb.

      I'm not explicitly linking any version, so this should be correct.

      Please advise if there's a better version for me to be using.


      • #4
        spring-data-mongodb 1.1.0.BUILD-SNAPSHOT refers to spring-data-commons-core 1.3.0.BUILD-SNAPSHOT. So if you get anything other than that you probably have configured that version yourself somewhere.


        • #5
          Just confirming for the sake of prosperity:

          Updating to spring-data-commons-core 1.3.0.BUILD-SNAPSHOT indeed solved the problem. I ended up having to delete the downloaded snapshots to get it to update - but that's a maven issue, not a spring data issue.