[jboss-jira] [JBoss JIRA] Updated: (JBAS-5719) Deployment ordering of WAR and -ds.xml not working in JBoss-5.0 CR1
jaikiran pai (JIRA)
jira-events at lists.jboss.org
Fri Jul 4 07:12:58 EDT 2008
[ http://jira.jboss.com/jira/browse/JBAS-5719?page=all ]
jaikiran pai updated JBAS-5719:
-------------------------------
Attachment: Deployment ordering for WAR and -ds in JBoss5.0 CR1.zip
Attaching the failing war file and the logs. Please follow the instructions in the Readme.txt available in the zip file or read the instructions below:
The zip file contains:
1) A simple WAR file (named myapp.war) in the dist folderfor demonstrating the issue with datasource and WAR file deployment ordering.
2) Optional hsqldb-ds.xml. If the server on which you want to test this issue already has this file then you do NOT have to use this.
3) logs folder, with various logs which are explained below.
4) src folder which contains a MyStartupServlet.java. This can be used if someone want to change the code for debugging the issue.
Contents of the deployable WAR file (myapp.war):
------------------------------------------------
The WAR file consists of a startup servlet which does a JNDI lookup of java:/DefaultDS (which is shipped in the default installation of JBoss).
How to use this WAR:
-------------------
- Stop the JBoss-5.0 CR1 server, if its running.
- Place the myapp.war file in %JBOSS_HOME%\server\default\deploy
- Start the server (run -c default). Note, its assumed that the hsqldb-ds.xml in the deploy folder has not been changed and it configures the java:/DefaultDS datasource.
When JBoss starts notice the exception being thrown:
16:10:20,513 INFO [TomcatDeployment] deploy, ctxPath=/myapp, vfsUrl=myapp.war
16:10:20,607 INFO [STDOUT] ERROR---> Datasource java:/DefaultDS lookup failed
16:10:20,607 ERROR [STDERR] javax.naming.NameNotFoundException: DefaultDS not bound
16:10:20,607 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
16:10:20,607 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
16:10:20,607 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
16:10:20,607 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
16:10:20,607 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
16:10:20,607 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
16:10:20,607 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)
16:10:20,607 ERROR [STDERR] at org.myapp.servlet.MyStartupServlet.init(MyStartupServlet.java:21)
16:10:20,607 ERROR [STDERR] at javax.servlet.GenericServlet.init(GenericServlet.java:212)
16:10:20,607 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
16:10:20,607 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
16:10:20,607 ERROR [STDERR] at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4074)
The zip file attached with this JIRA issue has a Failed_Console.log which is the console log when the deployment failed. The zip also has a Failed_server.log which the more verbose server log file of this failed deployment.
Also notice that after the exception is thrown (i.e. after the WAR is deployed, the java:DefaultDS gets deployed):
16:10:20,763 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
Workaround for this issue:
-------------------------
There's a workaround for this issue. Use hot deployment for myapp.war:
- Stop the JBoss-5.0 CR1 server, if its running.
- Remove the myapp.war from the deploy folder, if its already there
- Start the server (run -c default). Note, its assumed that the hsqldb-ds.xml in the deploy folder has not been changed and it configures the java:/DefaultDS datasource.
- AFTER the server has completely started and the datasource bound to the java:/DefaultDS, place the myapp.war file in the %JBOSS_HOME%\server\default\deploy folder.
- The HDScanner (assuming it's not disabled) will pick up the myapp.war and deploy it.
- Notice that the startup servlet of this myapp.war now successfully lookups the datasource and prints out the following line (similar to this):
INFO [STDOUT] Found DataSource org.jboss.resource.adapter.jdbc.WrapperDataSource at 15722d7
The zip file attached with this issue also has a HotDeploy_Console.log and HotDeploy_server.log which correspond to the logs when the WAR was successfully deployed through hot deployment.
> Deployment ordering of WAR and -ds.xml not working in JBoss-5.0 CR1
> -------------------------------------------------------------------
>
> Key: JBAS-5719
> URL: http://jira.jboss.com/jira/browse/JBAS-5719
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: JBossAS-5.0.0.CR1
> Environment: JBoss-5.0 CR1
> Windows 2003 Server
> Sun Java 1.5
> Reporter: jaikiran pai
> Assigned To: Ales Justin
> Attachments: Deployment ordering for WAR and -ds in JBoss5.0 CR1.zip
>
>
> If the server is started with a WAR and a -ds.xml file in the deploy folder, then WAR is deployed first instead of the -ds.xml. This results in the WAR deployment failing, if the WAR is dependent on the datasource to be available.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list