java.lang.ArrayStoreException

Spring JIRA | Kunal | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When Spring tries to load the context it fails using JDK 1.3.0 Here is the spring code where it fails in XmlBeanDefinitionReader, Code: if (logger.isInfoEnabled()) { logger.info("Loading XML bean definitions from " + resource + ""); } java.lang.ArrayStoreException at java.lang.System.arraycopy(Native Method) at java.lang.String.getChars(String.java:552) at java.lang.StringBuffer.append(StringBuffer.java:402) at java.lang.StringBuffer.append(StringBuffer.java:370) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:119) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:83) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:101) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:69) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:87) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:262) at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:82) at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:67) Example to create the simplest context: import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; public class TestContext { private static ApplicationContext ctx= null; static String[] paths = {"applicationContext.xml"}; public static void setContext() { try { ctx = new FileSystemXmlApplicationContext(paths); } catch (Exception e){ e.printStackTrace(); } } public TestContext() {} public static void main(String args[]) { TestContext test = new TestContext(); test.setContext(); } } Or Simple code which directly calls and try to log instance of "Resource" import org.springframework.core.io.Resource; import org.springframework.core.io.AbstractResource; import org.springframework.core.io.ClassPathResource; import org.apache.log4j.Logger; import java.util.ArrayList; public class TestContext { public TestContext() {} public static void main(String args[]) { TestContext test = new TestContext(); Logger logger = Logger.getLogger(test.getClass()); ArrayList a = new ArrayList(); logger.info("Logging ArrayList To: " + a); Resource ar = new ClassPathResource("applicationContext.xml"); logger.info("Loading XML bean definitions from " + ar); } } javac -classpath .;lib\spring.jar;lib\commons-logging.jar;lib\xerces.jar;lib\log4j.jar TestContext.java java -classpath .;lib\spring.jar;lib\commons-logging.jar;lib\xerces.jar;lib\log4j.jar TestContext The example can log ArrayList object but fails when logging Resource! Didn't get a chance to look into other object's behaviour other than Resource. Thanks, Kunal

    Spring JIRA | 1 decade ago | Kunal
    java.lang.ArrayStoreException
  2. 0

    When Spring tries to load the context it fails using JDK 1.3.0 Here is the spring code where it fails in XmlBeanDefinitionReader, Code: if (logger.isInfoEnabled()) { logger.info("Loading XML bean definitions from " + resource + ""); } java.lang.ArrayStoreException at java.lang.System.arraycopy(Native Method) at java.lang.String.getChars(String.java:552) at java.lang.StringBuffer.append(StringBuffer.java:402) at java.lang.StringBuffer.append(StringBuffer.java:370) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:119) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:83) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:101) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:69) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:87) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:262) at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:82) at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:67) Example to create the simplest context: import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; public class TestContext { private static ApplicationContext ctx= null; static String[] paths = {"applicationContext.xml"}; public static void setContext() { try { ctx = new FileSystemXmlApplicationContext(paths); } catch (Exception e){ e.printStackTrace(); } } public TestContext() {} public static void main(String args[]) { TestContext test = new TestContext(); test.setContext(); } } Or Simple code which directly calls and try to log instance of "Resource" import org.springframework.core.io.Resource; import org.springframework.core.io.AbstractResource; import org.springframework.core.io.ClassPathResource; import org.apache.log4j.Logger; import java.util.ArrayList; public class TestContext { public TestContext() {} public static void main(String args[]) { TestContext test = new TestContext(); Logger logger = Logger.getLogger(test.getClass()); ArrayList a = new ArrayList(); logger.info("Logging ArrayList To: " + a); Resource ar = new ClassPathResource("applicationContext.xml"); logger.info("Loading XML bean definitions from " + ar); } } javac -classpath .;lib\spring.jar;lib\commons-logging.jar;lib\xerces.jar;lib\log4j.jar TestContext.java java -classpath .;lib\spring.jar;lib\commons-logging.jar;lib\xerces.jar;lib\log4j.jar TestContext The example can log ArrayList object but fails when logging Resource! Didn't get a chance to look into other object's behaviour other than Resource. Thanks, Kunal

    Spring JIRA | 1 decade ago | Kunal
    java.lang.ArrayStoreException

    Root Cause Analysis

    1. java.lang.ArrayStoreException

      No message provided

      at java.lang.System.arraycopy()
    2. Java RT
      StringBuffer.append
      1. java.lang.System.arraycopy(Native Method)
      2. java.lang.String.getChars(String.java:552)
      3. java.lang.StringBuffer.append(StringBuffer.java:402)
      4. java.lang.StringBuffer.append(StringBuffer.java:370)
      4 frames
    3. Spring Beans
      AbstractBeanDefinitionReader.loadBeanDefinitions
      1. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:119)
      2. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:83)
      2 frames
    4. Spring Context
      FileSystemXmlApplicationContext.<init>
      1. org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:101)
      2. org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:69)
      3. org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:87)
      4. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:262)
      5. org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:82)
      6. org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:67)
      6 frames