Bug 65969 - [67cat] Cannot debug web application on WebLogic
[67cat] Cannot debug web application on WebLogic
Status: REOPENED
Product: serverplugins
Classification: Unclassified
Component: WebLogic
5.x
PC Windows XP
: P1 (vote)
: 7.0.1
Assigned To: Petr Hejl
issues@serverplugins
:
: 189072 (view as bug list)
Depends on: 66409 196959 66407
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-05 14:12 UTC by Jiri Skrivanek
Modified: 2013-09-04 13:35 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
index.jsp generated in the current build, i.e. 051007 (998 bytes, text/plain)
2005-10-10 17:17 UTC, Libor Kotouc
Details
index.jsp generated in the current build, i.e. 060102 (1001 bytes, text/plain)
2006-01-06 14:37 UTC, Libor Kotouc
Details
Servlet generated for index.jsp (4.76 KB, text/plain)
2006-01-06 14:43 UTC, Libor Kotouc
Details
Compiled servlet with SMAP extension (5.36 KB, text/plain)
2006-01-06 14:47 UTC, Libor Kotouc
Details
server-spec descr. used for a Servlet code keeping (380 bytes, text/xml)
2006-01-06 15:04 UTC, Libor Kotouc
Details
The first version of patch. (18.00 KB, patch)
2011-01-11 10:17 UTC, Petr Hejl
Details | Diff
The second version of the patch (19.71 KB, patch)
2011-01-11 13:45 UTC, Petr Hejl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2005-10-05 14:12:22 UTC
It is not possible to debug web applications on WebLogic server. I found two
different cases. Please, let me know if you want me to file another issue for
second.
1) 
- start IDE
- add WebLogic server in Runtime view
- create new Web Application project and select WebLogic server in wizard
- add breakpoint to index.jsp
- start debugger (F5). It starts but breakpoint is never reached. Neither when
you reload page in browser.

2)
- use web application from case 1
- create new Servlet
- add breakpoint to servlet
- finish debugging (if still running)
- start to debug servlet (Ctrl+Shift+F5)
- it reaches breakpoint successfully
- press F7 but it accidentally continues and additionally servlet is never shown
in browser.

Build 20051005-0426, WindowsXP, JDK1.5.0_05, WebLogic9.0.
Comment 1 Michal Mocnak 2005-10-06 12:55:01 UTC
I have tested it and have also same problem with same system configuration.
Comment 2 Libor Kotouc 2005-10-10 16:01:49 UTC
#1 fixed.

Checking in actions/JspToggleBreakpointActionProvider.java;
/cvs/web/jspdebug/src/org/netbeans/modules/web/debug/actions/JspToggleBreakpointActionProvider.java,v
 <--  JspToggleBreakpointActionProvider.java
new revision: 1.8; previous revision: 1.7
done
Checking in util/Utils.java;
/cvs/web/jspdebug/src/org/netbeans/modules/web/debug/util/Utils.java,v  <-- 
Utils.java
new revision: 1.32; previous revision: 1.31
done

Issue for the #2 will be filed.


Comment 3 Libor Kotouc 2005-10-10 17:10:21 UTC
Previous fix is only a workaround because there are some problems on the WL side
and even on the NB side.

The workaround is not to allow user to set BP when WebLogic 9 is selected as the
target server of the owning project. It can be a little bit confusing when a
user uses other server supporting JSP debugging and sets some BPs. When she
later switches to WL9, the BPs will remain set but debugger will ignore them.

Here is the list of problems to solve to make debugging on WL fully functional:

1. [NB side] NB expects class with package org.apache.jsp.* but WL generated
servlet into jsp_servlet package by default. We should ask server plugin for the
correct extension. See issue 66407.

2. [NB side] The Location's source path is taken from the servlet's source path,
e.g. we have following structure:

webmodule.jar
    |---index.jsp
    |---subdir
         |---pagexy.jsp

...and default package prefix (jsp_servlet). Then following source path for JSP
pages is returned:
index.jsp.....jsp_servlet/index.jsp (we expect index.jsp)
d/pagexy.jsp.....jsp_servlet/_d/pagexy.jsp (we expect d/pagexy.jsp)

Generally we expect a relative path from the web module root. It should obtained
from the server plugin. See issue 66409.

