You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by Karel Rank <ka...@gmail.com> on 2009/05/11 22:19:18 UTC

Ibator - InvalidConfigurationException does not print errors

Hi,

I tried Ibator, but I had configuration problem in config XML. Ibator
printed stack trace with InvalidConfigurationException and nothing
else.

org.apache.ibatis.ibator.exception.InvalidConfigurationException
        at org.apache.ibatis.ibator.config.IbatorConfiguration.validate(IbatorConfiguration.java:74)
        at org.apache.ibatis.ibator.api.Ibator.<init>(Ibator.java:110)
        at org.apache.ibatis.ibator.api.IbatorRunner.main(IbatorRunner.java:102)

Here is a patch which overrides method Exception.getMessage. This
method now prints whole list of errors passed to instance
InvalidConfigurationException. Now in case of throwing exception,
stack trace looks like this:

org.apache.ibatis.ibator.exception.InvalidConfigurationException: One
or more errors in configuration!
1. SQL Statement is required if a generated key is specified in table
configuration for table adnot.sites
2. SQL Statement is required if a generated key is specified in table
configuration for table adnot.adverts
        at org.apache.ibatis.ibator.config.IbatorConfiguration.validate(IbatorConfiguration.java:74)
        at org.apache.ibatis.ibator.api.Ibator.<init>(Ibator.java:110)
        at org.apache.ibatis.ibator.api.IbatorRunner.main(IbatorRunner.java:102)

The patch is also fixing indentation of code (changing tabs to 4 spaces)

Is this patch useful? Are there any comments or suggestions?

Best Regards
Karel Rank

Re: Ibator - InvalidConfigurationException does not print errors

Posted by Jeff Butler <je...@gmail.com>.
It's fixed in SVN.

Jeff Butler

On Tue, May 12, 2009 at 2:32 AM, Karel Rank <ka...@gmail.com> wrote:
> On Tue, May 12, 2009 at 12:38 AM, Jeff Butler <je...@gmail.com> wrote:
>> This is a good catch!  I'd like to fix it a different way to keep
>> consistency with the Ant and Eclipse client implementations.  Thanks
>> for the heads up!
>>
>> Jeff Butler
>>
>> On Mon, May 11, 2009 at 3:19 PM, Karel Rank <ka...@gmail.com> wrote:
>>> Hi,
>>>
>>> I tried Ibator, but I had configuration problem in config XML. Ibator
>>> printed stack trace with InvalidConfigurationException and nothing
>>> else.
>>>
>>> org.apache.ibatis.ibator.exception.InvalidConfigurationException
>>>        at org.apache.ibatis.ibator.config.IbatorConfiguration.validate(IbatorConfiguration.java:74)
>>>        at org.apache.ibatis.ibator.api.Ibator.<init>(Ibator.java:110)
>>>        at org.apache.ibatis.ibator.api.IbatorRunner.main(IbatorRunner.java:102)
>>>
>>> Here is a patch which overrides method Exception.getMessage. This
>>> method now prints whole list of errors passed to instance
>>> InvalidConfigurationException. Now in case of throwing exception,
>>> stack trace looks like this:
>>>
>>> org.apache.ibatis.ibator.exception.InvalidConfigurationException: One
>>> or more errors in configuration!
>>> 1. SQL Statement is required if a generated key is specified in table
>>> configuration for table adnot.sites
>>> 2. SQL Statement is required if a generated key is specified in table
>>> configuration for table adnot.adverts
>>>        at org.apache.ibatis.ibator.config.IbatorConfiguration.validate(IbatorConfiguration.java:74)
>>>        at org.apache.ibatis.ibator.api.Ibator.<init>(Ibator.java:110)
>>>        at org.apache.ibatis.ibator.api.IbatorRunner.main(IbatorRunner.java:102)
>>>
>>> The patch is also fixing indentation of code (changing tabs to 4 spaces)
>>>
>>> Is this patch useful? Are there any comments or suggestions?
>>>
>>> Best Regards
>>> Karel Rank
>>>
>>
>
> Welcome!
>
> karl
>

Re: Ibator - InvalidConfigurationException does not print errors

Posted by Karel Rank <ka...@gmail.com>.
On Tue, May 12, 2009 at 12:38 AM, Jeff Butler <je...@gmail.com> wrote:
> This is a good catch!  I'd like to fix it a different way to keep
> consistency with the Ant and Eclipse client implementations.  Thanks
> for the heads up!
>
> Jeff Butler
>
> On Mon, May 11, 2009 at 3:19 PM, Karel Rank <ka...@gmail.com> wrote:
>> Hi,
>>
>> I tried Ibator, but I had configuration problem in config XML. Ibator
>> printed stack trace with InvalidConfigurationException and nothing
>> else.
>>
>> org.apache.ibatis.ibator.exception.InvalidConfigurationException
>>        at org.apache.ibatis.ibator.config.IbatorConfiguration.validate(IbatorConfiguration.java:74)
>>        at org.apache.ibatis.ibator.api.Ibator.<init>(Ibator.java:110)
>>        at org.apache.ibatis.ibator.api.IbatorRunner.main(IbatorRunner.java:102)
>>
>> Here is a patch which overrides method Exception.getMessage. This
>> method now prints whole list of errors passed to instance
>> InvalidConfigurationException. Now in case of throwing exception,
>> stack trace looks like this:
>>
>> org.apache.ibatis.ibator.exception.InvalidConfigurationException: One
>> or more errors in configuration!
>> 1. SQL Statement is required if a generated key is specified in table
>> configuration for table adnot.sites
>> 2. SQL Statement is required if a generated key is specified in table
>> configuration for table adnot.adverts
>>        at org.apache.ibatis.ibator.config.IbatorConfiguration.validate(IbatorConfiguration.java:74)
>>        at org.apache.ibatis.ibator.api.Ibator.<init>(Ibator.java:110)
>>        at org.apache.ibatis.ibator.api.IbatorRunner.main(IbatorRunner.java:102)
>>
>> The patch is also fixing indentation of code (changing tabs to 4 spaces)
>>
>> Is this patch useful? Are there any comments or suggestions?
>>
>> Best Regards
>> Karel Rank
>>
>

Welcome!

karl

Re: Ibator - InvalidConfigurationException does not print errors

Posted by Jeff Butler <je...@gmail.com>.
This is a good catch!  I'd like to fix it a different way to keep
consistency with the Ant and Eclipse client implementations.  Thanks
for the heads up!

Jeff Butler

On Mon, May 11, 2009 at 3:19 PM, Karel Rank <ka...@gmail.com> wrote:
> Hi,
>
> I tried Ibator, but I had configuration problem in config XML. Ibator
> printed stack trace with InvalidConfigurationException and nothing
> else.
>
> org.apache.ibatis.ibator.exception.InvalidConfigurationException
>        at org.apache.ibatis.ibator.config.IbatorConfiguration.validate(IbatorConfiguration.java:74)
>        at org.apache.ibatis.ibator.api.Ibator.<init>(Ibator.java:110)
>        at org.apache.ibatis.ibator.api.IbatorRunner.main(IbatorRunner.java:102)
>
> Here is a patch which overrides method Exception.getMessage. This
> method now prints whole list of errors passed to instance
> InvalidConfigurationException. Now in case of throwing exception,
> stack trace looks like this:
>
> org.apache.ibatis.ibator.exception.InvalidConfigurationException: One
> or more errors in configuration!
> 1. SQL Statement is required if a generated key is specified in table
> configuration for table adnot.sites
> 2. SQL Statement is required if a generated key is specified in table
> configuration for table adnot.adverts
>        at org.apache.ibatis.ibator.config.IbatorConfiguration.validate(IbatorConfiguration.java:74)
>        at org.apache.ibatis.ibator.api.Ibator.<init>(Ibator.java:110)
>        at org.apache.ibatis.ibator.api.IbatorRunner.main(IbatorRunner.java:102)
>
> The patch is also fixing indentation of code (changing tabs to 4 spaces)
>
> Is this patch useful? Are there any comments or suggestions?
>
> Best Regards
> Karel Rank
>