java.lang.IllegalArgumentException: Invalid class name: sample/ConnectionTesterService

Spring JIRA | Peter Delahunty | 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

    I have the flowing problem I am trying to use the hessian service exporter. If i have this config: <bean name="/connectionTester" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service"> <ref bean="connectionTesterServiceImpl" /> </property> <property name="serviceInterface"> <value> sample.ConnectionTesterService </value> </property> </bean> Note the value com.ConnectionTesterService inside the <value></value> tags is surrounded by white space. A results of my xml formatter... With this configuration i get the following error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/connectionTester' defined in resource [/WEB-INF/service-servlet.xml] of ServletContext: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'serviceInterface'; nested exception is java.lang.IllegalArgumentException: Invalid class name: sample/ConnectionTesterService ] PropertyAccessExceptionsException (1 errors) org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'serviceInterface'; nested exception is java.lang.IllegalArgumentException: Invalid class name: sample.ConnectionTesterService java.lang.IllegalArgumentException: Invalid class name: sample/ConnectionTesterService at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:44) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:837) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:673) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:588) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:720) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:747) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:736) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:840) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:662) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:270) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:205) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:136) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:236) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:284) at org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:282) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:230) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:200) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:102) at javax.servlet.GenericServlet.init(GenericServlet.java:211) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) Basically it looks like this is trying to load the class using the whole string including the white space If i have this config... <bean name="/connectionTester" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service"> <ref bean="connectionTesterServiceImpl" /> </property> <property name="serviceInterface"> <value>sample.ConnectionTesterService</value> </property> </bean> It works fine... I think a simple solution to solve this is to use the trim() method of string...

    Spring JIRA | 1 decade ago | Peter Delahunty
    java.lang.IllegalArgumentException: Invalid class name: sample/ConnectionTesterService
  2. 0

    I have the flowing problem I am trying to use the hessian service exporter. If i have this config: <bean name="/connectionTester" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service"> <ref bean="connectionTesterServiceImpl" /> </property> <property name="serviceInterface"> <value> sample.ConnectionTesterService </value> </property> </bean> Note the value com.ConnectionTesterService inside the <value></value> tags is surrounded by white space. A results of my xml formatter... With this configuration i get the following error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/connectionTester' defined in resource [/WEB-INF/service-servlet.xml] of ServletContext: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'serviceInterface'; nested exception is java.lang.IllegalArgumentException: Invalid class name: sample/ConnectionTesterService ] PropertyAccessExceptionsException (1 errors) org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'serviceInterface'; nested exception is java.lang.IllegalArgumentException: Invalid class name: sample.ConnectionTesterService java.lang.IllegalArgumentException: Invalid class name: sample/ConnectionTesterService at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:44) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:837) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:673) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:588) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:720) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:747) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:736) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:840) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:662) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:270) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:205) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:136) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:236) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:284) at org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:282) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:230) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:200) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:102) at javax.servlet.GenericServlet.init(GenericServlet.java:211) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) Basically it looks like this is trying to load the class using the whole string including the white space If i have this config... <bean name="/connectionTester" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service"> <ref bean="connectionTesterServiceImpl" /> </property> <property name="serviceInterface"> <value>sample.ConnectionTesterService</value> </property> </bean> It works fine... I think a simple solution to solve this is to use the trim() method of string...

    Spring JIRA | 1 decade ago | Peter Delahunty
    java.lang.IllegalArgumentException: Invalid class name: sample/ConnectionTesterService
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Spring-Mvc - JdbcDaoSupport Error

    Stack Overflow | 4 years ago | devdar
    java.lang.IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required
  5. 0

    Problem installing the 2.0.1 Packages

    GitHub | 2 years ago | paulmassey42
    java.lang.IllegalArgumentException: ${cas.logout.url} isn't a valid redir ect URL

  1. tvrmsmith 2 times, last 6 months ago
3 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.IllegalArgumentException

    Invalid class name: sample/ConnectionTesterService

    at org.springframework.beans.propertyeditors.ClassEditor.setAsText()
  2. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:44)
    2. org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:837)
    3. org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:673)
    4. org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:588)
    5. org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:720)
    6. org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:747)
    7. org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:736)
    8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:840)
    9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:662)
    10. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:270)
    11. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:205)
    12. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
    13. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:136)
    14. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:236)
    14 frames
  3. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:284)
    1 frame
  4. Spring
    XmlWebApplicationContext.refresh
    1. org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131)
    1 frame
  5. Spring MVC
    HttpServletBean.init
    1. org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:282)
    2. org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:230)
    3. org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:200)
    4. org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:102)
    4 frames
  6. JavaServlet
    GenericServlet.init
    1. javax.servlet.GenericServlet.init(GenericServlet.java:211)
    1 frame
  7. Glassfish Core
    Catalina.start
    1. org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
    2. org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
    3. org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
    4. org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
    5. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
    6. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
    7. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
    8. org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
    9. org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
    10. org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625)
    11. org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
    12. org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
    13. org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
    14. org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    15. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
    16. org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
    17. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    18. org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
    19. org.apache.catalina.core.StandardService.start(StandardService.java:480)
    20. org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
    21. org.apache.catalina.startup.Catalina.start(Catalina.java:556)
    21 frames
  8. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:324)
    4 frames
  9. Glassfish Core
    Bootstrap.main
    1. org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
    2. org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
    2 frames