[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

remote debugging in jdeveloper

Posted on 2004-10-28
29
Medium Priority
?
3,985 Views
Last Modified: 2012-06-21
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?
0
Comment
Question by:chaitu chaitu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 15
  • 13
29 Comments
 
LVL 13

Expert Comment

by:petmagdy
ID: 12431427
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
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12431652
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:petmagdy
ID: 12431672
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
 
LVL 13

Expert Comment

by:petmagdy
ID: 12431707
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
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12431750
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
 
LVL 13

Expert Comment

by:petmagdy
ID: 12431834
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
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12431917
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
 
LVL 13

Expert Comment

by:petmagdy
ID: 12432018
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
 
LVL 13

Expert Comment

by:petmagdy
ID: 12432027

>> 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
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12432206
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
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12432264
i misesd one step i debug index.jsp in jdeveloper so Debugger connected to remote process at localhost 7777.
0
 
LVL 13

Accepted Solution

by:
petmagdy earned 2000 total points
ID: 12432307
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
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12432353
i put breakpoints in controller but jdeveloper debugger  didnt stop it goes on executing what may be the reason;

0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12432385
did oc4j started without exceptions?
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12432427
yes;

if servlet class file in container and java source file in jdeveloper are different ;will this problem occurs;;
0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12432466
yes will cause problem
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12432489
i checked source file and class file r the same;;;;;;;;;still not recognizing breakpoint;
0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12432821
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
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12432941
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
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12432947
what do u mean by  inside Java Classes????????????/

ur talking about servlet  java file
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12432976
jdeveloper is 9.0.3 internally takes jdk1.3.1;
0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12433405
Yes inside the Servlets and classes i mean.

 I prefer to use Jdeveloper 9.0.5.2
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12433580
Is oc4j-9.0.2  not compatable to jdk1.4.2???? should i upgrade it to oc4j-9.0.4???

0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12433635
i put breakpoint at servlet java file ;but it didnt executed.....................
0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12433690
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
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12433881
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
 
LVL 13

Expert Comment

by:petmagdy
ID: 12434192
Sorry my last answer upgrade to Jdeveloper 9.0.5.2
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12434266
hahahaha anyway thank u for ur help;;
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question