4 comments
Comment actions Permalink

In article <dre9sv$v7q$1@is.intellij.net>, Sharon669@hotmail.com says...

Is there any way i can make IntelliJ work with Oracle oc4j ?

Thank you

Sharon


Send me an email at dmccoy@momentumsystems.com, and I'll send you the
settings I've used with OC4j.
--
-


David H. McCoy


-


0
Comment actions Permalink

Can´t you post them here?
I use orion and Oc4j to develop my web app. Orion can be easily embedded, but I don´t find any way to embed OC4J, the only way I have is to remotely connect to debug.
Thanks.

0
Comment actions Permalink

There are two ways to integrate oc4j into IntelliJ Ideea:
1. using remote server, for debugging. This is the only way to use the debugger in Idea for OC4J. The integration of the debugger with locally managed OC4J container will not work due to the fact the debugger tries to connect to the server before oc4J's complete initialization and it failed to connect. To achieve this, you have to start the OC4J container using the debug parameters Idea provides to you. Below there is an example of a bat file that starts the container for the debug mode:

@echo off
echo #################################################################
echo # #
echo # Starting OC4J Container on localhost using port 8080 #
echo # #
echo #################################################################
cd %OC4J_HOME%
java -Xdebug -Xnoagent -Xms128m -Xmx128m -Djava.compiler=NONE -Djdbc.connection.debug=true -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar oc4j.jar -userThreads

In Idea, on the debug window, you have to define a remote connection for this OC4J container. Verify the communication port, to be the same with the one specified in the bat file (e.g.: 5005).
After the complete initialization of the container, the only thing you have to do, is to start the debugger from Idea and place breakpoints wherever you want to stop the execution. Please note the debugger works only in java classes (.java files), unfortunately you will not be able to stop the execution of the application in a jsp file, for example.

2. using locally configured OC4J container In this mode you'll not be able to start the debugger. The reason was presented above, debugger tries to connect to the server before it's complete initialization. If you want to run the application from a server started inside the IDE you have to configure first the OC4J in Idea. For this, there are some steps to be done:
- go to Run/Debug configurations and click on JSR45 Compatible Server tab. There Click on "+" to add a new configuration.
- on the server tab, click on configure then add a new configuration name by clicking the "+" sign. In this step, you have to add admin.jar, ejb.jar, servlet.jar, oc4j.jar and oc4jclient.jar to the configuration by clicking the "attach classes" button. Click "Apply" button.
- on the same Server tab, if you want to start the application when starting the server, click on "Start browser" check box and specify an URL for your application. If this is done, when starting the server, the application will be ran automatically in the browser. THE MOST IMPORTANT THING: Specify the JSP package in the text field near to "JSP's package" and also, on "VM options variable" type VM_OPTS. Also do not forget to mention the port the server listen to.
- on the Startup/Connection tab, click on Run and add on "Startup script" and on "Shutdown script" the paths for the scripts to start/stop the container. If, for example, you saved the scripts on the root of C:\ you'll specify there C:\oc4j_start.bat for Startup script and C:\oc4j_stop.bat for Shutdown script.

Example for startup script:
@echo off
echo #################################################################
echo # #
echo # Starting OC4J Container on localhost using port 8080 #
echo # #
echo #################################################################
cd %OC4J_HOME%
java -Xdebug -Xnoagent -Xms128m -Xmx128m -Djava.compiler=NONE -jar oc4j.jar -userThreads

Example for stopping script:
@echo off
echo #################################################################
echo # #
echo # Stopping OC4J Container on localhost using port 8988 #
echo # #
echo #################################################################
cd C:\oc4j\j2ee\home
java -jar admin.jar ormi://localhost admin manager -shutdown force

Press Apply and Ok. After that, try to run the server from within Idea. It will work.
Anyway, if you have additional questions, please contact me on my email (mihai.costache.95@gmail.com)

Mihai Costache
Senior Software Developer
Oracle Corporation

0
Comment actions Permalink

Here is what I did. I was able to run OC4j locally via Idea's debugger with no problems.

This is what I did for OC4J 9.0.3.

