Return-Path: Delivered-To: apmail-incubator-ibatis-user-java-archive@www.apache.org Received: (qmail 49646 invoked from network); 23 Apr 2005 19:43:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Apr 2005 19:43:01 -0000 Received: (qmail 34310 invoked by uid 500); 23 Apr 2005 19:43:30 -0000 Delivered-To: apmail-incubator-ibatis-user-java-archive@incubator.apache.org Received: (qmail 34067 invoked by uid 500); 23 Apr 2005 19:43:29 -0000 Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Precedence: bulk Reply-To: ibatis-user-java@incubator.apache.org List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 34054 invoked by uid 99); 23 Apr 2005 19:43:28 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.cruzio.com (HELO mail.cruzio.com) (63.249.95.37) by apache.org (qpsmtpd/0.28) with ESMTP; Sat, 23 Apr 2005 12:43:28 -0700 Received: from waddell.cruzio.com (dsl3-63-249-87-17.cruzio.com [63.249.87.17]) by mail.cruzio.com with ESMTP id j3NJgpov016937 for ; Sat, 23 Apr 2005 12:42:56 -0700 (PDT) Message-Id: <6.2.0.14.2.20050423124039.02ca6a48@mail.cruzio.com> X-Mailer: QUALCOMM Windows Eudora Version 6.2.0.14 Date: Sat, 23 Apr 2005 12:42:57 -0700 To: ibatis-user-java@incubator.apache.org From: Richard Yee Subject: RE: Ibatis DAO In-Reply-To: <4269ca7a.0c40f250.1ca8.ffffa92c@mx.gmail.com> References: <2fe5ef5b05042221005ff5df1e@mail.gmail.com> <4269ca7a.0c40f250.1ca8.ffffa92c@mx.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Is the reader null? I don't see the "Could not initialize DaoConfig." in=20 your stack trace. To help you debug, you might try putting the code in the= =20 init() method instead of a static initializer. Then at least the class=20 would get loaded. -Richard At 09:09 PM 4/22/2005, you wrote: >Yes thats true, but the static method that sets the DAO_MANAGER is failing > > > >-----Original Message----- >From: Brandon Goodin [mailto:brandon.goodin@gmail.com] >Sent: Saturday, April 23, 2005 12:01 AM >To: ibatis-user-java@incubator.apache.org >Subject: Re: Ibatis DAO > >Use this class to get retrieve your daoManager. I know this works. >when you want to get the daoManager simply have your calling class >call DaoConfig.getDaoManager(); > >---- start class ---- > >public class DaoConfig { > > private static final DaoManager daoManager; > > static { > > try { > String resource =3D "net/naijatek/fgconline/persistence/dao.xml"; > Reader reader =3D Resources.getResourceAsReader(resource); > daoManager =3D DaoManagerBuilder.buildDaoManager(reader); > } catch (Exception e) { > throw new RuntimeException("Could not initialize DaoConfig. >Cause: " + e); > } > } > > public static DaoManager getDaoManager() { > return daoManager; > } > >} > >---- end class ---- > >On 4/22/05, Folashade Adeyosoye wrote: > > > > > > > > Thanks for responding, that is what actually baffles me. > > > > > > > > What I actually try to do is load JPetstore4 into JBuilder2005 and get= it >to > > run, but every time I run it trows an exception at the same spot. > > > > > > > > Not sure if it's a JBuilder thing or the jar file that I have for = iBatis > > DAO which is ibatis-dao-2.jar > > > > > > > > Thanks > > > > > > > > > > > > ________________________________ > > > > > > From: Larry Meadors [mailto:larry.meadors@gmail.com] > > Sent: Friday, April 22, 2005 11:48 PM > > To: ibatis-user-java@incubator.apache.org > > Subject: Re: Ibatis DAO > > > > > > > > > > We need more info on this one. > > > > There is nothing in that stack trace to indicate any sort of issue with > > iBATIS. > > > > Throw us a bone here. > > > > Larry > > > > > > On 4/22/05, Folashade Adeyosoye wrote: > > > > > > Any help would be appreciated=85. > > > > > > > > I am having a difficult time getting the iBatis DAO going=85 > > > > > > > > > > > > > > > > static { > > > > > > > > try { > > > > String resource =3D > > "net/naijatek/fgconline/persistence/dao.xml"; > > > > Reader reader =3D Resources.getResourceAsReader(resource); > > > > DAO_MANAGER =3D > > DaoManagerBuilder.buildDaoManager(reader); =E7 =3D=3D=3D=3D=3D=3D=3D= =3D=3D It > > crashes right here > > > > } catch (Exception e) { > > > > throw new RuntimeException("Could not initialize DaoConfig. = Cause: >" > > + e); > > > > } > > > > } > > > > > > > > > > > > > > > > With these error, and yes I do have the jar file in my classpath. thanks > > > > > > > > > > > > > > > > WebappLoader[/fgcsys]: Reloading checks are enabled for this Context > > > > StandardManager[/fgcsys]: Seeding random number generator class > > java.security.SecureRandom > > > > StandardManager[/fgcsys]: Seeding of random number generator has been > > completed > > > > INFO [2005-Apr-22 02:40:59] - util.SystemProp(SystemProp.java:30) -= Loaded > > the Property file... system.properties > > > > INFO [2005-Apr-22 02:41:00] - util.AppProp(AppProp.java:31) - Loaded the > > Property file... ApplicationResources.properties > > > > INFO [2005-Apr-22 02:41:00] - > > framework.FGCExtendedActionServlet(FGCExtendedActionServlet.java:43) > > - FGCBaseActionServlet init()... > > > > StandardContext[/fgcsys]: Servlet /fgcsys threw load() exception: > > javax.servlet.ServletException: Servlet.init() for servlet fgcsys threw > > exception > > > > javax.servlet.ServletException: Servlet.init() for servlet fgcsys threw > > exception > > > > at > > >org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:9= 6 >3) > > > > at > > org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823) > > > > at > > >org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java= : >3427) > > > > at > >= org.apache.catalina.core.StandardContext.start(StandardContext.java:3628) > > > > at > > >org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:= 8 >21) > > > > at > > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) > > > > at > > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) > > > > at > > >org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer= . >java:700) > > > > at > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > >sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3= 9 >) > > > > at > > >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp= l >.java:25) > > > > at java.lang.reflect.Method.invoke(Method.java:324) > > > > at > > >org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252) > > > > at > > org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256) > > > > at > > org.apache.commons.digester.Rule.end(Rule.java:276) > > > > at > > org.apache.commons.digester.Digester.endElement(Digester.java:1058) > > > > at > > org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown > > Source) > > > > at > > org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown > > Source) > > > > at > > org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown > > Source) > > > > at > > >org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unkn= o >wn > > Source) > > > > at > > >org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootEle= m >entHook(Unknown > > Source) > > > > at > > >org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispat= c >her.dispatch(Unknown > > Source) > > > > at > >= org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown > > Source) > > > > at > > org.apache.xerces.parsers.XML11Configuration.parse(Unknown > > Source) > > > > at > > org.apache.xerces.parsers.DTDConfiguration.parse(Unknown > > Source) > > > > at > > org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > > > > at > > org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown > > Source) > > > > at > > org.apache.commons.digester.Digester.parse(Digester.java:1567) > > > > at > > >org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.= j >ava:385) > > > > at > > org.apache.catalina.core.StandardHost.install(StandardHost.java:819) > > > > at > > >org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:44= 2 >) > > > > at > > org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:399) > > > > at > > org.apache.catalina.startup.HostConfig.start(HostConfig.java:718) > > > > at > >= org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:358) > > > > at > > >org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppo= r >t.java:166) > > > > at > > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196) > > > > at > > org.apache.catalina.core.StandardHost.start(StandardHost.java:754) > > > > at > > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) > > > > at > > org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363) > > > > at > > org.apache.catalina.core.StandardService.start(StandardService.java:497) > > > > at > > org.apache.catalina.core.StandardServer.start(StandardServer.java:2190) > > > > at > > org.apache.catalina.startup.Catalina.start(Catalina.java:512) > > > > at > > org.apache.catalina.startup.Catalina.execute(Catalina.java:400) > > > > at > > org.apache.catalina.startup.Catalina.process(Catalina.java:180) > > > > at > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > >sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3= 9 >) > > > > at > > >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp= l >.java:25) > > > > at java.lang.reflect.Method.invoke(Method.java:324) > > > > at > > org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) > > > >