ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J..@fec.gov
Subject Re: java.lang.NoClassDefFoundError error again, need help!
Date Fri, 13 Apr 2007 19:50:15 GMT
Hi Richard & Larry,
  Your guy are great. I put different try block and found my 
SqlMapConfig.xml missing close tag </transactionManager>.
and it works fine  in jDeveloper9. But when I deploy into Tomcat, I still 
got same error:
There are many kinds of log file under Tomcat/log folder.
I even can not see any debug message I put in the Static section. Why?
I check the log.jar, here are what we have now:

1)C:\Tomcat 5.0.28\common\lib\commons-logging-1.1.jar
    C:\Tomcat 5.0.28\common\lib\log4j-1.2.14.jar
    C:\Tomcat 5.0.28\common\classes\log4j.properties:
log4j.rootLogger=DEBUG, R 
log4j.appender.R=org.apache.log4j.RollingFileAppender 
log4j.appender.R.File=${catalina.home}/logs/tomcat2.log 
log4j.appender.R.MaxFileSize=10MB 
log4j.appender.R.MaxBackupIndex=10 
log4j.appender.R.layout=org.apache.log4j.PatternLayout 
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

2)
C:\Tomcat 
5.0.28\webapps\DisclosureSearch\WEB-INF\libcommons-logging-1.1.jar
C:\Tomcat 5.0.28\webapps\DisclosureSearch\WEB-INF\lib\log4j-1.2.14.jar
C:\Tomcat 
5.0.28\webapps\DisclosureSearch\WEB-INF\classes\log4j.properties:
log4j.rootLogger=DEBUG, R 
log4j.appender.R=org.apache.log4j.RollingFileAppender 
log4j.appender.R.File=${catalina.home}/logs/disclosure.log 
log4j.appender.R.MaxFileSize=10MB 
log4j.appender.R.MaxBackupIndex=10 
log4j.appender.R.layout=org.apache.log4j.PatternLayout 
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n


error message is in localhost_log.2007-04-13.txt:
2007-04-13 15:31:25 StandardWrapperValve[action]: Servlet.service() for 
servlet action threw exception
java.lang.NoClassDefFoundError: aaa/bbb/ccc/BaseIbatisDAO
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at 
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
        at 
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:141)
        at 
gov.fec.disclosure.DisclosureSearchSubmitAction.class$(DisclosureSearchSubmitAction.java:34)
        at 
gov.fec.disclosure.DisclosureSearchSubmitAction.<clinit>(DisclosureSearchSubmitAction.java:35)
        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:274)
        at java.lang.Class.newInstance0(Class.java:308)
        at java.lang.Class.newInstance(Class.java:261)
        at 
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:145)
        at 
org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:282)
        at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:220)
        at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
        at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at 
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
        at 
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
        at 
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
        at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
        at 
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)



Could you explain me how those log systems work?  Do they conflic each 
other?

Have a good weekend!

Jun Li





"Larry Meadors" <lmeadors@apache.org> 
Sent by: larry.meadors@gmail.com
04/13/2007 01:03 PM
Please respond to
user-java@ibatis.apache.org


To
user-java@ibatis.apache.org
cc

Subject
Re: java.lang.NoClassDefFoundError error again, need help!






I'd guess that the BaseIbatisDAO is failing to initialize properly,
then causing the exception you are seeing - if the initialization
fails, the class does not load, so later classes that rely on it can't
find it.

I'd look there for issues - maybe step through it with a debugger.

Larry


