This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 61785 - Error appears in web browser when you run or debug web app
Summary: Error appears in web browser when you run or debug web app
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: WebLogic (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@serverplugins
URL:
Keywords:
Depends on: 60612
Blocks:
  Show dependency tree
 
Reported: 2005-08-04 05:22 UTC by Pavel Buzek
Modified: 2005-09-05 10:12 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
logs and outputs when deploying web app without context path set (20.22 KB, text/plain)
2005-08-05 10:52 UTC, Jaroslav Pospisil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2005-08-04 05:22:12 UTC
Possibly similar to issue 60612 that is filed against jboss.

1.Run IDE with new userdir and add WL plugin.
2.Create new web application
3.Run it
4.ERROR

The application is normally deployed,but in the browser appears error -
application is not accessible. 

This happens only first time and if you do Reload in web browser,index.jsp is
normally displayed. When you redeploy you get the same error againt (again
regresh solves the problem).
Comment 1 Jaroslav Pospisil 2005-08-05 10:51:07 UTC
I changed priority and summary of this issue,because it's not only first time,it
occurs almost anytime and it's connected with not set context path in weblogic.xml.
1.After you create web module on weblogic,context path isn't set and it can't be
set in properties(It's another issue,but connected with this).
2.When I deploy web app on server,it creates very strange outputs(see
attachment) and I cannot see it deployed in admin console,although it's
definitely deployed on server(files with app's name could be found somewhere
deep inside server's directory).
3.There's workaround - I can set context path in weblogic.xml,save it and deploy
web app,then the web application is correctly shown in browser and also in admin
console BUT! After some redeploys,netbeans suddenly is trying to deploy web app
with context path set in wizard when I created it,not the one I set in
weblogic.xml and in the browser error appears again.
I can see my deployed web app only in admin console or by changing the URL to
match my context path in weblogic.xml .
It's all very strange and I was able to deploy my web app correctly only twice
in about twenty cases,even with this workaround.
Comment 2 Jaroslav Pospisil 2005-08-05 10:52:37 UTC
Created attachment 23521 [details]
logs and outputs when deploying web app without context path set
Comment 3 Jaroslav Pospisil 2005-08-05 12:46:55 UTC
The same problem appears when debugging web app.
Comment 4 Pavel Buzek 2005-08-05 15:08:20 UTC
Thanks for the info, I did not know this is related to context path.
Comment 5 Pavel Buzek 2005-08-09 21:22:53 UTC
ok, so now that the context root is fixed it is clear that it is not related to it

It is definitely a timing issue. Just adding a Thread.sleep() for long enough
makes it work. I will have to experiment with how long is long enough and still
acceptable delay for the user and if it depends on module size.

At first look it would seem that a better fix would be to wait for the module
URL to become responsive but when I tried this it did not help, bcs. the server
sends the error page as a response ;-)
Comment 6 Pavel Buzek 2005-08-10 03:45:07 UTC
I did a partial fix - added some delay to allow the server processing the module
before displaying it in the browser.

Seems to work mostly OK, although not 100%. Downgrading to P2 and I will still
work on it.
Comment 7 Pavel Buzek 2005-08-12 06:11:12 UTC
I have a better fix. The IDE is testing the HTTP response of the URL that will
be displayed in browser until it gets a code w/o error. You should never get the
strange page.

/cvs/serverplugins/weblogic9/src/org/netbeans/modules/j2ee/weblogic9/Bundle.properties,v
 new revision: 1.4; previous revision: 1.3
/cvs/serverplugins/weblogic9/src/org/netbeans/modules/j2ee/weblogic9/URLWait.java,v
 initial revision: 1.1
/cvs/serverplugins/weblogic9/src/org/netbeans/modules/j2ee/weblogic9/WLDeployer.java,v
 new revision: 1.3; previous revision: 1.2

The only possible scenario I can think of when you would get an incorrect page
could be when redeploying an existing application. The old page might still be
active (and give an http response w/o error) and the browser would display the
old state of application instead of the new one. I added a delay to account for
this (3 seconds) and with this delay it works fine for the web apps I tested. If
you can see this behavior the delay can be increased (but this means every Run
action will have this additional delay). I cannot see a better way to fix that,
the IDE cannot detect the difference between the old and new page and cannot
detect when the module is completely reloaded.
Comment 8 Jaroslav Pospisil 2005-08-15 15:33:36 UTC
Verified in 20050815.