ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yee, Richard K CTR DMDC" <Richard.Yee....@osd.pentagon.mil>
Subject RE: java.lang.NoClassDefFoundError error again, need help!
Date Fri, 13 Apr 2007 17:16:54 GMT
You could have an error in your SqlMapConfig.xml. Change the catch block in
your static initializer to catch Exception and print the stack trace or use
a debugger as Larry suggested.

-Richard


-----Original Message-----
From: JLi@fec.gov [mailto:JLi@fec.gov] 
Sent: Friday, April 13, 2007 10:06 AM
To: user-java@ibatis.apache.org
Subject: Re: java.lang.NoClassDefFoundError error again, need help!


Yes, I agree with you, but I couldn't see anything wrong with BaseIbatisDAO
. 

Thanks. 

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\BaseIbatis
> DAO.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(WebappC
> lassLo
>  ader.java:1634)
>         at
>  
> org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoad
> er.jav
>  a:860)
>         at
>  
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoad
> er.jav
>  a:1307)
>         at
>  
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoad
> er.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$(DisclosureSearc
> hSubmi
>  tAction.java:34)
>         at
>  
> gov.fec.disclosure.DisclosureSearchSubmitAction.<clinit>(DisclosureSea
> rchSub
>  mitAction.java:35)
>         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>  Method)
>         at
>  
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructo
> rAcces
>  sorImpl.java:39)
>         at
>  
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCo
> nstruc
>  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.j
> ava:14
>  5)
>         at
>  
> org.apache.struts.action.RequestProcessor.processActionCreate(RequestP
> rocess
>  or.java:282)
>         at
>  
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.jav
> a: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(Appli
> cation
>  FilterChain.java:237)
>         at
>  
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lterCh
>  ain.java:157)
>         at
>  
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
> lve.ja
>  va:214)
>         at
>  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValve
> Contex
>  t.java:104)
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>         at
>  
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardC
> ontext
>  Valve.java:198)
>         at
>  
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
> lve.ja
>  va:152)
>         at
>  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValve
> Contex
>  t.java:104)
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>         at
>  
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
> va:137
>  )
>         at
>  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValve
> Contex
>  t.java:104)
>         at
>  
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
> va:118
>  )
>         at
>  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValve
> Contex
>  t.java:102)
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>         at
>  
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
> e.java
>  :109)
>         at
>  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValve
> Contex
>  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.jav
> a:675)
>
>         at
>  org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
>         at
>  
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPo
> ol.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