LOCALDATE
Springbean the throw using instantiation application references a ArrayIndexOutofBoundsException
package app; Import java.time.LocalDate; Import org.springframework.context.ApplicationContext; Import org.springframework.context.support.ClassPathXmlApplicationContext; Public class ApplicationMain {public static void (String [] args) {ApplicationContext beanFactory = new ClassPathXmlApplicationContext ( "spring.xml"); LocalDataL = (local date) BeanFactorGetbin ("local date"); Println (L); }} ------------------------------------------------ --------- & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; DOCTYPE bean public "- // vasant // DTD Bean 2.0 // n" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"> & Lt; Beans & gt; & Lt; Beam id = "LOCALDATE" class = "java.time.LocalDate" factory = "now" /> & Lt; / Bean & gt; --------------------------------------------- Exception in thread "main "Java.lang.ArrayIndexOutOfBoundsException: .. 52,222 in org.springframework.asm.ClassReader & lt; Init & gt; (Unknown source) org.springframework.asm.ClassReader at & lt; Init & gt; (Unknown source) at org.springframework.asm.ClassReader at org.springframework.core.LocalVariableTableParameterNameDiscoverer.inspectClass (org.springframework.core.LocalVariableTableParameterNameDiscoverer.getParameterNames (Local VariableTableParameterNameDiscoverer.java:71) at org.springframework.beans & lt; init & Gt; (unknown source) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBe factory.support.ConstructorResolver at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod (AbstractAutowireCapableBeanFactory.java: 9 64). instantiateUsingFactoryMethod (Kanstrctorrolvr. Java: 443) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean on Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutow ireCapableBeanFactory.java:450) a Instrans (Abstretatovriyr on Kapblfiantrkjawa: 870) At org.springframework.beans.factory.support.AbstractBeanFactory $ 1.get org.springframework.beans.factory.support object (orb.san). DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java on org.springframework.beans June 22) (AbstractBeanFactory.java Jun 90). Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons at factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:287) org.springframework.beans.factory.support.AbstractBeanFactory.getBean at (AbstractBeanFactory.java189). DefaultListableBeanFactory.java:562) Org.springframework.context.support.ClassPathXmlApplicationContext on org.springframework.context.support.AbstractApplicationConte. & Lt; Init & gt; (ClassPathXmlApplicationContext.java:139) on org.springframework.context.support.AbstractApplicationContext.refresh (Abstract Applications of Kantaks. Java: 423) xt.finishBeanFactoryInitialization (AbstractApplicationContext.java:871) on. ) At org.springframework.context.support.ClassPathXmlApplicationContext. & Lt; Init & gt; (ClassPathXmlApplicationContext.java:83) on the app. Application Man. Maine (ApplicationMain.java13) -------
If I spring 4 If I use Java 8 then this code is working.
may be using the spring that restrictions on API level 3 ApplicationContext / AbstarctApplicationContext
No comments:
Post a Comment