On 4/13/07, JLi@fec.gov <JLi@fec.gov> wrote:
>
> Sorry, I checked again.
> BaseIbatisDAO  was under C:\Tomcat 
5.0.28\webapps\DisclosureSearch\WEB-INF\classes\aaa\bbb\ccc\BaseIbatisDAO.class
>
>
> Thanks.
>
>
> Jun Li
>
>
>
>
>
>  "Yee, Richard K CTR DMDC" <Richard.Yee.ctr@osd.pentagon.mil>
>
> 04/13/2007 12:49 PM
>
>
> Please respond to
>  user-java@ibatis.apache.org
>
>
> To "'user-java@ibatis.apache.org'" <user-java@ibatis.apache.org>
>
> cc
>
>
> Subject RE: java.lang.NoClassDefFoundError error again, need help!
>
>
>
>
>
>
>
>
> The BaseIbatisDAO class is not in ibatis-2.3.0.677.jar. BaseIbatisDAO is 
the
>  class you wrote.
>
>  -Richard
>
>
>  -----Original Message-----
>  From: JLi@fec.gov [mailto:JLi@fec.gov]
>  Sent: Friday, April 13, 2007 9:15 AM
>  To: user-java@ibatis.apache.org
>  Cc: 'user-java@ibatis.apache.org'
>  Subject: RE: java.lang.NoClassDefFoundError error again, need help!
>
>
>  Thanks,
>
>  I check, It was there, under C:\Tomcat
>  5.0.28\webapps\DisclosureSearch\WEB-INF\lib\ibatis-2.3.0.677.jar.
>
>  I import ibatis-2.3.0.677.jar. into jDeveloper 9 first and then deploy 
to
>  Tomcat.
>
>  Jun Li
>  Information Technology Division
>  Federal Election Commission
>  Washington, DC  20463
>  202.694.1279
>
>
>
>
>  "Yee, Richard K CTR DMDC" <Richard.Yee.ctr@osd.pentagon.mil>
>
>  04/13/2007 12:11 PM
>  Please respond to
>  user-java@ibatis.apache.org
>
>  To
>  "'user-java@ibatis.apache.org'" <user-java@ibatis.apache.org> cc 
Subject
>  RE: java.lang.NoClassDefFoundError error again, need help!
>
>
>
>
>
>
>  Jun,
>  The problem is that Tomcat can't find your BaseIbatisDAO class. Is the
>  package in your WEB-INF/classes directory?
>
>  -Richard
>
>
>  -----Original Message-----
>  From: JLi@fec.gov [mailto:JLi@fec.gov]
>  Sent: Friday, April 13, 2007 9:01 AM
>  To: user-java@ibatis.apache.org
>  Subject: java.lang.NoClassDefFoundError error again, need help!
>
>
>  I am trying to use iBATIS in jDeveloper 9 and Tomcat 5.0.28.
>
>  I keep getting error: java.lang.NoClassDefFoundError,
>
>  under \WEB-INF\lib\
>  there are : ibatis-2.3.0.677.jar,
>                     log4j-1.2.14.jar;
>                     commons-logging-1.1.jar... and other struts jar.
>  I searched the online, I guess the problem is in my static init 
section. I
>  copied that from online sample code.
>
>  see below is error log and BaseIbatisDAO:
>  ---------------------------------2007-04-13 11:51:42
>  StandardWrapperValve[action]: Servlet.service() for servlet action 
threw
>  exception
>  java.lang.NoClassDefFoundError: aaa/bbb/ccc/BaseIbatisDAO
>         at java.lang.ClassLoader.defineClass0(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
>         at
>  java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>         at
> 
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo
>  ader.java:1634)
>         at
> 
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav
>  a:860)
>         at
> 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
>  a:1307)
>         at
> 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
>  a:1189)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:141)
>         at
> 
gov.fec.disclosure.DisclosureSearchSubmitAction.class$(DisclosureSearchSubmi
>  tAction.java:34)
>         at
> 
gov.fec.disclosure.DisclosureSearchSubmitAction.<clinit>(DisclosureSearchSub
>  mitAction.java:35)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>  Method)
>         at
> 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
>  sorImpl.java:39)
>         at
> 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
>  torAccessorImpl.java:27)
>         at 
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at java.lang.Class.newInstance0(Class.java:308)
>         at java.lang.Class.newInstance(Class.java:261)
>         at
> 
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:14
>  5)
>         at
> 
org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcess
>  or.java:282)
>         at
> 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:220)
>
>         at
>  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
>         at
>  org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at
> 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
>  FilterChain.java:237)
>         at
> 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
>  ain.java:157)
>         at
> 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
>  va:214)
>         at
> 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
>  t.java:104)
>         at
> 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>         at
> 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
>  Valve.java:198)
>         at
> 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
>  va:152)
>         at
> 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
>  t.java:104)
>         at
> 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>         at
> 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
>  )
>         at
> 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
>  t.java:104)
>         at
> 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
>  )
>         at
> 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
>  t.java:102)
>         at
> 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>         at
> 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
>  :109)
>         at
> 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
>  t.java:104)
>         at
> 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>         at
>  org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>         at
>  org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>         at
>  org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
>         at
>  org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
>         at 
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
>
>         at
> 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
>
>         at
>  org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
>         at
> 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
>  a:683)
>         at java.lang.Thread.run(Thread.java:534)
>  ---------------------------------------
>
>  Here is my BaseIbatisDAO :
>
>  public class BaseIbatisDAO {
>     private static BaseIbatisDAO instance = new BaseIbatisDAO();
>     private static Logger log =
>  Logger.getLogger(BaseIbatisDAO.class.getName());
>     protected static SqlMapClient sqlMap;
>   static
>   {
>     try
>     {
>             log.debug("Attempting to initialize SqlMap");
>       Reader reader =
>  Resources.getResourceAsReader("aaa/bbb/ccc/SqlMapConfig.xml");
>       sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
>       reader.close();
>     } catch (IOException e) {
>       // Fail fast.
>       throw new RuntimeException("Something bad happened while building 
the
>  SqlMapClient instance." + e, e);
>     }
>   }
>  -------------------------------------
>  SqlMapConfig.xml:
>
>  <sqlMapConfig>
>
>   <!-- Configure a built-in transaction manager.  If you're using an app 
server, you probably want to use its transaction manager       and a 
managed datasource -->
>   <transactionManager type="JDBC" commitRequired="false">
>
>  <!--DataSource provided by the container -->
>      <dataSource type="JNDI">
>        <property name="DataSource"
>  value="java:comp/env/jdbc/DisclosureCoreDS" />
>      </dataSource>
>
>  </sqlMapConfig>
>  ------------------------------
>
>
>
>  Thanks :-)
>
>  Jun Li
>
>
>
>
>


Mime
View raw message