Announcement Announcement Module
Collapse
No announcement yet.
Error in bean creation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Benedict.Aluan
    started a topic Error in bean creation

    Error in bean creation

    Hello Experts,

    I'm having a ServletExeption with a root cause of error in bean creation.
    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountPageController' defined in ServletContext resource [/WEB-INF/AccountPages-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.aleanetwork.account.PageController]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/deploy/net/HttpRequest
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	java.security.AccessController.doPrivileged(Native Method)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
    	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    	org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
    	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
    	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
    	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
    	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
    	javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    	org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    	org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    	org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    	java.lang.Thread.run(Thread.java:619)
    Here is my AccountPages-servlet.xml
    Code:
    <beans>
        <bean id="accountPageController" class="com.aleanetwork.account.PageController">
            <property name="methodNameResolver" ref="actionMethodNameResolver"/>
        </bean>
    
        <bean id="actionMethodNameResolver"
              class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
            <property name="mappings">
                <props>
                    <prop key="/index.html">depoist</prop>
                    <prop key="/deposit.html">deposit</prop>
                    <prop key="/signup.html">signup</prop>
                </props>
            </property>
        </bean>
    
        <bean id="viewResolver" class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
            <property name="basename" value="views"/>
        </bean>

  • m.bartyzel
    replied
    That class is from the jstl.jar. Ensure you have all required jars deployed with your app. All you need you can find in lib directory in spring-with-dependencies package.

    Leave a comment:


  • Benedict.Aluan
    replied
    Hello, thanks for the quick reply. It is now working however, I'm having another error:
    Code:
    java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
    	org.springframework.web.servlet.support.JstlUtils.exposeLocalizationContext(JstlUtils.java:97)
    	org.springframework.web.servlet.view.JstlView.exposeHelpers(JstlView.java:133)
    	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:213)
    	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:258)
    	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1174)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:901)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    Is it the same? I already included the library (j2ee) and I still gets this error.

    Leave a comment:


  • Marten Deinum
    replied
    Code:
    java.lang.NoClassDefFoundError: com/sun/deploy/net/HttpRequest
    You are either missing a jar or are programming to implementation classes directly and now deploy in a different container.

    Leave a comment:

Working...
X