java.lang.ClassNotFoundException: [B

Spring JIRA | Zvika Markfeld | 9 years ago
  1. 0

    I was trying to set up a JMX client proxy. one of the interface method signatures contains byte[], and when setting up the client proxy, I get the exception below. seems like byte[].class.getName() returns '[B', and ClassUtils tries to use that as the name of the class when calling loadClass, a call which, evidently, fails. btw, I tried changing the signature to Byte[], but then I got the same error for '[Ljava.lang.Byte;'. java.lang.ClassNotFoundException: [B at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.springframework.util.ClassUtils.forName(ClassUtils.java:201) at org.springframework.util.ClassUtils.forName(ClassUtils.java:171) at org.springframework.jmx.support.JmxUtils.parameterInfoToTypes(JmxUtils.java:141) at org.springframework.jmx.access.MBeanClientInterceptor.retrieveMBeanInfo(MBeanClientInterceptor.java:239) at org.springframework.jmx.access.MBeanClientInterceptor.afterPropertiesSet(MBeanClientInterceptor.java:169) at org.springframework.jmx.access.MBeanProxyFactoryBean.afterPropertiesSet(MBeanProxyFactoryBean.java:81) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)

    Spring JIRA | 9 years ago | Zvika Markfeld
    java.lang.ClassNotFoundException: [B
  2. 0

    I was trying to set up a JMX client proxy. one of the interface method signatures contains byte[], and when setting up the client proxy, I get the exception below. seems like byte[].class.getName() returns '[B', and ClassUtils tries to use that as the name of the class when calling loadClass, a call which, evidently, fails. btw, I tried changing the signature to Byte[], but then I got the same error for '[Ljava.lang.Byte;'. java.lang.ClassNotFoundException: [B at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.springframework.util.ClassUtils.forName(ClassUtils.java:201) at org.springframework.util.ClassUtils.forName(ClassUtils.java:171) at org.springframework.jmx.support.JmxUtils.parameterInfoToTypes(JmxUtils.java:141) at org.springframework.jmx.access.MBeanClientInterceptor.retrieveMBeanInfo(MBeanClientInterceptor.java:239) at org.springframework.jmx.access.MBeanClientInterceptor.afterPropertiesSet(MBeanClientInterceptor.java:169) at org.springframework.jmx.access.MBeanProxyFactoryBean.afterPropertiesSet(MBeanProxyFactoryBean.java:81) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)

    Spring JIRA | 9 years ago | Zvika Markfeld
    java.lang.ClassNotFoundException: [B
  3. 0

    graph-builder error downloading osm

    GitHub | 4 years ago | robertoferraz
    java.lang.ClassNotFoundException: org.opentripplanner.graph_builder.openstreetmap.impl.RegionBasedOpenStreetMapProviderImpl
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Bean Creation Exception with JBoss 5.1.2

    Stack Overflow | 3 years ago | ajit kumar
    org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.abc.myapp.cmc.infrastructure.util.CustomPropertyPlaceholderConfigurer] for bean with name 'applicationPropertyConfigurer' defined in ServletContext resource [/WEB-INF/spring-config/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: com.abc.myapp.cmc.infrastructure.util.CustomPropertyPlaceholderConfigurer
  6. 0

    Failed to load applicationContext: NoSuchBeanDefinitionException when running JUnit test in Spring MVC app

    Stack Overflow | 6 years ago | Soroush Hakami
    org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.mchange.v2.c3p0.ComboPooledDataSource] for bean with name 'dataSource' defined in class path resource [db-config.xml]; nested exception is java.lang.ClassNotFoundException: com.mchange.v2.c3p0.ComboPooledDataSource

  1. batwalrus76 2 times, last 1 week ago
  2. kid 84 times, last 8 months ago
  3. andyglick 2 times, last 4 days ago
  4. richard77 1 times, last 1 week ago
  5. musketyr 2 times, last 1 week ago
67 more registered users
26 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    [B

    at java.net.URLClassLoader$1.run()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader$1.run(Unknown Source)
    2. java.security.AccessController.doPrivileged(Native Method)
    3. java.net.URLClassLoader.findClass(Unknown Source)
    4. java.lang.ClassLoader.loadClass(Unknown Source)
    5. sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    6. java.lang.ClassLoader.loadClass(Unknown Source)
    6 frames
  3. Spring Core
    ClassUtils.forName
    1. org.springframework.util.ClassUtils.forName(ClassUtils.java:201)
    2. org.springframework.util.ClassUtils.forName(ClassUtils.java:171)
    2 frames
  4. Spring Context
    MBeanProxyFactoryBean.afterPropertiesSet
    1. org.springframework.jmx.support.JmxUtils.parameterInfoToTypes(JmxUtils.java:141)
    2. org.springframework.jmx.access.MBeanClientInterceptor.retrieveMBeanInfo(MBeanClientInterceptor.java:239)
    3. org.springframework.jmx.access.MBeanClientInterceptor.afterPropertiesSet(MBeanClientInterceptor.java:169)
    4. org.springframework.jmx.access.MBeanProxyFactoryBean.afterPropertiesSet(MBeanProxyFactoryBean.java:81)
    4 frames
  5. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
    4. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
    5. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
    6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
    7. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
    8. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
    8 frames
  6. Spring Context
    ClassPathXmlApplicationContext.<init>
    1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
    2. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
    3. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
    3 frames