ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Yee <r...@cruzio.com>
Subject RE: Ibatis DAO
Date Sat, 23 Apr 2005 19:42:57 GMT
Is the reader null? I don't see the "Could not initialize DaoConfig." in 
your stack trace. To help you debug, you might try putting the code in the 
init() method instead of a static initializer. Then at least the class 
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 = "net/naijatek/fgconline/persistence/dao.xml";
>       Reader reader = Resources.getResourceAsReader(resource);
>       daoManager = 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 <shardayyy@gmail.com> 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 <shardayyy@naijatek.com> wrote:
> >
> >
> > Any help would be appreciated….
> >
> >
> >
> > I am having a difficult time getting the iBatis DAO going…
> >
> >
> >
> >
> >
> >
> >
> >   static {
> >
> >
> >
> >     try {
> >
> >       String resource =
> > "net/naijatek/fgconline/persistence/dao.xml";
> >
> >       Reader reader = Resources.getResourceAsReader(resource);
> >
> >       DAO_MANAGER =
> > DaoManagerBuilder.buildDaoManager(reader);   ç ========= 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:96
>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:39
>)
> >
> >             at
> >
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
>.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(Unkno
>wn
> > Source)
> >
> >             at
> >
>org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElem
>entHook(Unknown
> > Source)
> >
> >             at
> >
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
>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:442
>)
> >
> >             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(LifecycleSuppor
>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:39
>)
> >
> >             at
> >
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
>.java:25)
> >
> >             at java.lang.reflect.Method.invoke(Method.java:324)
> >
> >             at
> > org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> >
> >



Mime
View raw message