You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Clinton Begin (JIRA)" <ib...@incubator.apache.org> on 2008/04/07 15:14:24 UTC

[jira] Commented: (IBATIS-500) Failure when using maxRequests in settings and misleading error message

    [ https://issues.apache.org/jira/browse/IBATIS-500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586378#action_12586378 ] 

Clinton Begin commented on IBATIS-500:
--------------------------------------

That's a really weird error... all three of those settings have been deprecated and no longer do anything.  I thought I left them in the DTD for backward compatibility, but looking through the logs, I did indeed remove them.  While harsh, this is actually a good thing... :-/

I'll send a note to the list and close this issue.

> Failure when using maxRequests in settings and misleading error message
> -----------------------------------------------------------------------
>
>                 Key: IBATIS-500
>                 URL: https://issues.apache.org/jira/browse/IBATIS-500
>             Project: iBatis for Java
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>            Reporter: Stephane Bailliez
>
> Putting that as major even though it is trivial since it affects migration and I guess users would scratch their head a bit more than necessary.
> Upgrade from 2.1.7 which had a sqlmap config with settings:
> {noformat}
>     <settings
>             cacheModelsEnabled="true"
>             enhancementEnabled="false"
>             lazyLoadingEnabled="false"
>             maxRequests="512"
>             maxSessions="128"
>             maxTransactions="32"
>             useStatementNamespaces="true"
>             errorTracingEnabled="true"
>             />
> {noformat}
> And got an error message that led me scratching my head for a while until I digged in the source code to figure out it was no more used. But the message is terribly misleading ( 'Attribute "maxRequests" must be declared for element type "settings".)
> Removing maxRequests, maxSession, maxTransactions from the settings solves the problem.
> {noformat}
> Caused by: java.lang.RuntimeException: Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: org.xml.sax.SAXParseException: Attribute "maxRequests" must be declared for element type "settings".
> 	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:65)
> 	at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:90)
> 	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:326)
> 	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:280)
> 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1333)
> 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1299)
> 	... 34 more
> Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: org.xml.sax.SAXParseException: Attribute "maxRequests" must be declared for element type "settings".
> 	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
> 	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:62)
> 	... 39 more
> Caused by: org.xml.sax.SAXParseException: Attribute "maxRequests" must be declared for element type "settings".
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
> 	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1306)
> 	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1971)
> 	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:816)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:872)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
> 	at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:189)
> 	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:59)
> 	... 40 more
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.