I need help to test ORACLE and SQL SERVER 2005

120 views
Skip to first unread message

Vinu

unread,
Nov 22, 2010, 6:23:55 AM11/22/10
to diffkit-user
Hi there,
I am just starting with Diffkit tests. First test with this command -

java -jar diffkit-app.jar -test

works fine. The command

java -jar diffkit-app.jar -test flavors=ORACLE

fails. I replaced ORACLE with MYSQL as well. It doesnt work.

FYR, ORACLE failed with following lines. Please help me proceed with
tests ASAP

running TestCases
ERROR[07:14:29.470]{main}(DKApplication.main:130)-null
java.lang.IllegalArgumentException: No enum const class
org.diffkit.db.DKDBFlavo
r.oracle
at java.lang.Enum.valueOf(Unknown Source) [na:1.6.0_17]
at
org.diffkit.util.DKStringUtil.parseEnumList(DKStringUtil.java:76) [di
ffkit-app.jar:na]
at
org.diffkit.diff.conf.DKApplication.parseTestCaseArgs(DKApplication.j
ava:232) [diffkit-app.jar:na]
at
org.diffkit.diff.conf.DKApplication.runTestCases(DKApplication.java:2
03) [diffkit-app.jar:na]
at org.diffkit.diff.conf.DKApplication.main(DKApplication.java:
108) [dif
fkit-app.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[na:1.6.0
_17]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[na:1.6.0
_17]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source) [na:1
.6.0_17]
at java.lang.reflect.Method.invoke(Unknown Source) [na:
1.6.0_17]
at
com.jdotsoft.jarloader.JarClassLoader.invokeMain(JarClassLoader.java:
520) [diffkit-app.jar:na]
at org.diffkit.diff.conf.DKLauncher.main(DKLauncher.java:26)
[diffkit-ap
p.jar:na]

joe

unread,
Nov 22, 2010, 7:50:13 AM11/22/10
to diffkit-user
Hi Vinu,

Can you please post:

1) Which version of DiffKit you are using? To be absolutely certain,
please present the output of this command:

java -jar diffkit-app.jar -version


2) Which version of Java you are using:

java -version

thanks,

Joe

joe

unread,
Nov 22, 2010, 8:16:32 AM11/22/10
to diffkit-user
Could you also post which operating system you are running on?

thanks.

Joe

On Nov 22, 6:23 am, Vinu <vinume...@gmail.com> wrote:

Vinu

unread,
Nov 22, 2010, 8:25:22 AM11/22/10
to diffkit-user
Hi Joe,
Thank you for your response

Diffkit version - 0.8.0 and
JRE 1.6.0

are present on my machine

Thanks & Regards,
Vinu
> > p.jar:na]- Hide quoted text -
>
> - Show quoted text -

joe

unread,
Nov 22, 2010, 8:33:18 AM11/22/10
to diffkit-user
Vinu,

The stack trace indicates that your shell converted "flavors=ORACLE"
to "flavors=oracle". In other words, it looks like you are using some
type of shell, or command launcher, that automatically folds
(converts) the entire command text to lower case.

I thought this might have something to do with windows, but I tried on
windows XP, using the standard "Command Prompt" and it worked as
expected. I was only able to reproduce the stack trace you show if I
type the command this way:

java -jar diffkit-app.jar -test flavors=oracle


What shell, or command launcher, are you using?

cheers,

Joe

Vinu

unread,
Nov 22, 2010, 8:56:43 AM11/22/10
to diffkit-user
Hi Joe,
I am using windows' cmd.exe
I just realised that the command has to be in caps!

I was able to execute but got a different error

java -jar diffkit-app.jar -test flavors=ORACLE
DiffKit home->C:\Documents and Settings\My Documents\App folder
\diffkit-0
.8.0
running TestCases
can't connect to database for connectionInfo-
>DKDBConnectionInfo[oracle(flavor=O
RACLE,database=XE,host=10.0.1.11,port=1521)], skipping.
couldn't validate flavor->ORACLE, skipping.

Thanks and Regards,
Vinu
> > > - Show quoted text -- Hide quoted text -

joe

unread,
Nov 22, 2010, 9:12:25 AM11/22/10
to diffkit-user
Vinu,

