• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Strange implements Required with java 7

 
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We're using the SchemaRoutingDataSource, which extends AbstractRoutingDataSource.

Under Java 6, all is cool and the single method is fine.

Yet, with the same Spring libraries (this is a Spring class), but with Java 7, a method now needs to be implemented:

@Override
public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
{
return null;
}

-----------

How can this happen with just a Java compiler change but with the exact same Spring libs?

???

Thanks in advance for any ideas.

- mike
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not a Spring issue. You should throw the SQLFeatureNotSupportedException not return null. If you need this code to also compile in java 6 (you probably don't) then remove the @Override annotation.

See this thread for more information.
https://forums.oracle.com/message/10089368

I will also add this to our Java in General forum in case anyone else has any input.
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bill Gorder wrote:It's not a Spring issue. You should throw the SQLFeatureNotSupportedException not return null. If you need this code to also compile in java 6 (you probably don't) then remove the @Override annotation.

See this thread for more information.
https://forums.oracle.com/message/10089368

I will also add this to our Java in General forum in case anyone else has any input.



That was just the stub inserted by the IDE.

In any case, the Java 7 version of this code works fine in the prototype without any changes, but not in the production version of the code.

Therefore, I'm still confused.

The only change made was to change the version of Java, in which case, the IDE informs us we MUST implement this extra method. Again, that only happens in the production version, but not in the (Java 7) prototype version.

Thanks,

-mike
 
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You verified that the 'prototype' version really is using Java 7? Java 7 features work?
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

E Armitage wrote:You verified that the 'prototype' version really is using Java 7? Java 7 features work?



Yes, I did a "javap" on the class that was requiring the extra method to be implemented and the major version was "51".

The code runs with no problems.

Hence the mystery.

- mike
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic