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 16:53:41 GMT
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