Move the typeAliases section above environments. Larry
On Wed, Dec 9, 2009 at 2:54 PM, Soks86 <michael.chrostow...@gmail.com> wrote: > > Hi, > > I have created the following configuration file for my Ibatis > SqlSessionFactoryBuilder. > > <?xml version="1.0" encoding="UTF-8" ?> > <!DOCTYPE configuration > PUBLIC "-//ibatis.apache.org//DTD Config 3.0//EN" > "http://ibatis.apache.org/dtd/ibatis-3-config.dtd"> > <configuration> > <environments default="development"> > <environment id="development"> > <transactionManager type="JDBC" /> > <dataSource type="POOLED"> > <property name="driver" > value="org.apache.derby.jdbc.EmbeddedDriver" /> > <property name="url" > value="jdbc:derby:/home/mchrosto/MyTestDB;create=true" > /> > <!-- > <property name="username" value="${username}" /> > <property > name="password" value="${password}" /> > --> > </dataSource> > </environment> > </environments> > <typeAliases> > <typeAlias alias="TradableDao" > type="com.icarus.common.strategies.dao.TradableDao" /> > <typeAlias alias="Tradable" > type="com.icarus.common.strategies.Tradable" /> > </typeAliases> > <mappers> > <mapper resource="src/main/resources/IbatisMaps/TradableDao.xml" /> > </mappers> > </configuration> > > > If I remove the <typeAliases> portion (and rename my aliases inside of > TradableDao.xml) then it works just fine. However when I put the aliases in > (exactly as shown above) I get XML parsing exceptions... in particular: > > ### Error building SqlSession. > ### The error may exist in SQL Mapper Configuration > ### Cause: org.apache.ibatis.builder.BuilderException: Error creating > document instance. Cause: org.xml.sax.SAXParseException: The content of > element type "configuration" must match > "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,plugins?,environments?,mappers?)". > > Also my IDE (Eclipse) complains that the xml file is not compliant with the > DTD file... all of this goes away if I remove my aliases. > > Anyone have any idea why this might be ocuring? I'm alright for now without > aliases but as I get farther and farther into iBATIS I fear that I will need > them to stay sane. > > Just to be clear this is iBATIS 3 - Beta 5 and should be the latest file > from repository.sonatype.org. > > Thanks in advance for any help! > > Michael Chrostowski > -- > View this message in context: > http://old.nabble.com/Issues-with-Ibatis-Configuration-File-tp26718012p26718012.html > Sent from the iBATIS - User - Java mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org > For additional commands, e-mail: user-java-h...@ibatis.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org