remote debugging in jdeveloper

hi

i will deploy ear file in oc4j container;in ear file EJB.jar and web.war will be there.i will run the container;source files r in jdeveloper path(C:\JDeveloper903\jdev\mywork\2804Release3.0);how can i intergrate oc4j container and jdeveloper;how will enable my debug option  in jdeveloper when the ear file in oc4j container;can i do like that or any other way?

i think remote debugging comes into the picture in this case?


can anybody tell me the steps to be followed?
LVL 20
chaitu chaituAsked:
Who is Participating?
 
petmagdyConnect With a Mentor Commented:
Step 1 and 2 that u r doing are conflicting u need to merge them change ur test.bat to be:

Step1:
set path=c:\j2sdk1.4.2_06\bin;
java Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp
:transport=dt_socket,address=7777,server=y,suspend=n -Xmx512m -Djdbc.connection.debug=true -Dp6.home=C:\OC4J_EXTENDED\j2ee\home\lib -Dp6trace=true  -jar oc4j.jar  -userThreads -verbosity 10 -out log\std_out.log -err log\std_err.log

Step 2
put ur break points

Step 3
and then in Jdeveloper do the stuff to configure remote as i told u until run index.jsp with"Start remote Debbuger" and specify host and port to be 7777

Good luck

0
 
petmagdyCommented:
I already answered this before, please refer to this question:

http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21181410.html

u simple start oc4j in debug mode and follow the link I provided:

http://www.oracle.com/technology/products/jdev/howtos/remotedebugservlet.html
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
chaitu chaituAuthor Commented:
in the command prompt


i started oc4j in remote debugging
java -classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777 -jar oc4j.jar

i am getting thismessage

Warning: classic VM not supported; client VM will be used
04/10/28 14:39:11 Warning: Can't find spy.properties, java.class.path = <oc4j.ja
r>
04/10/28 14:39:17 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
initialized


in another command promt  i typed this command but i am getting exception

C:\JDeveloper903\jdk\bin>java -ojvm -XXdebugondemandport4000 -jar orion.jar


*** Port is 4000 ***
*** Connect debugger anytime for on demand debugging. ***

Exception in thread main
java.lang.IllegalStateException: zip file closed
        java.util.zip.ZipEntry java.util.zip.ZipFile.getEntry(java.lang.String)
                ZipFile.java:141
        java.util.zip.ZipEntry java.util.jar.JarFile.getEntry(java.lang.String)
                JarFile.java:181
        java.util.jar.JarEntry java.util.jar.JarFile.getJarEntry(java.lang.Strin
g)
                JarFile.java:168
        java.util.jar.Manifest java.util.jar.JarFile.getManifest()
                JarFile.java:127

 
0
 
petmagdyCommented:
sorry chaituu, try this:

java --Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=7777,server=y,suspend=n -jar oc4j.jar

I removed -classic
0
 
petmagdyCommented:
And configure your Jdeveloper as following:

on the project properties tree select (profiles --> Development --> Debbuger --> Remote)

Check Remote Debbuging and choose (Attach to JPDA)

close the project properties and select ur project node and right menu tou will find (Start Remote Debbugging),

Specify ut Host the OC4J Host name and port will be 7777

Good luck
0
 
chaitu chaituAuthor Commented:
hi petmagdy

its java -Xdebug not --XDebug;

C:\OC4J_EXTENDED\j2ee\home>java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp
:transport=dt_socket,address=7777,server=y,suspend=n -jar oc4j.jar
04/10/28 15:08:48 Warning: Can't find spy.properties, java.class.path = <oc4j.ja
r>
04/10/28 15:08:54 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
initialized

i have changed properties in Jdeveloper ;but i didnt Start Remote Debbugging in the menu;

tell me how the jdeveloper remote debugger connects to oc4j container;

where should i specify the host name port


"Specify ut Host the OC4J Host name and port will be 7777"
0
 
petmagdyCommented:
Ok First of all if u r using Oc4j 10 g (9.0.4.0.0) please upgrade to Jdeveloper 10g 9.0.5.2, u can download it from otn.oracle.com and just unzip it

maybe thats why u r not getting in the right menu of the project node "Start Remote Debbugging" because u r still using Jdeveloper 9.0.3 (I know that 9.0.3 have remote debbuging too, but the way to set it is different)

Please note this menu item will only apprear after u have set the project properties remote debbuging parameters
0
 
