onjour. je m'étais trompé en postant cette question dans le forum général Java. Je le reposte donc dans le bon endroit qui est ici. Merci de me comprendre
quelqu'un pourrait m'aider j'essaie de configurer une datasource via
jonas.
Mon fichier de configuration dans %JONAS_HOME%\conf s'appelle sqlServer et contient:
###################### InterBase DataSource configuration example
#
#####
# DataSource configuration
#
datasource.name sqlServerJDBC
datasource.url jdbc:odbc:Base
#datasource.url jdbc:interbase://localhost//dbs/orders.gdb
#datasource.url jdbc:interbase://localhost/C:/dbs/orders.gdb
datasource.classname sun.jdbc.odbc.JdbcOdbcDriver
datasource.username user1
datasource.password password1
datasource.isolationlevel read_committed
datasource.mapper rdb.sqlserver
#####
# ConnectionManager configuration
#
# JDBC connection checking level.
# 0 = no special checking
# 1 = check physical connection is still open before reusing it
# 2 = try every connection before reusing it
jdbc.connchecklevel 0
# Max age for jdbc connections
# nb of minutes a connection can be kept in the pool
jdbc.connmaxage 1440
# Maximum time (in mn) a connection can be left busy.
# If the caller has not issued a close() during this time, the connection
# will be closed automatically.
jdbc.maxopentime 60
# Test statement
jdbc.connteststmt select * from rdb$types
# JDBC Connection Pool size.
# Limiting the max pool size avoids errors from database.
jdbc.minconpool 5
jdbc.maxconpool 15
# Sampling period for JDBC monitoring :
# nb of seconds between 2 measures.
jdbc.samplingperiod 30
# Maximum time (in seconds) to wait for a connection in case of shortage.
# This may occur only when maxconpool is reached.
jdbc.maxwaittime 5
# Maximum of concurrent waiters for a JDBC Connection
# This may occur only when maxconpool is reached.
jdbc.maxwaiters 100
J'ai bien declare ce fichier dans jonas.properties a la ligne
jonas.service.dbm.datasources HSQL1,sqlServer
J'ai bien configure les fichiers xml des beans avec l'attention qu'il faut et lorsque je veux recuperer une datasource cette erreur survient
Exception in thread "main" java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: RuntimeException thrown by an enterprise Bean; nested exception is:
java.lang.ClassCastException: org.objectweb.jonas.dbm.ConnectionManager
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.runDispatch(JUnicastServerRef.java:160)
at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:145)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at org.objectweb.carol.rmi.jrmp.server.JRemoteCall.executeCall(JRemoteCall.java:89)
at org.objectweb.carol.rmi.jrmp.server.JUnicastRef.invoke(JUnicastRef.java:161)
at odel.beans.rulephonbean.JOnASRulePhonBeanEJB864899217Home_Stub.create(Unknown Source)
at odel.beans.rulephonbean.RulePhonBeanClient.main(RulePhonBeanClient.java:26)
Caused by: java.rmi.RemoteException: RuntimeException thrown by an enterprise Bean; nested exception is:
java.lang.ClassCastException: org.objectweb.jonas.dbm.ConnectionManager
at odel.beans.rulephonbean.JOnASRulePhonBeanEJB864899217Home.create(JOnASRulePhonBeanEJB864899217Home.java:101)
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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.runDispatch(JUnicastServerRef.java:160)
at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:145)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassCastException: org.objectweb.jonas.dbm.ConnectionManager
at odel.beans.utils.ServiceLocator.getDataSource(ServiceLocator.java:81)
at odel.beans.rulephonbean.RulePhonBeanEJB.ejbCreate(RulePhonBeanEJB.java:128)
at odel.beans.rulephonbean.JOnASRulePhonBeanEJB864899217Home.create(JOnASRulePhonBeanEJB864899217Home.java:81)
... 13 more
J'ai parcouru tout le forum. J'ai vu une ou deux personnes qui avaient ce probleme mais aucune résolution n'a été apportée.
Quelqu'un pourrait m'aider
[Modéré par Didier] : ajout de tag dans le titre - Les règles du forum Java
Partager