Solved

remote debugging in jdeveloper

Posted on 2004-10-28
3,693 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
Question by:chaitu chaitu
    29 Comments
     
    LVL 35

    Expert Comment

    by:TimYates
    0
     
    LVL 13

    Expert Comment

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

    Expert Comment

    by:petmagdy
    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
    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
    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
    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
    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
    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

    >> 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
    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
    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:
    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
    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
    did oc4j started without exceptions?
    0
     
    LVL 20

    Author Comment

    by:chaitu chaitu
    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
    yes will cause problem
    0
     
    LVL 20

    Author Comment

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

    Expert Comment

    by:petmagdy
    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
    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
    what do u mean by  inside Java Classes????????????/

    ur talking about servlet  java file
    0
     
    LVL 20

    Author Comment

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

    Expert Comment

    by:petmagdy
    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
    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
    i put breakpoint at servlet java file ;but it didnt executed.....................
    0
     
    LVL 13

    Expert Comment

    by:petmagdy
    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
    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
    Sorry my last answer upgrade to Jdeveloper 9.0.5.2
    0
     
    LVL 20

    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    java JDK Download 7 34
    Fix45 challenge 15 50
    Logs to delete in Windows VCenter server ? 11 44
    triangle challenge 4 17
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    875 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now