Announcement Announcement Module
Collapse
No announcement yet.
Webpage not running in tomcat 6 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webpage not running in tomcat 6

    Hi, I am trying to run a simple webpage with the code:

    Code:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
        <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    
        
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    
    <center>
    
    <h3>Login page</h3>
    
    <br/>
    
    <form:form commandName="login" method="POST" name="login"> 
    
    Username:<form:input path="username"/> 
    <font color="red"><form:errors path="username"/></font><br/><br/>
    
    Password:<form:password path="password"/>
    <font color="red"><form:errors path="password"/></font><br/><br/>
    
    <input type="submit" value="Login"/>
    
    </form:form>
    
    </center>
    
    
    </body>
    </html>
    But when I run it using tomcat 6 server...I get the following error:

    HTTP Status 404 -

    --------------------------------------------------------------------------------

    type Status report

    message

    description The requested resource () is not available.


    --------------------------------------------------------------------------------

    Apache Tomcat/6.0.18
    There is even no content in front of "message" and "HTTP Status 404 -". What can be the reason. This is something related to tomcat configuration but I am not able to get it. Please help me...

    This is my web.xml:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      <display-name>EnR Application</display-name>
      
      <welcome-file-list>     
      <welcome-file>/login.jsp</welcome-file> 
      </welcome-file-list>
      
      <servlet>
        <servlet-name>enrapp-dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      
      <servlet-mapping>
    		<servlet-name>enrapp-dispatcher</servlet-name>
    		<url-pattern>/</url-pattern>
    	</servlet-mapping>
     
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>/WEB-INF/enrapp-servlet.xml</param-value>
    	</context-param>
      
      
      <servlet-mapping>
        <servlet-name>enrapp</servlet-name>
        <url-pattern>*.htm</url-pattern>
      </servlet-mapping>
    
      
      
      <welcome-file-list>
        <welcome-file>index.html</welcome-file>
      </welcome-file-list>
      
      <listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
      
      
      <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/WEB-INF/pages/error.jsp</location>
    </error-page>
    
    <!-- Spring Security -->
    	<filter>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<filter-class>
                      org.springframework.web.filter.DelegatingFilterProxy
                    </filter-class>
    	</filter>
     
    	<filter-mapping>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<url-pattern>/*</url-pattern>
    		<dispatcher>REQUEST</dispatcher>
            <dispatcher>INCLUDE</dispatcher>  
            <dispatcher>FORWARD</dispatcher>
    	</filter-mapping>
    
    <session-config>      
    <session-timeout>120</session-timeout>    
    </session-config>
    
    </web-app>
    And this is my spring config file:


    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schem...-beans-2.5.xsd
           http://www.springframework.org/schema/context
    	http://www.springframework.org/schem...ontext-2.5.xsd
    	http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-2.5.xsd
    	 http://www.springframework.org/schema/tx  
    	 http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
    	
    	<context:component-scan base-package="com.infosys.enr.question.controller" />
    	
    <bean 
    class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
    
       <bean id="entityManagerFactory" 
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> 
    <property name="dataSource" ref="dataSource"/> 
    <property name="jpaVendorAdapter"> 
    <bean class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">  
    <property name="showSql" value="true"/>  
    <property name="generateDdl" value="true"/>  
    <property name="databasePlatform" value="oracle.toplink.essentials.platform.database.MySQL4Platform"/>
     </bean>
     </property>
     
     <property name="loadTimeWeaver">
     <bean class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"/>
     </property>
     </bean>
    
    
    <bean id="dataSource"  class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/> 
    <property name="url" value="jdbc:mysql://localhost:3306/enrapplication"/> 
    <property name="username" value="root"/> 
    <property name="password" value="root123"/>
    </bean>
    
    <bean id="transactionManager" 
    class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory"/> 
    </bean>
    
    <!-- Data Validation -->
    
     <property name="validator">
    	<bean id="questionValidator" class="com.infosys.enr.question.validator.QuestionValidator" />
    </property>
    
    <bean id="MCQSingleAns" class="com.infosys.enr.question.domain.MCQSingleAnsDomain">
    <property name="answerOption" value="0"></property>
    </bean>
    
    
    <bean id="userDomain" class="com.infosys.enr.user.domain.UserDomain" scope="session">
    <aop:scoped-proxy />
    </bean>
    
    <bean
    		class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
    		<property name="exceptionMappings">
    			<props>
    				<prop key="com.infosys.enr.question.exception.QuestionException">
    					QuestionException
    		                </prop>
    				<prop key="java.lang.Exception">Error</prop>
    			</props>
    		</property>
    	</bean>
    
    
    <!-- view resolver -->
    
    <bean id="viewResolver"
    	      class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
    	      <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
                  <property name="prefix">
                     <value>/WEB-INF/pages/</value>
                  </property>
                  <property name="suffix">
                     <value>.jsp</value>
                  </property>
            </bean>
    
    
    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource" basename="/WEB-INF/messages"/> 
    
    
    
    
    </beans>
    Last edited by Kshitiz; Jan 11th, 2012, 07:45 AM.

  • #2
    Please show your web.xml and spring config file.

    Comment


    • #3
      This is my web.xml

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
        <display-name>EnR Application</display-name>
        
        <welcome-file-list>     
        <welcome-file>/login.jsp</welcome-file> 
        </welcome-file-list>
        
        <servlet>
          <servlet-name>enrapp-dispatcher</servlet-name>
          <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
        </servlet>
        
        <servlet-mapping>
      		<servlet-name>enrapp-dispatcher</servlet-name>
      		<url-pattern>/</url-pattern>
      	</servlet-mapping>
       
      	<context-param>
      		<param-name>contextConfigLocation</param-name>
      		<param-value>
      		/WEB-INF/enrapp-servlet.xml
      		</param-value>
      	</context-param>
        
        
        <servlet-mapping>
          <servlet-name>enrapp</servlet-name>
          <url-pattern>/*.htm</url-pattern>
        </servlet-mapping>
      
        
        
        <welcome-file-list>
          <welcome-file>index.html</welcome-file>
        </welcome-file-list>
        
        <listener>
      		<listener-class>
                            org.springframework.web.context.ContextLoaderListener
                      </listener-class>
      	</listener>
        
        
        <error-page>
          <exception-type>java.lang.Exception</exception-type>
          <location>/WEB-INF/pages/error.jsp</location>
      </error-page>
      
      <!-- Spring Security -->
      	<filter>
      		<filter-name>springSecurityFilterChain</filter-name>
      		<filter-class>
                        org.springframework.web.filter.DelegatingFilterProxy
                      </filter-class>
      	</filter>
       
      	<filter-mapping>
      		<filter-name>springSecurityFilterChain</filter-name>
      		<url-pattern>/*</url-pattern>
      		<dispatcher>REQUEST</dispatcher>
              <dispatcher>INCLUDE</dispatcher>  
              <dispatcher>FORWARD</dispatcher>
      	</filter-mapping>
      
      <session-config>      
      <session-timeout>120</session-timeout>    
      </session-config>
      
      </web-app>
      ANd this is my spring config file:

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans:beans xmlns="http://www.springframework.org/schema/security"
      	xmlns:beans="http://www.springframework.org/schema/beans" 
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans
      	http://www.springframework.org/schem...-beans-3.0.xsd
      	http://www.springframework.org/schema/security
      	http://www.springframework.org/schema/security/spring-security-3.0.3.xsd"
      	xmlns:security="http://www.springframework.org/schema/security">
       
      <http auto-config='true'>
       <session-management session-fixation-protection="migrateSession"/>
      <intercept-url pattern="/css/**" filters="none"/>
      <intercept-url pattern="/login.jsp*" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
          <intercept-url pattern="/**" access="USER" />
          <form-login login-page='/login.jsp' default-target-url='/home.htm' always-use-default-target='true' />
          <remember-me key="rememberMeKey" user-service-ref="userDetailsService"/> 
        </http>
      
      
      
       <bean class="org.springframework.security.core.context.SecurityContextHolder">
        <property name="rolePrefix" value=""/>
      </bean>  
      
      
      <authentication-manager alias="authenticationManager">  
       <authentication-provider ref="daoAuthenticationProvider"/>  
      </authentication-manager>  
      
      
      <beans:bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
          <beans:property name="userDetailsService" ref="userDetailsService"/>
          <beans:property name="saltSource">
              <beans:bean class="org.springframework.security.authentication.dao.ReflectionSaltSource">
                  <beans:property name="userPropertyToUse" value="username"/>
              </beans:bean>
          </beans:property>
          <beans:property name="passwordEncoder" ref="passwordEncoder"/>
      </beans:bean>
      
      <beans:bean id="userDetailsService"  name="userAuthenticationProvider" class="com.infosys.enr.user.service.UserService">
      </beans:bean>
      
      <beans:bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
          <beans:constructor-arg index="0" value="256"/>
      </beans:bean>
      
      
        </beans:beans>

      Comment


      • #4
        Thnx for the reply Grzegorz Grzybek, I have updated my first post...

        Comment


        • #5
          You have:
          Code:
            <servlet-mapping>
              <servlet-name>enrapp</servlet-name>
              <url-pattern>*.htm</url-pattern>
            </servlet-mapping>
          
            <servlet-mapping>
              <servlet-name>enrapp-dispatcher</servlet-name>
              <url-pattern>/</url-pattern>
            </servlet-mapping>
          and

          Code:
            <servlet>
              <servlet-name>enrapp-dispatcher</servlet-name>
              <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
            </servlet>
          try changing first mapping to enrapp-dispatcher

          regards
          Grzegorz Grzybek

          Comment


          • #6
            Webpage not running in tomcat 6

            Actually the thing I have noticed that whenever I start or restart my server (Tomcat 6), NoClassFoundException error appears in its console. The complete discription is:

            Code:
            java.lang.reflect.InvocationTargetException
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            	at java.lang.reflect.Method.invoke(Unknown Source)
            	at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:953)
            	at org.apache.catalina.startup.CallMethodMultiRule.end(WebRuleSet.java:789)
            	at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
            	at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1140)
            	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
            	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
            	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
            	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
            	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
            	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
            	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
            	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
            	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
            	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
            	at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
            	at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1066)
            	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
            	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
            	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
            	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
            	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
            	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            	at java.lang.reflect.Method.invoke(Unknown Source)
            	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
            	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
            Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name enrapp
            	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2393)
            	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2373)
            	... 37 more
            Jan 11, 2012 6:48:00 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
            SEVERE: Parse error in application web.xml file at jndi:/localhost/EnR_Application/WEB-INF/web.xml
            java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name enrapp
            	at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2808)
            	at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2834)
            	at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1143)
            	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
            	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
            	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
            	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
            	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
            	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
            	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
            	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
            	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
            	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
            	at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
            	at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1066)
            	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
            	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
            	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
            	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
            	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
            	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            	at java.lang.reflect.Method.invoke(Unknown Source)
            	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
            	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
            Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name enrapp
            	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2393)
            	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2373)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            	at java.lang.reflect.Method.invoke(Unknown Source)
            	at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:953)
            	at org.apache.catalina.startup.CallMethodMultiRule.end(WebRuleSet.java:789)
            	at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
            	at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1140)
            	... 29 more
            I think this is causing the problem...what do you think?

            Comment


            • #7
              Hmm, I don't see NoClassFoundException, only "Servlet mapping specifies an unknown servlet name enrapp" - just as I've said - you have to fix your servlet-mapping.

              regards
              Grzegorz Grzybek

              Comment


              • #8
                Thank you...That has solved my issue but now a new error is coming...

                Code:
                Jan 12, 2012 11:03:29 AM org.apache.catalina.core.StandardContext listenerStart
                SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
                java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor
                	at org.springframework.context.support.AbstractRefreshableApplicationContext.customizeBeanFactory(AbstractRefreshableApplicationContext.java:218)
                	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
                	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
                	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
                	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
                	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
                	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
                	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
                	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
                	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
                	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
                	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
                	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                	at java.lang.reflect.Method.invoke(Unknown Source)
                	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
                	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
                Caused by: java.lang.ClassNotFoundException: org.springframework.asm.ClassVisitor
                	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
                	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
                	... 22 more
                Jan 12, 2012 11:03:29 AM org.apache.catalina.core.StandardContext start
                SEVERE: Error listenerStart
                Jan 12, 2012 11:03:29 AM org.apache.catalina.core.StandardContext start
                SEVERE: Context [/EnR_Application] startup failed due to previous errors
                Jan 12, 2012 11:03:29 AM org.apache.catalina.core.ApplicationContext log
                INFO: Closing Spring root WebApplicationContext
                Jan 12, 2012 11:03:29 AM org.apache.coyote.http11.Http11Protocol start
                INFO: Starting Coyote HTTP/1.1 on http-8234
                Jan 12, 2012 11:03:29 AM org.apache.jk.common.ChannelSocket init
                INFO: JK: ajp13 listening on /0.0.0.0:8132
                Jan 12, 2012 11:03:29 AM org.apache.jk.server.JkMain start
                INFO: Jk running ID=0 time=0/32  config=null
                Jan 12, 2012 11:03:29 AM org.apache.catalina.startup.Catalina start
                INFO: Server startup in 607 ms
                I have used the following jar files:

                Attachment
                Attached Files

                Comment


                • #9
                  Use one of these JARs: http://search.maven.org/#search|gav|...2spring-asm%22

                  Comment


                  • #10
                    Okk...but I am not using maven...I was thinking to add jars directly in the system....is it necessary to use maven and also, how would asm will solve my problem..??

                    Comment


                    • #11
                      If you're not using maven, just add spring-asm.jar
                      spring-asm.jar is used internally by Spring.

                      Comment


                      • #12
                        It has solved the problem For the sake of knowledge, can u please tell me what magic that file could have done?

                        Comment


                        • #13
                          Hi

                          First - it is repackaged version of OW2 ASM bytecode library.
                          Second - it is used generally to read and expose class metadata (e.g. annotations metadata) used by claspath scanning mechanisms.

                          I hope this clears the matter

                          Comment


                          • #14
                            AFter resolving the issue, few syntax errors came in web.xml and srping config file. After resolving those, this error is coming:

                            Code:
                            SEVERE: Context initialization failed
                            java.lang.NoClassDefFoundError: org/springframework/expression/PropertyAccessor
                            	at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:483)
                            	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:400)
                            	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
                            	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
                            	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
                            	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
                            	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
                            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                            	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
                            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                            	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                            	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
                            	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                            	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                            	at java.lang.reflect.Method.invoke(Unknown Source)
                            	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
                            	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
                            Caused by: java.lang.ClassNotFoundException: org.springframework.expression.PropertyAccessor
                            	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
                            	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
                            	... 20 more
                            Jan 12, 2012 1:16:54 PM org.apache.catalina.core.StandardContext listenerStart
                            SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
                            java.lang.NoClassDefFoundError: org/springframework/expression/PropertyAccessor
                            	at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:483)
                            	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:400)
                            	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
                            	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
                            	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
                            	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
                            	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
                            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                            	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
                            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                            	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                            	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
                            	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                            	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                            	at java.lang.reflect.Method.invoke(Unknown Source)
                            	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
                            	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
                            Caused by: java.lang.ClassNotFoundException: org.springframework.expression.PropertyAccessor
                            	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
                            	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
                            	... 20 more
                            What can be the issue?

                            Comment


                            • #15
                              Now add spring-el.jar - it contains logic for Spring Expression Language - see: http://static.springsource.org/sprin...pressions.html. And yes - it's also used across other Spring JARs

                              regards
                              Grzegorz Grzybek

                              Comment

                              Working...
                              X