-
1. Re: late data source initialization
weston.price Mar 13, 2007 5:15 PM (in response to sshrestha)Read this first:
http://wiki.jboss.org/wiki/Wiki.jsp?page=DependOnDataSource
Then take a look at the jboss-web.dtd and add the entry to a jboss-web.xml descriptor. Example:<jboss-web> <depends>jboss.jca:service=DataSourceBinding,name=(jndi-name)</depends> </jboss-web>
-
2. Re: late data source initialization
sshrestha Mar 13, 2007 5:38 PM (in response to sshrestha)I have added depends element in the jboss-web.xml, no change in results:
here is my jboss-web.xml file:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd"> <jboss-web> <context-root>/</context-root> <virtual-host>xxx.mydomain.com</virtual-host> <resource-ref> <res-ref-name>jdbc/connAs400</res-ref-name> <jndi-name>java:/connAs400</jndi-name> </resource-ref> <resource-ref> <res-ref-name>jdbc/connMySql</res-ref-name> <jndi-name>java:/connMySql</jndi-name> </resource-ref> <depends>jboss.jca:service=DataSourceBinding,name=connAs400</depends> <depends>jboss.jca:service=DataSourceBinding,name=connMySql</depends> </jboss-web>
-
3. Re: late data source initialization
weston.price Mar 13, 2007 6:03 PM (in response to sshrestha)Hmmm...so check the basics
1)The jboss-web.xml file is in WEB-INF, not META-INF
2)The DataSource itself actually deploys and can be seen via the JMX console.
Barring that, you may have to turn on tracing and post the result. Also, could you post your *-ds.xml file? -
4. Re: late data source initialization
weston.price Mar 13, 2007 6:05 PM (in response to sshrestha)Also, eliminate the DTD reference in your jboss-web.xml file, or use the correct version (ie jboss-web_4.0.dtd etc).
-
5. Re: late data source initialization
weston.price Mar 13, 2007 6:17 PM (in response to sshrestha)Also, just to clarify, how are you deploying your DataSource? Deploying it inside the WAR archive will cause issues.
-
6. Re: late data source initialization
sshrestha Mar 13, 2007 6:37 PM (in response to sshrestha)data source is deployed in deploy dir: mysql-ds.xml.
changed dtd version to 4_0.
still the same results.
by the way I don't have this problem if I deploy the application as a war file (myApp.war) directly in the deploy directory.
The reason I am deploying in myApp.war directory is to be able to front JBoss with Apache. -
7. Re: late data source initialization
weston.price Mar 13, 2007 6:54 PM (in response to sshrestha)
by the way I don't have this problem if I deploy the application as a war file (myApp.war) directly in the deploy directory.
What do you mean? Do you mean you are deploying this as an expanded directory structure? I might be missing something :-) -
8. Re: late data source initialization
sshrestha Mar 13, 2007 7:50 PM (in response to sshrestha)yes, this problem only occurs if I am deploying the application in a expanded directory (to be clearer: myApp.war is a directory: where I do jar -xf app.war).
and not if I deploy it as app.war (a war file) in deploy dir. -
9. Re: late data source initialization
sshrestha Mar 14, 2007 9:54 AM (in response to sshrestha)my mysql-ds.xml file:
<?xml version="1.0" encoding="UTF-8"?> <!-- $Id: mysql-ds.xml,v 1.3.2.3 2006/02/07 14:23:00 acoliver Exp $ --> <!-- Datasource config for MySQL using 3.0.9 available from: http://www.mysql.com/downloads/api-jdbc-stable.html --> <datasources> <local-tx-datasource> <jndi-name>wsMySql</jndi-name> <connection-url>jdbc:mysql://10.0.0.105:3306/myData?autoReconnect=true</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>usr</user-name> <password>pwd</password> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name> <min-pool-size>30</min-pool-size> <max-pool-size>60</max-pool-size> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources>
-
10. Re: late data source initialization
sshrestha Mar 14, 2007 3:18 PM (in response to sshrestha)This is what my vhost entry looks like in server.xml file:
<Host name="xxx.mydomain.com" autoDeploy="false" deployOnStartup="false" deployXML="false" appBase="deploy" unpackWARs="true"> <Alias>yyy.mydomain.com</Alias> <Valve className="org.apache.catalina.valves.AccessLogValve" prefix="xxx" suffix=".log" pattern="common" directory="${jboss.server.home.dir}/log"/> <Context path="" docBase="${jboss.server.home.dir}/deploy/xxx.war" debug="0" reloadable="true"/> </Host>
-
11. Re: late data source initialization
sshrestha Mar 14, 2007 3:50 PM (in response to sshrestha)This is what my vhost entry looks like in server.xml file:
<Host name="xxx.mydomain.com" autoDeploy="false" deployOnStartup="false" deployXML="false" appBase="deploy" unpackWARs="true"> <Alias>yyy.mydomain.com</Alias> <Valve className="org.apache.catalina.valves.AccessLogValve" prefix="xxx" suffix=".log" pattern="common" directory="${jboss.server.home.dir}/log"/> <Context path="" docBase="${jboss.server.home.dir}/deploy/xxx.war" debug="0" reloadable="true"/> </Host>