You have to edit the dbConnectionInfo files, so that the test knows
how to connect to your Oracle db. All of the files are in the conf/
directory. Edit these 3 files:

dbConnectionInfo.oracle.xml
test18.lhs.dbConnectionInfo.oracle.xml
test18.rhs.dbConnectionInfo.oracle.xml

This blog post shows the meaning of the entries in those files:

http://blog.diffkit.org/2010/11/configuring-database-connectivity.html

cheers,

Joe

Vinu

unread,
Nov 23, 2010, 3:18:29 AM11/23/10
to diffkit-user
Thanks a lot Joe :) I am getting the hang of it now

Kind Regards,
Vinu

Vinu

unread,
Nov 24, 2010, 8:17:00 AM11/24/10
to diffkit-user
Hi there,
I am trying to test SQL server.. I went through FAQ in the user guide
and it clearly says type 4 JDBC driver should be used, but no clue on
how to use it

Does any one have any idea about this?

I have sqljdbc_3.0.1301.101_enu.exe with me. Please help with the
steps as in how to establish connection to SQL server using xml files
(dbconnectionInfo.xml or lhs.xml or rhs.xml)

Thanks & Regards,
Vinu

joe

unread,
Nov 24, 2010, 8:27:48 AM11/24/10
to diffkit-user
Vinu,

The SQL Server type 4 JDBC driver is already bundled in the DiffKit
standalone application. You don't need to add anything. All you have
to do is create a dbConnectionInfo.xml file that points at your SQL
Server instance. The format for the SQL Server connection info is
exactly the same as for any of the other databases (such as Oracle).

just put the same connection information in all 3 of these files:

dbConnectionInfo.sqlserver.xml
test18.lhs.dbConnectionInfo.sqlserver.xml
test18.rhs.dbConnectionInfo.sqlserver.xml

Let me know if that solves your problem.

cheers,

Joe

Vinu

unread,
Nov 25, 2010, 12:03:59 AM11/25/10
to diffkit-user
Joe,
1. I modified those 3 xml files (using diffkit 0.8.3 version) with the
database connection information to execute the following command
java -jar diffkit-app.jar -test flavors=SQLSERVER
it says
"can't connect to database for connectioninfo->DKDBConnectionInfo[Sql
Server<flavor=SQLSERVER,database=.....>], skipping. couldn't validate
flavor->SQLSERVER, skipping."

2. I try modifying plan file, lhs and rhs files with the database
connection information to execute

java -jar ..\diffkit-app.jar -planfiles test18.plan.xml,
test18.lhs.dbConnectionInfo.sqlserver.xml,
test18.rhs.dbConnectionInfo.sqlserver.xml

I get the following error message

