Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#551 Patch fixing a Nullp in dep-triggered war-redeployment

v4.0
closed-postponed
nobody
JBossWeb (14)
5
2005-08-15
2005-08-15
Marian Kelc
No

I have a Web-Application with dependencies to a
Datasource and want the WebApp
to be redeployed when the *-ds.xml file is changed.

So I injected the Dependencies in the jboss-web.xml:

[code]<jboss-web>

<depends>jboss.jca:name=TranstoolDS,service=DataSourceBinding</depends>

<depends>jboss.jca:name=TranstoolDS,service=LocalTxCM</depends>

<depends>jboss.jca:name=TranstoolDS,service=ManagedConnectionFactory</depends>

<depends>jboss.jca:name=TranstoolDS,service=ManagedConnectionPool</depends>
</jboss-web>[/code]

When i change the ds.xml-File Jboss tries to redeploy
the war-file, but
finishes with an exception (stacktrace is appended at
the end):

So i got to have a look to org/jboss/web/WebModule.java
and found the lines 63-71

[code]63: public synchronized void startModule()
64: throws DeploymentException
65: {
66: // Get the war URL
67: URL warURL = di.localUrl != null ? di.localUrl
: di.url;
68: WebApplication webApp = deployer.start(di);
69: di.context.put(AbstractWebContainer.WEB_APP,
webApp);
70: container.addDeployedApp(warURL, webApp);
71: }[/code]

this.di becomes null on destroy in the following piece
of code (line 54-59)

[code]54: protected void destroyService()
55: {
56: this.di = null;
57: this.container = null;
58: this.deployer = null;
59: }[/code]

So i commented out the lines 56-58

[code]54: protected void destroyService()
55: {
56:// this.di = null;
57:// this.container = null;
58:// this.deployer = null;
59: }[/code]

and recompile JBoss 4.0.3 RC1. And now, it works like
expected!

And now my question:

1. Is my solution ok? Must these members be nulled on
destroy? Or can the
while destroyService-Method be removed?
2. When ok, can my Patch (ID as Sourceforge) be merged?

Thanx in advance!

Greetings

Marian Kelc

Discussion

  • Marian Kelc
    Marian Kelc
    2005-08-15

    Patch against server\src\main\org\jboss\web\WebModule.java

     
    Attachments
  • Adrian Brock
    Adrian Brock
    2005-08-15

    Logged In: YES
    user_id=9459

    All issues have been moved to http://jira.jboss.com. Existing
    issues have been moved. New issues will be closed with this
    canned reponse.

     
  • Adrian Brock
    Adrian Brock
    2005-08-15

    • status: open --> closed-postponed