chaitu chaituAuthor Commented:
sorry petmagdy

it didnt come in menu but when i debug index.jsp

one window pop up its asking hostname and port number

in place of hostname i have given locahost and portnumber =7777 given;



Debugger attempting to connect to remote process at localhost 7777.
Debugger connected to remote process at localhost 7777.
Looking for classes which have been unloaded. Under certain conditions, this may take a while.
Finished looking for classes which have been unloaded.
Debuggee process virtual machine is Java HotSpot(TM) Client VM.
Debuggee process is application server OC4J.
To test JSPs or servlets, you must start a browser.

in the browser

http://localhost:7777/etrans/index.jsp

 i get page not found.....

which portnumber should i give;

C:\OC4J_EXTENDED\j2ee\home\config\http-web-site.xml
here port number is 8888;

i have another doubt the classes r in ear file deployed in oc4j container and source files in Jdeveloper should be same ;




0
 
petmagdyCommented:
nooo u r confusing between the Web Listner Port number which is not changed it is the same as in:

C:\OC4J_EXTENDED\j2ee\home\config\http-web-site.xml
and u call ur JSP as the same existing way (not affected by remote debbuging):

http://localhost:8888/etrans/index.jsp

and the remote debbuging port which is 7777, this port is used internally by Jdeveloper to be able to do remote debbuging

the sequence go like this:

1- configure the remote debbugging as I told u, and then in th project right pupup menu run "start remote debbuging"
2- put break points

2- call ur JSP normally from outside the Jdeveloper at (http://localhost:8888/etrans/index.jsp)

you will find the Jeveloper will stop the execution at the first break point to be able to debbug


0
 
petmagdyCommented:

>> i have another doubt the classes r in ear file deployed in oc4j container and source files in Jdeveloper should be same ;


yes u should deploy the last ear from ur workspace to standand alone OC4J
0
 
chaitu chaituAuthor Commented:
sorry for troubling u ;

i am doing thse steps

1.in one command prompt  oc4j remote debugger is running using this commdand;

C:\OC4J_EXTENDED\j2ee\home>java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp
:transport=dt_socket,address=7777,server=y,suspend=n -jar oc4j.jar
04/10/28 16:15:03 Warning: Can't find spy.properties, java.class.path = <oc4j.ja
r>
04/10/28 16:15:08 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
initialized

2.to run the application  i have to run oc4jcontainer;

when i run this batch file
C:\OC4J_EXTENDED\j2ee\home\test.bat

this is batch file
set path=c:\j2sdk1.4.2_06\bin;
java -Xmx512m -Djdbc.connection.debug=true -Dp6.home=C:\OC4J_EXTENDED\j2ee\home\lib -Dp6trace=true  -jar oc4j.jar  -userThreads -verbosity 10 -out log\std_out.log -err log\std_err.log

when i run oc4j  is exception is coming;

04/10/28 16:13:12 Error starting ORMI-Server.  Unable to bind socket: Address already in use: JVM_Bind
04/10/28 16:13:29 *** (CRITICAL) Thu Oct 28 16:13:29 GMT+05:30 2004 [Thread[Orion Launcher,5,main]]  java.lang.InstantiationException: initializeSocket: java.net.BindException: Address already in use: JVM_Bind
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
      at java.net.ServerSocket.bind(ServerSocket.java:318)
      at java.net.ServerSocket.<init>(ServerSocket.java:185)
      at com.evermind.server.Server.createServerSocket(Server.java:165)
      at com.evermind.server.jms.JMSServer.initializeSocket(JMSServer.java:1142)
      at com.evermind.server.jms.JMSServer.setConfig(JMSServer.java:179)
      at com.evermind.server.ApplicationServer.initializeJMS(ApplicationServer.java:2294)
      at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1408)
      at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
      at java.lang.Thread.run(Thread.java:534)

04/10/28 16:13:29 Error starting JMS-Server: initializeSocket: java.net.BindException: Address already in use: JVM_Bind
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
      at java.net.ServerSocket.bind(ServerSocket.java:318)
      at java.net.ServerSocket.<init>(ServerSocket.java:185)
      at com.evermind.server.Server.createServerSocket(Server.java:165)
      at com.evermind.server.jms.JMSServer.initializeSocket(JMSServer.java:1142)
      at com.evermind.server.jms.JMSServer.setConfig(JMSServer.java:179)
      at com.evermind.server.ApplicationServer.initializeJMS(ApplicationServer.java:2294)
      at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1408)
      at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
      at java.lang.Thread.run(Thread.java:534)

04/10/28 16:13:29 Error starting ORMI-Server.  Unable to bind socket: Address already in use: JVM_Bind



0
 
chaitu chaituAuthor Commented:
i misesd one step i debug index.jsp in jdeveloper so Debugger connected to remote process at localhost 7777.
0
 
chaitu chaituAuthor Commented:
i put breakpoints in controller but jdeveloper debugger  didnt stop it goes on executing what may be the reason;

0
 
petmagdyCommented:
did oc4j started without exceptions?
0
 
chaitu chaituAuthor Commented:
yes;

if servlet class file in container and java source file in jdeveloper are different ;will this problem occurs;;
0
 
petmagdyCommented:
yes will cause problem
0
 
chaitu chaituAuthor Commented:
i checked source file and class file r the same;;;;;;;;;still not recognizing breakpoint;
0
 
petmagdyCommented:
Hay,

I tested it on my machine the break points inside ur JSP dosn't work, but it work inside Java Classes

Please try this
0
 
chaitu chaituAuthor Commented:
my jdeveloper is 9.0.3 and container 9.0.4;

in the batch file i am giving c:\j2sdk1.4.2_06\bin;


will thise arise the problem;

my jdeveloper is 9.0.3 and container 9.0.2;

if i set breakpoints in controller it is working but when the container is 9.0.4 it is not recognizaing breakpoints;

recently i installed jdk1.4, oc4j container is 9.0.2;

then the gives the problem

when we upgraded to oc4j 9.0.4 then the application working;






0
 
chaitu chaituAuthor Commented:
what do u mean by  inside Java Classes????????????/

ur talking about servlet  java file
0
 
chaitu chaituAuthor Commented:
jdeveloper is 9.0.3 internally takes jdk1.3.1;
0
 
petmagdyCommented:
Yes inside the Servlets and classes i mean.

 I prefer to use Jdeveloper 9.0.5.2
0
 
chaitu chaituAuthor Commented:
Is oc4j-9.0.2  not compatable to jdk1.4.2???? should i upgrade it to oc4j-9.0.4???

0
 
chaitu chaituAuthor Commented:
i put breakpoint at servlet java file ;but it didnt executed.....................
0
 
petmagdyCommented:
Oc4J 9.0.2 is preferable to be on JDK1.3.1

can u please write down the steps u did?

do u run the application from browser? because u should run it from the browser?
0
 
chaitu chaituAuthor Commented:
container is oc4j- 9.0.4 and j2sdk1.4.2_06

1.i am running the container with this batch file;

set path=c:\j2sdk1.4.2_06\bin;
java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=7777,server=y,suspend=n -Xmx512m -Djdbc.connection.debug=true -Dp6.home=C:\OC4J_EXTENDED\j2ee\home\lib -Dp6trace=true  -jar oc4j.jar  -userThreads -verbosity 10 -out log\std_out.log -err log\std_err.log

2.in the Jdeveloper projects setting i changed libraries to j2sdk1.4.2_06 previously it was jdk1.3.1;

my latest EJB AND WEB(jsp's and servlets ) files r in Relese3.0 workspace in Jdeveloper;

for both WEB and EJB, in the project settings  checked to remote deubugging;

 i set break point in ETAHouseDocumentController(this is servlet file) in the WEB folder ;
in menu right click debug index.jsp i have given localhost and portnumber this message comes;

Debugger attempting to connect to remote process at localhost 7777.
Debugger connected to remote process at localhost 7777.
Looking for classes which have been unloaded. Under certain conditions, this may take a while.
Finished looking for classes which have been unloaded.
Debuggee process virtual machine is Java HotSpot(TM) Client VM.
Debuggee process is application server OC4J.
To test JSPs or servlets, you must start a browser.

in the browser i typed

http://localhost:8888/etrans/index.jsp;

application running fine;

when i am creating house in the application it will call ETAHouseDocumentController where i setted break point;

it is executing but not stopped at breakpoint;;


0
 
petmagdyCommented:
Sorry my last answer upgrade to Jdeveloper 9.0.5.2
0
 
chaitu chaituAuthor Commented:
hahahaha anyway thank u for ur help;;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.