DiffKit home->C:\Documents and Settings\My Documents\App folder
\DiffKit 0
.8.3\DiffKit
planfile(s)->test18.plan.xml
ERROR[05:55:27.248]{main}(DKApplication.main:130)-null
java.lang.RuntimeException: java.lang.RuntimeException: Could not
resolve automa
tically; need rule for dependency-
>Dependency[(DKPassthroughPlan,null)]
at
org.diffkit.diff.conf.DKMagicPlan.getBuiltPlan(DKMagicPlan.java:290)
[diffkit-app.jar:na]
at
org.diffkit.diff.conf.DKMagicPlan.getLhsSource(DKMagicPlan.java:267)
[diffkit-app.jar:na]
at
org.diffkit.diff.conf.DKApplication.runPlan(DKApplication.java:162) [
diffkit-app.jar:na]
at org.diffkit.diff.conf.DKApplication.main(DKApplication.java:
110) [dif
fkit-app.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[na:1.6.0
_17]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[na:1.6.0
_17]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source) [na:1
.6.0_17]
at java.lang.reflect.Method.invoke(Unknown Source) [na:
1.6.0_17]
at
com.jdotsoft.jarloader.JarClassLoader.invokeMain(JarClassLoader.java:
520) [diffkit-app.jar:na]
at org.diffkit.diff.conf.DKLauncher.main(DKLauncher.java:26)
[diffkit-ap
p.jar:na]
Caused by: java.lang.RuntimeException: Could not resolve
automatically; need rul
e for dependency->Dependency[(DKPassthroughPlan,null)]
at
org.diffkit.diff.conf.DKMagicPlanBuilder.resolve(DKMagicPlanBuilder.j
ava:110) [diffkit-app.jar:na]
at
org.diffkit.diff.conf.DKMagicPlanBuilder.build(DKMagicPlanBuilder.jav
a:56) [diffkit-app.jar:na]
at
org.diffkit.diff.conf.DKMagicPlan.getBuiltPlan(DKMagicPlan.java:287)
[diffkit-app.jar:na]
... 9 common frames omitted
Caused by: java.lang.RuntimeException: Could not resolve
automatically; need rul
e for dependency-
>Dependency[DKPassthroughPlan(DKDBSource,lhsSource_)]
at
org.diffkit.diff.conf.DKMagicPlanBuilder.resolve(DKMagicPlanBuilder.j
ava:102) [diffkit-app.jar:na]
... 11 common frames omitted
Caused by: java.lang.RuntimeException: Could not resolve
automatically; need rul
e for dependency-
>Dependency[DKPassthroughPlan(DKDBSource,lhsSource_)]
at
org.diffkit.diff.conf.DKMagicPlanBuilder.resolve(DKMagicPlanBuilder.j
ava:110) [diffkit-app.jar:na]
at
org.diffkit.diff.conf.DKMagicPlanBuilder.resolve(DKMagicPlanBuilder.j
ava:82) [diffkit-app.jar:na]
at
org.diffkit.diff.conf.DKMagicPlanBuilder.resolve(DKMagicPlanBuilder.j
ava:99) [diffkit-app.jar:na]
... 11 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[na:1.6.0_17]
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[na:1.6.0_17]
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce) [na:1.6.0_17]
at java.lang.reflect.Constructor.newInstance(Unknown Source)
[na:1.6.0_1
7]
at
org.diffkit.diff.conf.DKMagicDependency.resolve(DKMagicDependency.jav
a:165) [diffkit-app.jar:na]
at
org.diffkit.diff.conf.DKMagicPlanBuilder.resolve(DKMagicPlanBuilder.j
ava:107) [diffkit-app.jar:na]
... 13 common frames omitted
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP
connectio
n to the host <..hostname..>, port 1433 has failed. Error: "connect
ti
med out. Verify the connection properties, check that an instance of
SQL Server
is running on the host and accepting TCP/IP connections at the port,
and that no
firewall is blocking TCP connections to the port.".
at
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(S
QLServerException.java:171) [diffkit-app.jar:na]
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLSer
verConnection.java:1033) [diffkit-app.jar:na]
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConne
ction.java:817) [diffkit-app.jar:na]
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerCon
nection.java:700) [diffkit-app.jar:na]
at
com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.
java:842) [diffkit-app.jar:na]
at java.sql.DriverManager.getConnection(Unknown Source) [na:
1.6.0_17]
at java.sql.DriverManager.getConnection(Unknown Source) [na:
1.6.0_17]
at org.diffkit.db.DKDatabase.getConnection(DKDatabase.java:75)
[diffkit-
app.jar:na]
at
org.diffkit.db.DKDBTableDataAccess.getConnection(DKDBTableDataAccess.
java:244) [diffkit-app.jar:na]
at
org.diffkit.db.DKDBTableDataAccess.getTables(DKDBTableDataAccess.java
:101) [diffkit-app.jar:na]
at
org.diffkit.db.DKDBTableDataAccess.getTable(DKDBTableDataAccess.java:
88) [diffkit-app.jar:na]
at
org.diffkit.db.DKDBTableDataAccess.getTable(DKDBTableDataAccess.java:
76) [diffkit-app.jar:na]
at org.diffkit.diff.sns.DKDBSource.getTable(DKDBSource.java:
239) [diffki
t-app.jar:na]
at org.diffkit.diff.sns.DKDBSource.<init>(DKDBSource.java:98)
[diffkit-a
pp.jar:na]
... 19 common frames omitted


I verified the connection string by opening connection from code. It
works absolutely fine. Here it fails though..Kindly help in resolving
this. Also let me know if I need to try out some other command to
understand where it fails. I get similar errors for ORACLE as well
(for both commands)

Thanks & Regards,
Vinu