3. [WL side] Wrong SMAP extension in the servlet's class file causes that we
cannot obtain the location for the line where JSP BP is set. E.g. servlet class
for the page index.jsp generated for the web project does not contain mapping
for line 22 (the page will be attached).
Comment 4 Libor Kotouc 2005-10-10 17:17:14 UTC
Created attachment 25771 [details]
index.jsp generated in the current build, i.e. 051007
Comment 5 Libor Kotouc 2005-10-11 09:06:23 UTC
4. Current fix compares server ID returned from J2eeModuleProvider with
hard-coded WL server ID (WebLogic9). Better weay is to ask server whether it
supports JSP debugging or not, see issue 66447.
Comment 6 Libor Kotouc 2005-10-11 10:09:40 UTC
QA agreed to postpone JSP debugging on WL to the next release, thus TM set to
'future' and issue type to 'enhancement'.
Comment 7 Jiri Skrivanek 2005-10-11 12:14:24 UTC
Case 2 (cannot debug servlet) filed separately as issue 66464.
Comment 8 Libor Kotouc 2006-01-06 14:02:33 UTC
Item 3 [WL side] is not correct, mapping seems to be good when comparing to the
Servlet source. WL does not map all lines, instead it treats the continual block
of the HTML code as a one line in the Servlet.
I expect that Java code will be mapped as expected.

It might be a little bit confusing for the user bcs NB allows him to set
breakpoint whereever but debugger will not stop. On the other hand in fact a
user does not want to step through the HTML code, thus the limitation is
insignificant.

Attaching JSP, Servlet and the class file with the SMAP extension.
Comment 9 Libor Kotouc 2006-01-06 14:37:14 UTC
Created attachment 28243 [details]
index.jsp generated in the current build, i.e. 060102
Comment 10 Libor Kotouc 2006-01-06 14:43:45 UTC
Created attachment 28244 [details]
Servlet generated for index.jsp
Comment 11 Libor Kotouc 2006-01-06 14:47:14 UTC
Created attachment 28245 [details]
Compiled servlet with SMAP extension
Comment 12 Libor Kotouc 2006-01-06 15:04:03 UTC
Created attachment 28248 [details]
server-spec descr. used for a Servlet code keeping
Comment 13 Petr Jiricka 2009-04-16 14:38:07 UTC
Not sure if anything has improved in the last 3 years that would make this possible. Also not sure what the situation is
with the latest version of WebLogic.
Comment 14 Martin Entlicher 2010-12-28 15:30:34 UTC
*** Bug 189072 has been marked as a duplicate of this bug. ***
Comment 15 Petr Hejl 2011-01-06 13:14:56 UTC
Use case 2) works now.
Comment 16 Petr Hejl 2011-01-11 10:17:09 UTC
Created attachment 104869 [details]
The first version of patch.

The patch is not yet ready for integration, but in general it should work.

The big problem (and hack) is in EngineContextProviderImpl. The source file for index.jsp is reported as jsp_servlet/index.jsp and IDE can't open the source. This is hacked in EngineContextProviderImpl - I think the correct approach would be a hook into JPDA debugger and "normalize" the path.

Note that the debugging of JSPs on WebLogic only works for Java code due to way how JSP servlets are generated on WL.
Comment 17 Petr Hejl 2011-01-11 13:45:05 UTC
Created attachment 104880 [details]
The second version of the patch
Comment 18 Petr Hejl 2011-03-21 15:07:00 UTC
I pushed the patch to web-main branch serverplugins-next d55b0fb86a99.
Comment 19 Petr Hejl 2011-03-21 15:39:14 UTC
For the record - fixed c&p bug web-main serverplugins-next 220848aebd38.
Comment 20 Petr Hejl 2011-03-22 13:26:02 UTC
This issue does not really depend on 66447.
Comment 21 Quality Engineering 2011-04-22 05:04:46 UTC
Integrated into 'main-golden', will be available in build *201104220000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d55b0fb86a99
User: phejl@netbeans.org
Log: #65969 [67cat] Cannot debug web application on WebLogic
Comment 22 Jiri Skrivanek 2013-09-04 13:23:19 UTC
JSP debugging still does not work for me in NetBeans 7.4.
Comment 23 Petr Hejl 2013-09-04 13:35:36 UTC
(In reply to Jiri Skrivanek from comment #22)
> JSP debugging still does not work for me in NetBeans 7.4.

For the record (one of previous comments):
Note that the debugging of JSPs on WebLogic only works for Java code due to way how JSP servlets are generated on WL.

So now it is semi-working and hard to tell whether this will ever be fixed.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo