MyEclipse: Debugging JSPs with Oracle Application Server 10g Standalone

silverbolt - Nov 02, 2005 - 05:24 PM
Post subject: Debugging JSPs with Oracle Application Server 10g Standalone
Hello,

I am evaluating MyEclipse's suitability for developing JSPs in my workplace. We use Oracle's Application Server 10g. I'm using the OC4J standalone (9.0.4) package at:
http://www.oracle.com/technology/tech/java/oc4j/1012/collateral/OC4J-FAQ-1012.html

installed to "C:\oc4j", and Java2 SDK 1.4.2_06 (Installed to C:\j2sdk1.4.2_06). I am trying to deploy the HelloWorld project.

I have installed and configured MyEclipse v4.0.3 over Eclipse 3.1 and it all appears to have installed correctly.

How can I debug JSPs through MyEclipse for OC4J Standalone? I have read this topic:

http://www.myeclipseide.com/modules.php?op=modload&name=PNphpBB2&file=viewtopic&t=5089

But the accepted answer did not work for me. It's not clear, but I assume the Java debug switch is added to the JDK "Optional Java JVM Arguments" box. MyEclipse has detected J2SDK1.4.2_06 as the JRE. I can start the server successfully, and I can even deploy the application to the server in exploded format (as long as I specify it to be deployed in C:\oc4j\j2ee\home\default-web-app\HelloWorld). I can browse to the site at "http://localhost:8888/HelloWorld/MyJsp.jsp" and my application is displayed correctly. If I change some text and re-deploy, the changes are shown straight away.

However, debugging will not work. I have created a new debugger configuration using the instructions here...

http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/remotedebugging/index.html

...but OC4J isn't covered (Odd, since it has been mentioned in several other threads that it does not support native JSP debugging and so would be a prime candidate for such a guide). I have tried to improvise by creating a new debug configuration with the following settings:

Project: HelloWorld
Connection Type: Standard (Socket Attach)
Host: localhost
Port: 40000 (as specified in http://www.myeclipseide.com/modules.php?op=modload&name=PNphpBB2&file=viewtopic&t=5089)
"Allow termination of remote VM" - Enabled.

If I click to "Debug" I get the following error messag popup:

"Failed to connect to remote VM. Connection refused."

Can anyone offer a proven working solution to debugging JSPs on OC4J standalone? I've seen a number of people say they've got it working, but no one has actually been able to provide instructions as to how.

These other threads cover the same problem:

http://www.myeclipseide.com/modules.php?op=modload&name=PNphpBB2&file=viewtopic&t=1353 (Suggests using a different server altogether. Not an option for me)
http://www.myeclipseide.com/modules.php?op=modload&name=PNphpBB2&file=viewtopic&t=2006 (Suggests reading the guide on Remote Debugging - except the specified server is not covered)
http://www.myeclipseide.com/modules.php?op=modload&name=PNphpBB2&file=viewtopic&t=2076 (No solution is offered)
http://www.myeclipseide.com/modules.php?op=modload&name=PNphpBB2&file=viewtopic&t=3202
(Refers to a previously unsuccessful solution)
http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-2460.html
(Does not cover debugging)

Am I asking for something that is genuinely impossible? Oracle Application Server 10g has been around for years - is there still no way to debug it? How can anyone be expected to properly develop for a platform that has no support for debugging? Especially an Enterprise level platform!? :?

Thanks in advance for any help you can offer.
support-rkalla - Nov 04, 2005 - 03:21 PM
Post subject:
silverbolt,
First let me thank you for posting such a detailed post, I'm sending this off to one of the devs on the app server team to get you a direct answer.
support-scott - Nov 04, 2005 - 06:08 PM
Post subject:
Quote:

Am I asking for something that is genuinely impossible? Oracle Application Server 10g has been around for years - is there still no way to debug it? How can anyone be expected to properly develop for a platform that has no support for debugging? Especially an Enterprise level platform!? :?

First, rather than dealing with remote debugging, I'd highly recommend that you just use the built-in Oracle connector. It's labeled Oracle 9i/AS in 4.0.3 but works with 10g as well. Simply set the Oracle AS Home Directory, the admin password, and you should be able to launch the server just fine. Also note that Oracle's server only understands packaged EAR deployment, so please be sure to only use this form for auto-deployment. With that, you'll be able to debug Java JSP debugging won't work with OC4J / Orion because they don't support JSR-045 which is the source level debugging JSR. Source level JSP debugging is available on Tomcat 5, as well as any server that uses Jasper 2 for JSP compilation such as JBoss 3.2.4/Tomcat5 bundle, and some versions of Jetty and JRun I believe.
silverbolt - Nov 15, 2005 - 10:48 AM
Post subject:
support-scott wrote:
Java JSP debugging won't work with OC4J / Orion because they don't support JSR-045 which is the source level debugging JSR. Source level JSP debugging is available on Tomcat 5, as well as any server that uses Jasper 2 for JSP compilation such as JBoss 3.2.4/Tomcat5 bundle, and some versions of Jetty and JRun I believe.


Unfortunately, I am using OC4J and as you stated it does not support the JSR-045 standard. In addition, using an alternative J2EE server (such as Tomcat, JBoss, etc...) is not an option for me, and is only avoiding the problem rather than solving it.

So, just to clarify, debugging OC4J JSP applications IS impossible using MyEclipse?

I'm currently using JDeveloper to debug JSP's, but the user interface is ghastly so I'd much rather use MyEclipse. But if I really can't debug JSP's on OC4J through MyEclipse then I have to stick with JDeveloper.
support-rkalla - Nov 15, 2005 - 01:58 PM
Post subject:
Quote:

Unfortunately, I am using OC4J and as you stated it does not support the JSR-045 standard. In addition, using an alternative J2EE server (such as Tomcat, JBoss, etc...) is not an option for me, and is only avoiding the problem rather than solving it.

It would only be to ease your development work, but we understand if you are trying to keep dev/deploy the same.

Quote:

So, just to clarify, debugging OC4J JSP applications IS impossible using MyEclipse?

Yes, it's not going to work properly as we wouldn't be receiving enough information back from the server to provide useful debugging without support for that spec.

Quote:

I'm currently using JDeveloper to debug JSP's, but the user interface is ghastly so I'd much rather use MyEclipse. But if I really can't debug JSP's on OC4J through MyEclipse then I have to stick with JDeveloper.

We are sorry for this limitation causing you trouble during work. If your company decides to upgrade to version 10, AFAIKT from Oracle's site, 10g does infact support JSR-45 in that version. You might try downloading a trial version and testing it?
silverbolt - Nov 21, 2005 - 05:34 PM
Post subject:
support-rkalla wrote:

We are sorry for this limitation causing you trouble during work. If your company decides to upgrade to version 10, AFAIKT from Oracle's site, 10g does infact support JSR-45 in that version. You might try downloading a trial version and testing it?


Ah - that's interesting. I think there's some confusion over what constitues 10g. I am using the OC4J standalone v9.0.4 which, according to Oracle, IS 10g. But there's also a more recent release of the 10g server - v10.1.2

Having established that v9.0.4 does not support the JSR-045 standard, are you saying that 10.1.2 does? If so, then that's good news and I could try that ou in future.
support-rkalla - Nov 21, 2005 - 05:55 PM
Post subject:
Yes according to this page, it does:
http://www.oracle.com/technology/products/jdev/101/collateral/101/1013eanewfeatures.html

"JSP debugging (JSR-45): The JSP debugging offered by JDeveloper and OC4J has been updated to comply with the new JSR-45 specification for multiple language debugging."
silverbolt - Nov 23, 2005 - 01:13 PM
Post subject:
support-rkalla wrote:
Yes according to this page, it does:
http://www.oracle.com/technology/products/jdev/101/collateral/101/1013eanewfeatures.html

"JSP debugging (JSR-45): The JSP debugging offered by JDeveloper and OC4J has been updated to comply with the new JSR-45 specification for multiple language debugging."


OK, thanks rkalla!

I have to make a cheeky request though:

We're due to try this implementation of the AS in the new year, but obviously I have already installed MyEclipse on my PC and by that time the trial license will have expired. If I contact MyEclipse again next year and refer to this thread, is there any possiblity I could be issued with another temporary license so I can try testing it again? :oops:
support-rkalla - Nov 23, 2005 - 02:31 PM
Post subject:
silverbolt,
You would need to email subscriptions@myeclipseide.com with a description of the setup and why you would appreciate an extended trial license.
yyuan98 - Nov 28, 2005 - 04:24 AM
Post subject:
I tried OC4J 10.1.2. I can manually deploy it with "admin.jar" and I can browse the deployed JSP page, but I can not debug JSP page.
There are few issues in the deployment:
1. Myeclpse deployed the ear file to "j2ee\home\application-autodeploy", the location can NOT be modified for some reason.
2. Did the manual deployment (admin.jar) make the JSP page un-debuggable?
3. Any suggestion or workaround for using myeclipse to debug JSP with OC4J?
Thanks,
Yan
support-rkalla - Nov 28, 2005 - 04:51 PM
Post subject:
Quote:

1. Myeclpse deployed the ear file to "j2ee\home\application-autodeploy", the location can NOT be modified for some reason.

You can use a "Custom Location" deployment to specify the location manually. Using an exploded or packaged deployment effects this location initially.

Quote:

2. Did the manual deployment (admin.jar) make the JSP page un-debuggable?

As long as you configured Oracle to compile the JSP pages with debugging information (double check docs) and the contents of admin.jar map to contents in a valid project in your workspace and you use the Oracle connector to launch ORacle in debug mode, you should be ok.
yyuan98 - Dec 07, 2005 - 07:40 PM
Post subject:
The OC4J 10.1.3 is supporting JSP-045. But I have trouble to make it working. Did anyone successfully set up OC4J 10.1.3 for JSP debugging? I would appreciate it someone can provide detailed information on this.
Yan
support-rkalla - Dec 07, 2005 - 07:46 PM
Post subject:
Yan,
What kind of trouble are you having?
yyuan98 - Dec 07, 2005 - 09:52 PM
Post subject:
I used myeclipse to create the ear file and deploy it with OC4J console. I can access the JSP page, but I can not debug it (i.e. it does not stop at the breakpoint). Detailed steps:
1. Using myeclipse to create "Enterprise Application Project” and create a JSP test page;
2. Start the OracleAS from myeclise;
3. Deploy the code with myeclipse using “package” type to the %ORACLE_HOME%\j2ee\home\application-autodeploy directory;
4. Start the oracle console, selection “Application” and click “deploy” button. Parent application is “default”. Choose the ear file from location %ORACLE_HOME%\j2ee\home\application-autodeploy, using default for deployment plan.
5. I can see the JSP page and changes I have made, but I can not stop at the breakpoint.

Thanks in advance for your reply,
Yan
support-rkalla - Dec 07, 2005 - 09:56 PM
Post subject:
Yan,
Double check your OC4J documentation to see if you need to turn on debugging symbols for the compiled JSP pages. This is true with WebLogic, you have to make an adjustment to the server config before the JSP pages are compiled with debugging symbols so the debugger can break on the the pages.
yyuan98 - Dec 07, 2005 - 10:50 PM
Post subject:
There is a debug option for <java-compiler> (this prints out the debugging message during JSP comiple, see message below) in server.xml file. It did not help. I did not see other debugging options available.

---------JSP compile time Message from standard out ----------
05/12/07 16:26:46 javaHome C:\jdk1.5.0_05\jre
05/12/07 16:26:46 osName windows 2000
05/12/07 16:26:46 pathSep ;
05/12/07 16:26:46 useJavac true
05/12/07 16:26:46 javaCompilerPath null
05/12/07 16:26:46 javaHome C:\jdk1.5.0_05\jre
05/12/07 16:26:46 osName windows 2000
05/12/07 16:26:46 pathSep ;
05/12/07 16:26:46 useJavac true
05/12/07 16:26:46 javaCompilerPath C:\jdk1.5.0_05\bin\javac.exe
05/12/07 16:26:46 Start Compilation using javac
05/12/07 16:26:46 Start Compilation using javac
05/12/07 16:26:46 Using External Javac Compiler...
05/12/07 16:26:46 Args: [C:\jdk1.5.0_05\bin\javac.exe, -source, 1.4, -target, 1.4, -J-Xmx1024m, -encoding, UTF8, @.\javac.params.23871225]
05/12/07 16:26:54 Compilation elapsed = 8s
support-rkalla - Dec 07, 2005 - 10:56 PM
Post subject:
What you want to set is that when the JSP pages are compiled with javac, you want them compiled with their debugging symbols intact. I looked around google and didn't quickly find a setting for that.

I will ask another.
support-rkalla - Dec 08, 2005 - 01:26 AM
Post subject:
I had a developer look into this and we found a bug specifically with version 10 of 10g server, we will try and get this fixed soon, sorry for the inconvenience.
support-rkalla - Dec 13, 2005 - 10:00 PM
Post subject:
We made some headway here, can you guys try this and see if it works, this is only for version 10 of 10g:
Quote:

If you just want to generated the smap file, you can set the JspServlet
init-param debug to file.

If you want the smap embedded in the generated class file set debug to true.

I've not tried it but these parameters are usually set in the
j2ee/home/config/global-web-application.xml file as follows:

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>

support-rkalla - Jan 09, 2006 - 07:28 PM
Post subject:
Guys can you try my suggestion above? We are trying to determine if we fixed this bug.
nihilist - Feb 17, 2006 - 06:45 PM
Post subject:
I've enabled JSP debugging in Oracle AS (10.1.3) as described above, but have no luck debugging JSPs. The breakpoint exists, but I don't get the little checkmark beside it.

I'm using the JSPs while using Struts+Tiles.
ghiro - May 21, 2007 - 01:45 PM
Post subject:
any news regarding this thread?
i got the same problem.
i have oc4j 10.1.2, starting it in debug mode within myeclipse and i' m correctly debugging java servelts.
Wanted to do the same with jsp pages, but I got no luck.

thanks in advance
support-rkalla - May 21, 2007 - 02:03 PM
Post subject:
ghiro,
You must be using 10.1.3 or later for proper debugging support, more information here: http://www.myeclipseide.com/PNphpBB2-viewtopic-t-11539.html
ghiro - May 21, 2007 - 11:49 PM
Post subject:
thanks for the update.
phatty - Oct 10, 2008 - 07:58 PM
Post subject:
Using myEclipse 6.5 and OC4j 10.1.3, have all the parameters set in the global-web-applications.xml file for oc4j to emit debug info and recognize a debugger, but still having issues. Has anyone solved this problem completely?
support-rkalla - Oct 13, 2008 - 05:33 AM
Post subject:
phatty,

What kind of issue? What kind of file are you trying to debug? (class or JSP)?
phatty - Oct 20, 2008 - 06:08 PM
Post subject:
support-rkalla wrote:
phatty,

What kind of issue? What kind of file are you trying to debug? (class or JSP)?


Sorry for my lack of info. Java class files debug just fine in OC4J.

Its the JSPs that we cannot get to debug. Currently we are using JBOSS to debug JSPs and the OC4J to verify builds are working before we push the ear file out to our test server and then production server (both of which are oracle application servers. Ideally we want to get away from JBOSS and just use OC4J, but if we cannot get the JSP debugging working we have to continue using two local servers, not cool...
support-rkalla - Oct 21, 2008 - 04:13 PM
Post subject:
If you create a simple scriplet in your JSPs, like <%= System.out.println("Bob") %> and set a breakpoint on it, does execution stop there or just keep going?

Also are you sure you have the OC4J connector set to launch the server in "Debug" mode?

And lastly, if you are using the Server view, are you launching the server with the "Run" button, or the "Debug" button?
dtb - Dec 05, 2008 - 09:40 AM
Post subject:
Hi,
Has anyone at all succeded in debugging JSP with MyEclipse on a remote Oracle AS?
I've been working on it quite a few days.
Debugging Java programs/servlets is simple and works at once.
The Oracle documentation is a bit misleading, since it's about remote debugging with the help of JDeveloper.
And I found an error, too. (In the opmn.xml file the 'debug' init-param value cannot be true, the possible valus are: none/class/file.)
Though I see the compiled JSPs with 'some' debug infos in them, I can't stop at the breakpoints.
Should I need to copy some JDeveloper jar files into my project?
MyEclipse 5.0 GA Pro, Oracle AS 10.1.3.1 with two OC4J instances with ASControl (opmn)
Balazs Toth (dtb)
support-rkalla - Dec 09, 2008 - 06:02 PM
Post subject:
dtb,

Unfortunately the success of debugging (since MyEclipse's impl is based on the spec) really depends almost entirely on the app server and what source map they hand back (if any). If execution isn't stopping, then OC4J isn't breaking on those pages... if execution is stopping but ME isn't jumping to the right code, then the source map coming back is either incomplete or there isn't one.

I know that doesn't help fix the problem, but just wanted to communicate how it looked from our end.
rchaudhri - May 14, 2009 - 07:20 AM
Post subject: Debug JSP in OC4J 10.1.3
Hi,

I have been following all the previous threads but i am still confused about whether MyEclipse provide JSP debugging on OC4J 10.1.3 (standalone server).

In the "JSP Properties" under "Administration" section from the EM console, i set the "Runtime Parameters" as "Debug Mode" and re-started the server. I deployed my J2ee application and started the server in debug mode, but still i am not able to stop at the JSP break point

Usman,
Thanks
support-joy - May 15, 2009 - 01:09 PM
Post subject: RE: Debug JSP in OC4J 10.1.3
Usman,

I have filed a PR for the dev team to investigate this issue.
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits