You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Pablo Lopez <44...@unizar.es> on 2005/04/25 16:34:04 UTC

automatic exception on IDEs

Hi everyone,

A silly thing is annoying me in my every-day use with iBatis under an IDE.

The matter is the following: every time I put some ibatis-dependent code 
on the initialization or "on_load" event in a graphic element under an 
IDE, it throws an exception cause it can't find sqlmap.config, etc.. 
because it the IDE is trying to render it at design time.

I mean, if I'm designing a GUI with an IDE and for example in a 
tabControl I put a listBox that should automatically load a list of 
users from a database using an ibatis statement, every time I click on 
the designer it throws an exception cause the actual "path" is the IDEs 
execution directory (which is executing the constructor and onclick 
event automatically) and it obviously can't find the configuration files 
and the like there.

Any ideas on how to solve this issue?

Thanks a lot,

Pablo.


Re: automatic exception on IDEs

Posted by Gilles Bayon <ib...@gmail.com>.
Can you send us the code of your UserControl, at least the constructor code.

-Gilles

Re: automatic exception on IDEs

Posted by Pablo Lopez <pl...@tecisa74.com>.
Gilles Bayon wrote:
> The initialisation must be done on the init of the application and not
> on an element of the UI.
> -Gilles

Thanks a lot Gilles, but let me explain it more clearly cause even 
though I understand what you mean I don't really get the point...

The fact:

I've designed a UserControl (component) which is basically a listBox 
that "loads a list of users using iBatis" in its constructor. I want 
that component to be that: a component, working by itself. There are no 
problems when designing the component, everything is fine.

The problem arises when I drag that component to a Form in a particular 
application, cause the IDE tries to instantiate my UserControl and the 
environment is set to the IDE's, not to my component. It happens when I 
drag it and it happens every time I click on it (for example if it's on 
a tabControl) and it tries to render (thus instantiating) it.

The funny thing is that if I just comment the "load a list of users 
using iBatis" from my UserControl's constructor, I can drag it, click on 
it, etc... and then just save and close the design view of my 
application, uncomment it, and compile it.

It obviously compiles and runs okay, but as you can imagine doing that 
kind of stuff everytime I need to change something in mi design really 
sucks.

I don't really find an easy way to program graphical UserControls 
(independent components) which use iBatis on the constructur which I can 
just drag to my application.

Thanks a lot for your patience,

Pablo.

Re: automatic exception on IDEs

Posted by Gilles Bayon <ib...@gmail.com>.
The initialisation must be done on the init of the application and not
on an element of the UI.
-Gilles