ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric VanWieren" <evanwie...@gmail.com>
Subject Re: mysql and jboss support
Date Tue, 08 Aug 2006 19:13:55 GMT
I would like to say thanks for all of the comments. I am not sure which one
said it, but something got me thinking about the datasources provided by
jboss. I ended up setting up a mysql datasource in jboss and then connecting
to it using the JNDI connector.

Here is the new section from my sqlMap-Config.xml file

<transactionManager type="JDBC">
    <dataSource type="JNDI">
        <property name="DataSource" value="java:SamplesDBDataSource" />
    </dataSource>
</transactionManager>

Once I put this in, and had the datasource configured correctly it worked.

Thanks for all of the input on this.

Eric

On 8/8/06, Chen, Tim <Tim.Chen@nielsenmedia.com> wrote:
>
>  Is there a reason that you put it into server/default/lib and not your
> ear?
>
>  ------------------------------
> *From:* Eric VanWieren [mailto:evanwieren@gmail.com]
> *Sent:* Tuesday, August 08, 2006 11:57 AM
>
> *To:* user-java@ibatis.apache.org
> *Subject:* Re: mysql and jboss support
>
> Thanks for all of the quick responses.  Here is the information that was
> asked for.
>
> I have the mysql-connector-java-5.0.3-bin.jar installed into the
> server/default/lib directory.
>
> I am using iBatis directly without spring. My config files look as such.
>
> sqlMap-Config.xml
> <properties resource="PATH_TO_PROPFILE/SqlMapConfig.properties" />
>
> <transactionManager type="JDBC">
>     <dataSource type="SIMPLE">
>         <property name="JDBC.Driver" value="${driver}" />
>         <property name="JDBC.ConnectionURL" value="${url}" />
>         <property name="JDBC.Username " value="${username}" />
>         <property name="JDBC.Password" value="${password}" />
>     </dataSource>
> </transactionManager>
>
>
> SqlMapConfig.properties
>
>
> driver=com.mysql.jdbc.Driver;
> url=jdbc:mysql://localhost:3306/database
> username=USERNAME
> password=PASSWORD
>
> When I attempt to create a SqlMapClient I get the following Error:
>
> 2006-08-08 11:53:50,561 ERROR [ com.ibatis.common.jdbc.SimpleDataSource]
> SimpleDataSource: Error while loading properties. Cause:
> java.lang.ClassNotFoundException: com/mysql/jdbc/Driver;
> java.lang.ClassNotFoundException: com/mysql/jdbc/Driver;
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:164)
>         at com.ibatis.common.resources.Resources.classForName(
> Resources.java:244)
>         at com.ibatis.common.resources.Resources.instantiate (
> Resources.java:260)
>         at com.ibatis.common.jdbc.SimpleDataSource.initialize(
> SimpleDataSource.java:196)
>         at com.ibatis.common.jdbc.SimpleDataSource.<init>(
> SimpleDataSource.java:116)
>         at
> com.ibatis.sqlmap.engine.datasource.SimpleDataSourceFactory.initialize(
> SimpleDataSourceFactory.java:31)
>         at
> com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$9.process(
> SqlMapConfigParser.java:301)
>         at com.ibatis.common.xml.NodeletParser.processNodelet(
> NodeletParser.java:112)......
> ....
>
> 2006-08-08 11:53:50,564 ERROR [STDERR]
> com.ibatis.common.exception.NestedRuntimeException: Error occurred.
> Cause: com.ibatis.common.xml.NodeletException : Error parsing XML.  Cause:
> com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath
> '/sqlMapConfig/transactionManager/dataSource/end()'.  Cause:
> com.ibatis.sqlmap.client.SqlMapException: Error initializing DataSource.
> Could not instantiate DataSourceFactory.  Cause:
> com.ibatis.common.exception.NestedRuntimeException: SimpleDataSource:
> Error while loading properties. Cause: java.lang.ClassNotFoundException:
> com/mysql/jdbc/Driver;
> Caused by: java.lang.ClassNotFoundException: com/mysql/jdbc/Driver;
>
>
>
>
> Thanks in advance. I am sure I am missing something silly, but for the
> life of me, I am at a loss.
>
> Eric
>

Mime
View raw message