2013年9月26日星期四

Tomcat problem , ClassNotFound

Recent projects , the need to integrate Mina Spring framework , in accordance with mina- official tutorial http://mina.apache.org/mina-project/userguide/ch17-spring-integration/ch17-spring-integration.html, operation can not be displayed after class found : org.apache.mina.integration.beans.InetSocketAddressEditor.
but I do have mina- library contains came in, as shown

error is org.apache.catalina.loader.WebappClassLoader.loadClass, triggered the question should be tomcat

In addition, MINA source directly into my project in time , will be able to run properly .

engage in two days , the Internet has not found any useful information , please god enlighten ah ~
------ Solution -------------- ------------------------------
is not jdk problem ?
------ Solution ---------------------------------------- ----

put these jar into projectName \ WEB-INF \ lib below to try
------ Solution ------------ --------------------------------
sun anomalies ah ,
----- - Solution --------------------------------------------
landlord first ctrl + shif + t in the works to find the class and then navigate to the class to see if your build path in a web project please him if the WEB-INF/lib below ; this fight war when the package certainly play into
------ Solution --------------------------- -----------------

     
just did not see , sorry, the following is the exception information ~   
  
Exception in thread "Thread-1" org.springframework.beans.FatalBeanException: Editor class not found; nested exception is java.lang.ClassNotFoundException: org.apache.mina.integration.beans.InetSocketAddressEditor
at org.springframework.beans.factory.config.CustomEditorConfigurer.postProcessBeanFactory(CustomEditorConfigurer.java:214)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:664)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.NIPC.MinaServer.MinaTest$Ctx.run(MinaTest.java:37)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.mina.integration.beans.InetSocketAddressEditor
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
at org.springframework.beans.factory.config.CustomEditorConfigurer.postProcessBeanFactory(CustomEditorConfigurer.java:198)
... 7 more
  
  
 
amount . . I feel like I do not , sorry !
------ Solution ---------------------------------------- ----
LZ I have encountered this problem , but have forgotten how to solve it. . .
------ Solution - -------------------------------------------

ah, this has been tried, I was built SpringMVC STS project directory structure is as follows   
     
into lib, then add class path, the results reported the same mistake  
copied to the WEB-INF lib below to try
------ For reference only ----------------------- ----------------
you dare the exception information sent to it
------ For reference only ---------- -----------------------------


just did not see , sorry, the following is the exception information ~
Exception in thread "Thread-1" org.springframework.beans.FatalBeanException: Editor class not found; nested exception is java.lang.ClassNotFoundException: org.apache.mina.integration.beans.InetSocketAddressEditor
at org.springframework.beans.factory.config.CustomEditorConfigurer.postProcessBeanFactory(CustomEditorConfigurer.java:214)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:664)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.NIPC.MinaServer.MinaTest$Ctx.run(MinaTest.java:37)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.mina.integration.beans.InetSocketAddressEditor
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
at org.springframework.beans.factory.config.CustomEditorConfigurer.postProcessBeanFactory(CustomEditorConfigurer.java:198)
... 7 more



------ For reference only ---------------------------------- -----

not, because MINA source directly into my project in time , it can be normal operation.
thanks Reply - hey , no problem at compile time anyway , is to run a mistake
------ For reference only ------------------ ---------------------

ah, this has been tried, I was built SpringMVC STS project directory structure is as follows

into lib, then add class path, the results reported the same mistake
------ For reference only ----------------- ----------------------
finally solved the problem , thanks


In addition, reference http://hi.baidu.com/yan160523/item/16c8912331d614de0f37f941

actually is the case, I tried
<1> Add MINA 's user library;
<2> the lib into the WEB-INF / under ( sorry, one begins to go into the upper layer ), add class folder
but these two are separate trial , there is no combination of < 1> encountered problem is runtime error, <2> encountered problem is compiled would go through
Later, I also did a <1 > < 2 > , and finally OK, now the project are listed below

But I think these two are not repeat it ?
Later, I would not be <2 > is add class folder that step , but also OK, emotional web project add class folder useless ah

没有评论:

发表评论