ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J..@fec.gov
Subject java.lang.NoClassDefFoundError error again, need help!
Date Fri, 13 Apr 2007 16:01:11 GMT
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(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)
---------------------------------------

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