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

  • #31
    That didn't affected the problem...and I was wondering how can it solve setter problen...?? beacause the problem related to

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'userDomain' defined in BeanDefinition defined in ServletContext resource [/WEB-INF/enrapp-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: net.sf.cglib.proxy.Enhancer.setInterceptDuringCons truction(Z)V
    Has been solved by the cglib-nodeb-2.2.2.jar... but this invalid setter method is not getting solved??

    Comment


    • #32
      PLease tell me, if I have org.springframework.core 3.0.6 jar, then do I need to include spring.jar also? What is the difference between them?

      Comment


      • #33
        don't use spring.jar - it contains everything.

        Comment


        • #34
          Hmm I don't have a clue about these setters - try renaming them to setA setB - maybe this will help finding the problem?

          Comment


          • #35
            Okk.I have removed that and I am getting the error

            Code:
            SEVERE: Context initialization failed
            java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
            	at java.lang.Class.getDeclaredMethods0(Native Method)
            	at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
            	at java.lang.Class.getDeclaredMethods(Unknown Source)
            	at org.springframework.core.type.StandardAnnotationMetadata.hasAnnotatedMethods(StandardAnnotationMetadata.java:136)
            	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.checkConfigurationClassCandidate(ConfigurationClassBeanDefinitionReader.java:318)
            	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:175)
            	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:144)
            	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:599)
            	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
            	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.aopalliance.aop.Advice
            	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
            	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
            	... 27 more
            Jan 13, 2012 5:19:42 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/aopalliance/aop/Advice
            	at java.lang.Class.getDeclaredMethods0(Native Method)
            	at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
            	at java.lang.Class.getDeclaredMethods(Unknown Source)
            	at org.springframework.core.type.StandardAnnotationMetadata.hasAnnotatedMethods(StandardAnnotationMetadata.java:136)
            	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.checkConfigurationClassCandidate(ConfigurationClassBeanDefinitionReader.java:318)
            	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:175)
            	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:144)
            	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:599)
            	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
            	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.aopalliance.aop.Advice
            	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
            	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
            	... 27 more
            I have tried many aop related jar files liek aop-alliance.jar. I am having org.springframework.aom-3.0.6 jar file. Is there any other jar file to resolve thios issue?
            Last edited by Kshitiz; Jan 13th, 2012, 07:10 AM.

            Comment


            • #36
              now add http://search.maven.org/#search|ga|1...aopalliance%22 - it's getting better

              Comment


              • #37
                Thnx..being new to spring...I just want to ask something...to run spring we need to have some spring related jar files in our workspace...Do we need to add spring plugin also in eclipse for Spring to run? Also, like for tomcat 6 and web module 2.5, will spring 3 run?

                Comment


                • #38
                  You can use Spring without any Spring support in Eclipse. Treat "spring jars" just as libraries you (or Eclipse) have to put into WEB-INF/lib of your WAR.
                  And if you spend some time learning and setting up Maven - you won't have the problems you had with dependencies (you will have other problems though ).

                  regards
                  Grzegorz Grzybek

                  Comment


                  • #39
                    Okk...maven seems to be important part of Spring...As my web module is 2.5 and tomcat is 6.0, is Spring version dependent upon them? I mean, I am using Spring 3...so thats why I am asking...is it compatible with web module 2.5 and tomcat 6?

                    Comment


                    • #40
                      Rather Maven is important part of general java enterprise programming where you depend on tens of external, open source libraries. Spring itself has some requirements (I dont' remember now), but on Tomcat 6 you can use either Spring 2.5 or even 3.1.

                      Comment


                      • #41
                        Okk...after adding the required aop jar file, I am getting again that invalid setter method error....I dont know what must be the solution of that problem...?? I am really sick of that problem...

                        Comment


                        • #42
                          Can you zip me your project? Or some part of it?

                          Comment


                          • #43
                            I am really sorry as because of company policy...I cannot attach any code and send it outside (hope you would understand), but I am posting all the code that you would require to help me:

                            MCQSingleAnsController.java:

                            Code:
                            package com.infosys.enr.question.controller;
                            
                            import java.sql.Date;
                            import org.springframework.beans.factory.annotation.Autowired;
                            import org.springframework.stereotype.Controller;
                            import org.springframework.web.servlet.ModelAndView;
                            import org.springframework.validation.BindingResult;
                            import org.springframework.web.bind.annotation.ModelAttribute;
                            import org.springframework.web.bind.annotation.RequestMapping;
                            import org.springframework.web.bind.annotation.RequestMethod;
                            import org.springframework.web.bind.annotation.RequestParam;
                            import org.springframework.web.bind.support.SessionStatus;
                            
                            import com.infosys.enr.question.domain.QuestionDomain;
                            import com.infosys.enr.question.domain.MCQSingleAnsDomain;
                            import com.infosys.enr.question.validator.MCQSingleAnsValidator;
                            import com.infosys.enr.question.validator.QuestionValidatorInterface;
                            import com.infosys.enr.question.manager.MCQSingleAnsManager;
                            import com.infosys.enr.question.manager.QuestionManagerInterface;
                            import com.infosys.enr.question.exception.createQuestionPermissionDeniedException;
                            import com.infosys.enr.question.controller.QuestionControllerInterface;
                            
                            @SuppressWarnings("unused")
                            @Controller
                            @RequestMapping(value="/question.jsp?typeId=1", method = RequestMethod.POST)
                            
                            public class MCQSingleAnsController implements QuestionControllerInterface {
                            	
                            	
                            	private MCQSingleAnsValidator  questionValidatorInterface;
                            	private QuestionManagerInterface questionManagerInterface;
                            	
                            		
                            	/* Create question method*/
                            	
                            
                            	public QuestionManagerInterface getQuestionManagerInterface() {
                            		return questionManagerInterface;
                            	}
                            
                            
                            	public MCQSingleAnsValidator getQuestionValidatorInterface() {
                            		return questionValidatorInterface;
                            	}
                            
                            
                            	public void setQuestionValidatorInterface(
                            			MCQSingleAnsValidator questionValidatorInterface) {
                            		this.questionValidatorInterface = questionValidatorInterface;
                            	}
                            
                            
                            	public void setQuestionManagerInterface(
                            			QuestionManagerInterface questionManagerInterface) {
                            		this.questionManagerInterface = questionManagerInterface;
                            	}
                            
                            
                            
                            
                            
                            
                            	@RequestMapping(params = "createMCQSingleAns", method = RequestMethod.POST) 
                            	public ModelAndView create(@ModelAttribute("MCQSingleAns") Object object,
                            		BindingResult result, SessionStatus status) throws createQuestionPermissionDeniedException, Exception
                            	
                            	{
                            		MCQSingleAnsDomain MCQSingleAns = (MCQSingleAnsDomain)object; 
                            		
                            		questionValidatorInterface.create(MCQSingleAns, result);
                             
                            		if (result.hasErrors()) 
                            		{
                            			ModelAndView mav = new ModelAndView("question");
                            			return mav;
                            		} 
                            		
                            		else 
                            		{
                            			try
                            			{
                            			questionManagerInterface.create(MCQSingleAns);
                            			status.setComplete();
                            			
                            			}
                            			catch(createQuestionPermissionDeniedException questionException)
                            			{
                            			    throw questionException;	
                            			}
                            			catch(Exception exception)
                            			{
                            				throw exception;
                            			}
                            			ModelAndView mav = new ModelAndView("redirect:question");
                            			return mav;
                            		}
                            	}
                            
                            
                            }
                            QuestionControllerInterface.java

                            Code:
                            package com.infosys.enr.question.controller;
                            
                            import org.springframework.web.bind.support.SessionStatus;
                            import org.springframework.web.servlet.ModelAndView;
                            import org.springframework.validation.BindingResult;
                            
                            public interface QuestionControllerInterface {
                            	
                            
                            	public ModelAndView create(Object obj, BindingResult result, SessionStatus status) throws Exception;
                            
                            }
                            MCQSingleAnsValidator.java

                            Code:
                            package com.infosys.enr.question.validator;
                            
                            import org.springframework.validation.Errors;
                            
                            import com.infosys.enr.question.validator.QuestionValidatorInterface;
                            import com.infosys.enr.question.domain.MCQSingleAnsDomain;
                            import com.infosys.enr.question.validator.QuestionValidatorAbstract;
                            
                            
                            public class MCQSingleAnsValidator extends QuestionValidatorAbstract implements QuestionValidatorInterface
                            {
                            	
                            	
                            	// Validation for MCQ's options
                            	
                            	public void create(Object object, Errors errors) {
                            		
                            		MCQSingleAnsDomain MCQSingleAns = (MCQSingleAnsDomain)object;
                            		
                            		basic(MCQSingleAns, errors);
                            		
                            		for(int i =0; i<MCQSingleAns.getOption().length;i++)
                            		{
                            			
                            		if (MCQSingleAns.getOption()[i]== null) { 
                            			errors.rejectValue("option", "validation.null", "Option area cannot be left empty"); 
                            			} 
                            		
                            		}
                            		
                            		if (MCQSingleAns.getAnswerOption()== 0) { 
                            			errors.rejectValue("answerOption", "validation.null", "Answer should be selected among options"); 
                            			} 
                            	}
                            	
                            
                            
                            }
                            QuestionValidatorInterface.java

                            Code:
                            package com.infosys.enr.question.validator;
                            
                            import org.springframework.validation.Errors;
                            
                            public interface QuestionValidatorInterface {
                            	
                            	public void create(Object object, Errors errors);
                            	public void basic(Object object, Errors errors);
                            
                            }

                            QuestionValidatorAbstract.java

                            Code:
                            package com.infosys.enr.question.validator;
                            
                            import org.springframework.validation.Errors;
                            
                            import com.infosys.enr.question.domain.QuestionDomain;
                            
                            public abstract class QuestionValidatorAbstract {
                            	
                            public void basic(Object object, Errors errors) {
                            		
                            		QuestionDomain question = (QuestionDomain)object;
                            		
                            		
                            		if(question.getQuestion()==null) { 
                            			errors.rejectValue("question", "validation.null", "Text area cannot be left empty"); 
                            			} 
                            		
                            		if (question.getCourseId() == 0) { 
                            			errors.rejectValue("course", "validation.null", "Course should be selected"); 
                            			}
                            		
                            		if (question.getLevelId() == 0) { 
                            			errors.rejectValue("level", "validation.null", "Level should be selected"); 
                            			}
                            		
                            		if (question.getTopicId() == 0) { 
                            			errors.rejectValue("topic", "validation.null", "Topic should be selected"); 
                            			}
                            	}
                                
                                public void create(Object object, Errors errors){};
                            
                            }
                            I hope that will help you to trace down the problem...

                            Comment


                            • #44
                              Hi Grzegorz Grzybek, did you find any solution?? Or can you give me any suggestion regarding this invalid setter method problem??

                              Comment


                              • #45
                                I have opened this thread in FireFox tab and when I have some time, I'll look at it - I'll see into it today

                                Comment

                                Working...
                                X