1) In the main class section, specify the oc4j.jar. You may have to put it in the project classpath.
2) Here are my VM parameters
-Xms128m -Xmx256m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8150 -jar

That -jar is very important.

3) program parameters
-verbosity 10 - for oc4j output

4) working directory, the location of oc4j
C:\Applications\Development\jdev9031\j2ee\home

BTW, are you deploying an exploded directory or war/ear? I can pass along the settings I used in my various xml config files under oc4j's home/config directory

Here are some notes I wrote some time ago I'm not sure if you need them or not, but I'll toss them in just in case...



2.2 Configuration
2.2.1 Oracle9iAS

1. Goto http://903win_rn/relnotes.903/relnotes/config.htm#1024775 for directions on how to setup with version 1.4 of java The Oracle9iAS ships with its own JDK, currently version 1.3.1_xx. This is located in the \jdk directory. Oracle9iAS needs to be configured to run with J2SE 1.4.1(or later). This is accomplished by 1. Rename existing jdk directory. For example, “jdk13”. 2. Copy the current J2SE install directory to \jdk. This will allow Oracle9iAS to start-up with support for J2SE 1.4.1_xx. 2.2.2 Standalone OC4J Note: This directions assume a prior installation of J2SE 1.4.1_xx. 2.2.2.1 Adding J2SE 1.4.1_xx Support The standalone OC4J ships with its own JDK, currently version 1.3.1_xx. This is located in the \jdk directory. OC4J needs to be configured to run with J2SE 1.4.1(or later). This is accomplished by 3. Rename existing jdk directory. For example, “jdk13”. 4. Copy the current J2SE install directory to \jdk. This will allow OC4J to start-up with support for J2SE 1.4.1_xx. 2.2.2.2 xxxxx The following files must be modified to support xxxxx 1. application.xml 2. http-web-site.xml 3. server.xml 4. default-web-site-xml 5. data-sources.xml 2.2.2.2.1 Application.xml Application.xml points OC4J to all libraries that are to be made available to the application. A entry must be inserted that points to all libraries that XXXXX will used. For this application, the library will be • Unix - /usr/applibs\java\lib • Windows - C:\applibs\java\lib 2.2.2.2.2 Http-web-site.xml Http-web-site.xml controls the http port for the application. It also names and locates the web porting of the application. A entry must be inserted that points to the application. This entry will be . The application attributes identifies the app name. The name attribute shows in which directory the web application will be found. The root attribute defines the root context of the web application. 2.2.2.2.3 Default-web-site.xml A entry must be inserted that points to the application. This entry will be . The application attributes identifies the app name. The name attribute shows in which directory the web application will be found. The root attribute defines the root context of the web application. 2.2.2.2.4 Server.xml Server.xml provides the location of the application. An entry must be added that tells the OC4J where to find myapp. The entry will be where name is the application name, path is the location, and auto-start allows OC4J to start the application automatically. The application will be located 1. Unix - /]]>/myapp
2. Windows – C:\myapp
The file path must have three forward slashes.
2.2.2.2.5 Data-sources.xml
This file controls the data sources used by OC4J and the application.



-


Original Message-----
From: Sharon
Sent: Sunday, January 29, 2006 3:03 PM
To: David McCoy
Subject: Re: Help settings OC4J in IDEA 5.0


Thank you David



I will appreciate it.


-


Original Message -



From: "David H. McCoy" <fake@mail.com>
Newsgroups: jetbrains.intellij.eap.j2ee
Sent: Sunday, January 29, 2006 3:37 AM
Subject: Re: Help settings OC4J in IDEA 5.0

In article <dre9sv$v7q$1@is.intellij.net>, Sharon669@hotmail.com
says...

>> Is there any way i can make IntelliJ work with Oracle oc4j ?
>>
>> Thank you
>>
>> Sharon
>>
>>
>>

Send me an email at dmccoy@momentumsystems.com, and I'll send you the
settings I've used with OC4j.
--
--------------------------------------
David H. McCoy


--------------------------------------

0

Please sign in to leave a comment.