put the following in standardjbosscmp.xml file. <defaults> <datasource>java:/OracleDS</datasource> <datasource-mapping>Oracle8</datasource-mapping> </defaults>
and here goes my working oracle-services.xml : <?xml version="1.0" encoding="UTF-8"?> <!-- ===================================================================== --> <!-- --> <!-- JBoss Server Configuration --> <!-- --> <!-- ===================================================================== --> <server> <!-- ==================================================================== --> <!-- ConnectionManager setup for Oracle dbs --> <!-- Build jmx-api (build/build.sh all) and view for config documentation --> <!-- Thanks to Steven Coy --> <!-- ==================================================================== --> <mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=OracleDS"> <!-- Include a login module configuration named OracleDbRealm. Update your login-conf.xml, here is an example for a ConfiguredIdentityLoginModule: <application-policy name = "OracleDbRealm"> <authentication> <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required"> <module-option name = "principal">yourprincipal</module-option> <module-option name = "userName">yourusername</module-option> <module-option name = "password">yourpassword</module-option> <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=OracleDS</mo dule-option> </login-module> </authentication> </application-policy> NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the module-option name = "managedConnectionFactoryName" must match the object name of the ConnectionManager you are configuring here. --> <!--comment out this line if you want component managed security or want to use the default values in the ManagedConnectionFactoryProperties <attribute name="SecurityDomainJndiName">OracleDbRealm</attribute> --> <depends optional-attribute-name="ManagedConnectionFactoryName"> <!--embedded mbean--> <mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=LocalTxDS,name=OracleDS"> <attribute name="JndiName">OracleDS</attribute> <attribute name="ManagedConnectionFactoryProperties"> <properties> <config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@10.1.0.26:1521:oradev</config-prop erty> <config-property name="DriverClass" type="java.lang.String">oracle.jdbc.driver.OracleDriver</config-property> <!--set these only if you want only default logins, not through JAAS --> <config-property name="UserName" type="java.lang.String">aluno1</config-property> <config-property name="Password" type="java.lang.String">aluno1</config-property> </properties> </attribute> <!--Below here are advanced properties --> <!--hack--> <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,n ame=JBoss LocalTransaction JDBC Wrapper</depends> </mbean> </depends> <depends optional-attribute-name="ManagedConnectionPool"> <!--embedded mbean--> <mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=LocalTxPool,name=OracleDS"> <attribute name="MinSize">0</attribute> <attribute name="MaxSize">50</attribute> <attribute name="BlockingTimeoutMillis">5000</attribute> <attribute name="IdleTimeoutMinutes">15</attribute> <!--criteria indicates if Subject (from security domain) or app supplied parameters (such as from getConnection(user, pw)) are used to distinguish connections in the pool. Choices are ByContainerAndApplication (use both), ByContainer (use Subject), ByApplication (use app supplied params only), ByNothing (all connections are equivalent, usually if adapter supports reauthentication)--> <attribute name="Criteria">ByNothing</attribute> </mbean> </depends> <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedCo nnectionManager</depends> <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=Jaa sSecurityManager</depends> <attribute name="TransactionManager">java:/TransactionManager</attribute> <!--make the rar deploy! hack till better deployment--> <depends>jboss.jca:service=RARDeployer</depends> </mbean> </server> ----- Original Message ----- From: "Cloudor Pu" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, May 20, 2002 5:47 PM Subject: RE: [JBoss-user] jboss 3.0.0 db configure hello, I am setting a mysql connection to Jboss3.0.0rc2 and have followed the steps posted at http://jboss.org/forums/thread.jsp?forum=67&thread=13366 . I modifed "standardjaws.xml" and "standardjbosscmp.xml" to make "java:/MySqlDS" as the default datasource. When i start jboss, there is no error reported. But when i copy the online docs example "cd.jar" to jboss/server/default/deploy/ , i got an exception as follows : -------------------------------- 20:33:25,559 INFO [MainDeployer] Starting deployment of package: file:/var/jboss/server/default/deploy/cd.jar 20:33:26,883 INFO [EjbModule] Creating 20:33:27,046 INFO [EjbModule] Deploying CDBean 20:33:29,858 INFO [EjbModule] Deploying CDCollectionBean 20:33:34,529 ERROR [EntityContainer] Exception in service lifecyle operation: create java.sql.SQLException: ResourceException javax.resource.ResourceException: Could not create connection at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDat aSource.java:105) at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getConnection(JDBCCommand.java:6 94) at org.jboss.ejb.plugins.jaws.jdbc.JDBCInitCommand.execute(JDBCInitCommand.java :120) at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.create(JAWSPersistenceMana ger.java:130) at org.jboss.ejb.plugins.CMPPersistenceManager.create(CMPPersistenceManager.jav a:155) at org.jboss.ejb.EntityContainer.create(EntityContainer.java:337) at org.jboss.ejb.Container.invoke(Container.java:790) ----------------------------------------- I would like to know what mis-configurations could cause this kind of errors? wrong userName,password,url,and any more? 在 2002-05-20 一 的 09:24, Sacha Labourey 写道: > Hello, > > In order to help you with your connection, please provide us with the > Exception trace you see. > > Then, for your second point (CMP), take a look at the free on-line doco for > CMP: you will see how to give the name of the datasource to your CMP beans. > By default, they will use the java:DefaultDS JNDI name which is linked to > the Hypersonic database that is embedded in JBoss. > > Cheers, > > > Sacha > > > -----Message d'origine----- > > De : [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]]De la part de Centaur > > zeus > > Envoyé : lundi, 20 mai 2002 11:18 > > À : [EMAIL PROTECTED] > > Objet : [JBoss-user] jboss 3.0.0 db configure > > > > > > hi all, > > > > I would like to know how could I set an oracle connection in > > Jboss 3.0.0 > > ? I search through the web and I found a sample > > oracle-service.xml. But when > > I put it into the same directory as hypersonic-service.xml, it generates > > lots of exceptions during startup. So can any one help me ? > > > > Also , I would like to know if I could configure which > > connection (like > > mysql, oracle ) to use when using cmp ? > > > > Perseus > > > > > > _________________________________________________________________ > > Join the world’s largest e-mail service with MSN Hotmail. > > http://www.hotmail.com > > > > > > _______________________________________________________________ > > Hundreds of nodes, one monster rendering program. > > Now that's a super model! Visit http://clustering.foundries.sf.net/ > > > > _______________________________________________ > > JBoss-user mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > _______________________________________________________________ > Hundreds of nodes, one monster rendering program. > Now that's a super model! Visit http://clustering.foundries.sf.net/ > > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user _______________________________________________________________ Hundreds of nodes, one monster rendering program. Now that's a super model! Visit http://clustering.foundries.sf.net/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user _______________________________________________________________ Hundreds of nodes, one monster rendering program. Now that's a super model! Visit http://clustering.foundries.sf.net/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user