Announcement Announcement Module
Collapse
No announcement yet.
RequestMapping annotation error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RequestMapping annotation error

    I am using spring 3.1.1. The following error is occurred at the time of deploying the application on glassfish 3.1.2. The application is previously running fine on glassfish 3.1.1.

    Code:
    SEVERE: WebModule[/test]StandardWrapper.Throwable
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Constructor threw exception; nested exception is java.lang.NullPointerException
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1445)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1242)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5093)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5380)
    	at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
    	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
    	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
    	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
    	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
    	at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
    	at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
    	at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    	at java.lang.Thread.run(Thread.java:662)
    Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Constructor threw exception; nested exception is java.lang.NullPointerException
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
    	... 60 more
    not able to find the exact reason. pl help

    Thanks and regards

  • #2
    I think the root cause of the error is

    Code:
    SEVERE: WebModule[/myapp]
    
    PWC1396: Servlet /myapp threw load() exception
    java.lang.NullPointerException
    	at java.nio.charset.Charset.put(Charset.java:512)
    	at java.nio.charset.Charset.access$300(Charset.java:240)
    	at java.nio.charset.Charset$4.run(Charset.java:553)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.nio.charset.Charset.availableCharsets(Charset.java:546)
    	at org.springframework.http.converter.StringHttpMessageConverter.<init>(StringHttpMessageConverter.java:52)
    	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.<init>(RequestMappingHandlerAdapter.java:143)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1445)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1242)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5093)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5380)
    	at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
    	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
    	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
    	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
    	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
    	at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
    	at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
    	at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    	at java.lang.Thread.run(Thread.java:662)
    something wrong about java.nio package.

    Comment


    • #3
      Hi!

      I don't have a solution for you, just some more info...

      See http://bugs.sun.com/bugdatabase/view...bug_id=6924100

      You might also try the following just for fun:
      Code:
      jrunscript -e "println(java.nio.charset.Charset.availableCharsets().size())"
      On osx 10.7.4 with java 1.7.0_05 I got the number 167.

      Are you running the same version of java for both for glassfish 3.11 and 3.1.2?


      -Kaj

      Comment


      • #4
        Dear Kaj,

        It is on windows7 , java 1.6.31 . I am getting number 166.

        There is no change in OS and java version for both versions.

        Thanks

        Comment

        Working...
        X