Announcement Announcement Module
Collapse
No announcement yet.
NoSuchMethodError: sun.nio.cs.StandardCharsets.aliasesFor() deep in Java on Spring DI Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoSuchMethodError: sun.nio.cs.StandardCharsets.aliasesFor() deep in Java on Spring DI

    Hi everyone,

    I am loading the spring context in a webstart client. On Java 1.6.0_29, Spring 3.0 with windows XP x86.
    All i get is this exception while spring loading the context.

    java.lang.NoSuchMethodError: sun.nio.cs.StandardCharsets.aliasesFor(Ljava/lang/String[Ljava/lang/String;
    at sun.nio.cs.ext.ISO_8859_3.<init>(ISO_8859_3.java:3 2)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.nio.cs.AbstractCharsetProvider.lookup(Unknown Source)
    at sun.nio.cs.AbstractCharsetProvider.access$000(Unkn own Source)
    at sun.nio.cs.AbstractCharsetProvider$1.next(Unknown Source)
    at sun.nio.cs.AbstractCharsetProvider$1.next(Unknown Source)
    at java.nio.charset.Charset.put(Unknown Source)
    at java.nio.charset.Charset.access$300(Unknown Source)
    at java.nio.charset.Charset$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.nio.charset.Charset.availableCharsets(Unknown Source)
    at org.springframework.http.converter.StringHttpMessa geConverter.<init>(StringHttpMessageConverter.java :52)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:126)
    at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:74)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$3.run(AbstractAutowireC apableBeanFactory.java:953)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:951)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:911)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:485)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.findAutowireCandidates(DefaultL istableBeanFactory.java:844)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.doResolveDependency(DefaultList ableBeanFactory.java:786)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.resolveDependency(DefaultListab leBeanFactory.java:703)
    at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor$AutowiredFieldElem ent.inject(AutowiredAnnotationBeanPostProcessor.ja va:474)
    at org.springframework.beans.factory.annotation.Injec tionMetadata.inject(InjectionMetadata.java:84)
    at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor.postProcessPropert yValues(AutowiredAnnotationBeanPostProcessor.java: 282)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1074)

    .......

    I could find 2 Versions of ISO_8859_3 constructor:

    public ISO_8859_3() {
    super("ISO-8859-3", StandardCharsets.aliasesFor("ISO-8859-3"));
    }

    public ISO_8859_3() {
    super("ISO-8859-3", ExtendedCharsets.aliasesFor("ISO-8859-3"));
    }

    I have no idea if this has something to do with spring and i can reproduce it only on one pc.
    Still i don't know if more people can reproduce it elsewhere.

    some links describing this kind of problem:
    http://www.dbvis.com/forum/thread.jspa?threadID=1644
    http://www.dbvis.com/forum/thread.jspa?threadID=2365

    It seems like 2 Java versions interact with each other.

    I hope someone can point me in the right direction...
Working...
X