generating spy.log for different ears running in different ports in oc4j server

Posted on 2005-04-23
Medium Priority
Last Modified: 2013-11-24
i have created 2 nodes in oc4j server so that two ears running on different ports running simultaneously in node1 and node2 respectively;

i am using p6spy driver to output the database queries spy.log;

i want to create spy.log for both  ears;

p6spy.jar and spy.properties are there in this path C:\OC4J_EXTENDED\j2ee\home\lib  ;

node1 ear is in this path --C:\OC4J_EXTENDED\j2ee\home\node1\applications\example.ear
node2 ear is in this path --C:\OC4J_EXTENDED\j2ee\home\node1\applications\example2.ear

when i run the node1 batch file spy.log is not created??how to generate spy.log for node1 ear as well as node2

# name of real jdbc driver to load
#realdriver  = sun.jdbc.odbc.JdbcOdbcDriver
#realdriver  = COM.ibm.db2.jdbc.net.DB2Driver
realdriver  = oracle.jdbc.driver.OracleDriver

# turn on filtering
filter     = false
# comma separated list of tables to include
include    =
# comma separated list of tables to exclude
exclude    =

# turn on tracing
trace      = true
autoflush  = true

# name of logfile if trace is on, use "stdout" for standard output.
logfile    = C:/OC4J_EXTENDED/j2ee/home/node1/log/spy.log

# turn on caching
cache      = true
cachetrace = true

# this is the command you need to send to clear the cache.
clear      = delete from cache

# These files control the names and tracing of the query forms (similar
# to prepared statements) that are used to determine what to cache.
formsfile  = spy.forms
formslog   = forms.log
formstrace = true


Question by:chaitu chaitu
  • 5
  • 4
LVL 15

Accepted Solution

aozarov earned 1050 total points
ID: 13851021
You can try putting both: p6spy.jar and spy.properties under
...\home\node1\lib and ...\home\node2\lib  (this is how you can have different spy.properties for each application).
Then in your run script include both the ....\home\node1\lib and ...\home\node1\lib\p6spy.jar in the classpath (replace
... with the full path up to home and node1 with node2 when it comes to node2 run script)
LVL 15

Expert Comment

ID: 13851024
And the above should be instead of having them under C:\OC4J_EXTENDED\j2ee\home\lib  
LVL 20

Author Comment

by:chaitu chaitu
ID: 13856336
i created lib directory under node1 C:\OC4J_EXTENDED\j2ee\home\node1\lib  and placed p6spy.jar and spy.properties;

i removed p6spy.jar and spy.properties under  C:\OC4J_EXTENDED\j2ee\home\lib  directory

i changed the batch file for node1 server
set path=c:\j2sdk1.4.2_06\bin;
set classpath=C:\OC4J_EXTENDED\j2ee\home\node1\lib;C:\OC4J_EXTENDED\j2ee\home\node1\lib\p6spy.jar;%classpath%
java -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Xdebug -Xnoagent -Djava.compiler=NONE -Xmx512m -Dhttp.session.debug=true -Djdbc.connection.debug=true -Dp6.home=C:\OC4J_EXTENDED\j2ee\home\lib -Dp6trace=true -jar oc4j.jar -config node1\config\server.xml -userThreads -verbosity 10 -out node1\log\std_out.log -err node1\log\std_err.log
i am getting  below exception in std_err log;as u can see in my batch file i put p6spy.jar in lib path but still not able to recognize??

05/04/25 10:50:54 Error initializing data-source 'oraclePool': DriverManagerDataSource driver 'com.p6.engine.spy.P6SpyDriver' not found
Technology Partners: 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 15

Expert Comment

ID: 13856362
Hmm strange, try to put back p6spy.jar to C:\OC4J_EXTENDED\j2ee\home\lib  (and add it back to the classpath)
C:\OC4J_EXTENDED\j2ee\home\lib\p6spy.jar but leave the proerties file in C:\OC4J_EXTENDED\j2ee\home\node1\lib
and keep C:\OC4J_EXTENDED\j2ee\home\node1\lib in the classpath
LVL 20

Author Comment

by:chaitu chaitu
ID: 13856425
in data-sources.xml when i changed the class from com.evermind.sql.DriverManagerDataSource to oracle.jdbc.pool.OracleDataSource i didnt get any exception in std_err log and alsoe it didnt create any spy.log;

when i put class="com.evermind.sql.DriverManagerDataSource " in datasources.xml i am getting this exception

05/04/25 10:50:54 Error initializing data-source 'oraclePool': DriverManagerDataSource driver 'com.p6.engine.spy.P6SpyDriver' not found

in which jar  com.evermind.sql.DriverManagerDataSource  located??


this batch file is okay??in home/lib/p6spy.jar is there ;and in node1\lib spy.properties is located.

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

Expert Comment

ID: 13856488
Not sure, but you can use grep or
JWhich http://www.javaworld.com/javatips/jw-javatip105_p.html
or if using eclipse http://www.alphaworks.ibm.com/tech/jarclassfinder
to find the jar that contains it.
LVL 20

Author Comment

by:chaitu chaitu
ID: 13864777
i finally got spy.logs in both the ears;

i have changed both the batch file like this

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

put the p6spy.jar in C:\OC4J_EXTENDED\j2ee\home\node2\jsp\lib\taglib directory;
LVL 15

Expert Comment

ID: 13867409
Nice :-)
I assume you have your properties file under C:\OC4J_EXTENDED\j2ee\home\node1\lib and C:\OC4J_EXTENDED\j2ee\home\node2\lib
Not sure why p6spy.jar should be under C:\OC4J_EXTENDED\j2ee\home\node2\jsp\lib\taglib (and I assume C:\OC4J_EXTENDED\j2ee\home\node1\jsp\lib\taglib ),
and can't be picked when provided in the classpath as we tried above...
LVL 20

Author Comment

by:chaitu chaitu
ID: 13873644
anyway thank u for ur help;for ur efforts u have shown i will award points to u

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month16 days, 2 hours left to enroll

850 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