-
1. Re: jboss and spring frame work
peterj Aug 8, 2007 11:18 AM (in response to zhlu)For the few Spring applications that I have put together, I did not have to make any special changes to them, simply deployed the WAR file.
If you are using a data source, you might have to add a WEB-INF/jboss-web.xml file to map the data source name.
I am guessing that you have already tried this and run into a problem. Care to share what it is? -
2. Re: jboss and spring frame work
zhlu Aug 8, 2007 1:09 PM (in response to zhlu)Thank you for your info. As matter fact, I didn't have jboss-web.xml. Could you send me an example of yours?
-Henry -
3. Re: jboss and spring frame work
peterj Aug 8, 2007 1:24 PM (in response to zhlu)I don't have Spring-related example, but here is one using plain servlets/JSPs. In my web.xml file I have:
<resource-ref> <res-ref-name>ds/SomeDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref>
and in jboss-web.xml I have:<jboss-web> <resource-ref> <res-ref-name>ds/SomeDS</res-ref-name> <jndi-name>java:ds/SomeDS</jndi-name> </resource-ref> </jboss-web>
and in my application I look up the datasource as:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/ds/SomeDS"); -
4. Re: jboss and spring frame work
zhlu Aug 12, 2007 5:14 PM (in response to zhlu)I got the following error in the jmx console when I invoke the oracle jdbc driver:
oracle.jdbc.driver.OracleDriver Information
Not loaded in repository cache
here is my oracle-ds.xml file:
<local-tx-datasource>
<jndi-name>cpp</jndi-name>
<connection-url>jdbc:oracle:thin:@xxx:oralu</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>x</user-name>
x
....
<type-mapping>Oracle9i</type-mapping>
-Henry