You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Bruce Snyder <br...@gmail.com> on 2006/12/03 19:13:14 UTC

Re: jdbcAuditor mssqlserver: No suitable driver

On 11/30/06, stephan.lux <st...@directline.de> wrote:
>
> Hi,
> I have added a jdbcAuditor to my servicemix.xml and a dataSource bean
> definition pointing to the microsoft mssql drivers. If I now start the
> servicemix container (3.0-incubating) I receive the following stacktrace :
>
> Caught: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'org.apache.servicemix.jbi.audit.jdbc.JdbcAuditor'
> defi
> ned in class path resource [servicemix.xml]: Invocation of init method
> failed; nested exception is java.io.IOException: Exception while creating
> datab
> ase
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'org.apache.servicemix.jbi.audit.jdbc.JdbcAuditor' defined in c
> lass path resource [servicemix.xml]: Invocation of init method failed;
> nested exception is java.io.IOException: Exception while creating database
> Caused by: java.io.IOException: Exception while creating database
>         at
> org.apache.servicemix.jbi.audit.jdbc.JdbcAuditor.afterPropertiesSet(JdbcAuditor.java:97)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:957)
>
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:924)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:415)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:242)
>         at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:239)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:155)
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:303)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
>         at
> org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:161)
>         at
> org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:51)
>         at org.apache.servicemix.Main.main(Main.java:52)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
> Caused by: java.sql.SQLException: No suitable driver
>         at java.sql.DriverManager.getConnection(DriverManager.java:545)
>         at java.sql.DriverManager.getConnection(DriverManager.java:140)
>         at
> org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:291)
>         at
> org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:277)
>         at
> org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:259)
>         at
> org.springframework.jdbc.datasource.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:241)
>         at
> org.apache.servicemix.jbi.audit.jdbc.JdbcAuditor.afterPropertiesSet(JdbcAuditor.java:85)
>         ... 19 more
>
> But the database was created successfully on the mssql server.
> Does anyone have an idea what is going wrong here?

Stephan, where did you place the JAR containing the drivers? Maybe
it's not available to all classloaders.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Re: jdbcAuditor mssqlserver: No suitable driver

Posted by "stephan.lux" <st...@directline.de>.

stephan.lux wrote:
> 
> This is what I have tried before: Using the JDBCAuditor with the same
> configuration, besides the database driver, username and password ;-)
> 
> What is wrong in this configuration? Setting the classpath with
> <classpath>
>   <location>/lib/mydriver.jar</location>
> </classpath>
> does also not work...
> 



-- 
View this message in context: http://www.nabble.com/jdbcAuditor-mssqlserver%3A-No-suitable-driver-tf2732402s12049.html#a7836388
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: jdbcAuditor mssqlserver: No suitable driver

Posted by t rajesh <it...@yahoo.co.in>.
I am not getting the exact problem, but i face similar kind of problem when i configure to postgresql. i done it as follows
   
  1. i placed the postgre sql jar  file in the lib
  2. i configure the datasource as follows
            <audit:jdbcAuditor container="#jbi" autoStart="true">
      <audit:dataSource> 
        <bean class="org.postgresql.jdbc2.optional.SimpleDataSource">
          <property name="databaseName" value="servicemixDB" />
          <property name="user" value="postgres" />
          <property name="password" value="ZAQ!" />
        </bean>
      </audit:dataSource> 
      
  </audit:jdbcAuditor>
  3. i didnt change anything other than this 
   
  if am wrong or out-of your scope let me know 

"stephan.lux" <st...@directline.de> wrote:
  

stephan.lux wrote:
> 
> I still have not solved my problem with the classpath... I have tried to
> set the classpath exactly to the required jars, but without success. 
> 
> Now I have written an own listener class extending the AbstractAuditor
> which has also the same issue! I have copied the auditor class and the sql
> drivers into the lib folder and added the following bean definition into
> the servicemix.xml: 
> 
> 
> > class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> ...
> 
> 
> 
> 
> 

> 
> 

> 
> 
> 
> ...
> 
> I dont understand, why the container finds my auditor class (log.info in
> setContainer appers in the console) , but not the sql driver class???
> 
> I am grateful for each tip.
> Stephan
> 

Stephan, where did you place the JAR containing the drivers? Maybe
it's not available to all classloaders.

Bruce
-- 
perl -e 'print
unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/



-- 
View this message in context: http://www.nabble.com/jdbcAuditor-mssqlserver%3A-No-suitable-driver-tf2732402s12049.html#a7836091
Sent from the ServiceMix - User mailing list archive at Nabble.com.



 				
---------------------------------
 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW

Re: jdbcAuditor mssqlserver: No suitable driver

Posted by "stephan.lux" <st...@directline.de>.

stephan.lux wrote:
> 
> I still have not solved my problem with the classpath... I have tried to
> set the classpath exactly to the required jars, but without success. 
> 
> Now I have written an own listener class extending the AbstractAuditor
> which has also the same issue! I have copied the auditor class and the sql
> drivers into the lib folder and added the following bean definition into
> the servicemix.xml: 
> 
> <beans xmlns:sm="http://servicemix.apache.org/config/1.0">
> 	<bean id="auditDataSource"
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> ...
> 	</bean>
> 	<sm:container id="jbi" ...>
>   	  <sm:listeners>
> 	    <bean id="databaseAuditor" class="DatabaseAuditor"> 
> 	        <property name="dataSource">
> 		<ref local="auditDataSource"/>
> 	        </property>
>   	    </bean>
> 	</sm:listeners>
> 	</sm:container>
> ...
> 
> I dont understand, why the container finds my auditor class (log.info in
> setContainer appers in the console) , but not the sql driver class???
> 
> I am grateful for each tip.
> Stephan
> 

Stephan, where did you place the JAR containing the drivers? Maybe
it's not available to all classloaders.

Bruce
-- 
perl -e 'print
unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/



-- 
View this message in context: http://www.nabble.com/jdbcAuditor-mssqlserver%3A-No-suitable-driver-tf2732402s12049.html#a7836091
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: jdbcAuditor mssqlserver: No suitable driver

Posted by "stephan.lux" <st...@directline.de>.

stephan.lux wrote:
> 
> Hi Bruce, 
> 
> I have placed the jars first into the SM/lib/optional and then now into
> the SM/lib directory. But  I still receive the no suitable driver error. 
> 
> Any more ideas? 
> Stephan
> 
> 
Stephan, where did you place the JAR containing the drivers? Maybe
it's not available to all classloaders.

Bruce
-- 
perl -e 'print
unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

-- 
View this message in context: http://www.nabble.com/jdbcAuditor-mssqlserver%3A-No-suitable-driver-tf2732402s12049.html#a7673170
Sent from the ServiceMix - User mailing list archive at Nabble.com.