joe

unread,
Nov 25, 2010, 2:10:19 AM11/25/10
to diffkit-user
Vinu,

Looks like DK is having trouble connecting to your DB. Most likely
causes are:

*Some of the parameters in the dbConnectionInfo.sqlserver.xml are
wrong.
*Your SQL Server DB has not been reconfigured to accept incoming TCP/
IP connections?

We can use the DiffKit tracing mechanism to gather more information:

1) In the conf/ directory is a file named logback.xml. It controls
logging for DiffKit (using the logback logging framework, which is the
successor to log4j). Edit that file and add an entry, so that when
you are done it looks like this:

...
<logger name="org.diffkit.db">
<level value="debug" />
</logger>
<logger name="org.diffkit">
<level value="warn" />
</logger>
...

2) Run the test command on just a single TestCase, so that there is
less logging spam:

java -jar diffkit-app.jar -test cases=1 flavors=SQLSERVER

One of the first logging lines printed looks like this:

DEBUG[01:36:55.270]{main}(DKDatabase.getConnection:71)-jdbcUrl-
>jdbc:sqlserver://10.0.1.11:1433;databaseName=test

Do the hostname (10.0.1.11), port (1433), and database (test) all look
correct when you do it on your system? Are you sure the username/
password are correct? Are usernames/passwords case sensitive in SQL
Server? If all the connection info looks correct, then most likely
cause is that TCP/IP connections are not enabled.

>I verified the connection string by opening connection from code.

Which code? Java/JDBC code, or .NET code? I believe that .NET uses a
different (more native) networking protocol to communicate with the
database. Out of the box, SQL Server does not enable incoming tcp
network connections. You have to explicitly configure SQL Server to
accept those. This SO thread describes the issue:

http://stackoverflow.com/questions/1086764/how-can-i-make-ms-sql-server-available-for-connections

From a cmd.exe window, if you type "telnet <hostname> <port>", where
<port> is the port you think your SQL Server is running, what do you
get?

Oracle should probably be easier, because most server-side
installations of Oracle are configured for TCP/IP connections. If
Oracle is not working for you, then most likely one of the pieces of
information in the dbConnectionInfo.oracle.xml file is wrong. You
should try setting the "debug" flag in the conf/logback.xml file and
carefully examining the jdbc URL.

Let me know if how that works out.

cheers,

Joe

On Nov 25, 12:03 am, Vinu <vinume...@gmail.com> wrote:
> Joe,
> 1. I modified those 3 xml files (using diffkit 0.8.3 version) with the
> database connection information to execute the following command
>                java -jar diffkit-app.jar -test flavors=SQLSERVER
> it says
> "can't connect to database for connectioninfo->DKDBConnectionInfo[Sql
> Server<flavor=SQLSERVER,database=.....>], skipping. couldn't validate
> flavor->SQLSERVER, skipping."
>
[snip]

joe panico

unread,
Nov 25, 2010, 2:12:26 AM11/25/10
to diffki...@googlegroups.com
I dug this out the the StackOverflow thread:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

Vinu

unread,
Nov 26, 2010, 1:49:29 AM11/26/10
to diffkit-user
Joe,
I tried all the possibilities as mentioned by you, but it is not
working still. In the mean time I got the source code downloaded and
found that format of URL that is hardcoded in DKDBconnectionInfo.java
file needs small change

line 97 (getOracleURL method) to be changed for the format of URL
specific to my requirement. This is the way our server is configured.
Server cannot be reconfigured, because hundreds of application are
configured this way

Change is this --> 'ldap:' needs to be added like shown below

"jdbc:oracle:thin:@ldap://......",

Is it posible for you/someone to make this change, package the jar and
share with me? So that I can test ORACLE and if this works we can make
appropriate changes for SQL server as well. Awaiting your response.
Thanks a lot for your support

Best Regards,
Vinu
> ...
>
> read more »- Hide quoted text -

joe

unread,
Nov 26, 2010, 7:44:48 PM11/26/10
to diffkit-user
Vinu,

I'd be happy to make the change in the DiffKit repository, but can you
first verify that it will actually solve your problem ;)

Since you have the source code, can you simply make the change
yourself, recompile and test that it actually works?

thanks,

Joe
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages