Invoking Ibatis jar file from webmethods java service

Hello,

I have a requirement to invoke a jar file that implements spring + ibatis framework in Java .While invoking this jar file ,I am getting the below error .

java.lang.reflect.InvocationTargetException:com/ibatis/sqlmap/client/SqlMapExecutor

This error seems the bean initialization falure .

I have included all jars files in the classpath .

Please let me know if anyone had come cross this type of issue .

Thanks,
KrishnaPriya A

Hi Krishna,

please provide the following details:

  • wM Version with FixLevel
  • where exactly was the jar placed
  • was the package reloaded or the IS restarted after placing the jar
  • the complete StackTrace for the InvocationTargetException
  • screenshot of the java service

Regards,
Holger

Hi Holger,
Thanks for your response.Please find answers below.

wM Version:9.9.0.0
Fix:IS_9.9_SPM_Fix1
IS_9.9_Core_Fix1

Jars are placed in the below directory.
/opt/mount1/wm/webMethods/IntegrationServer/instances/default/packages/Default/code/jars

Package was reloaded after the jars places in the directory.

It does not log any more stack trace of the error other than below .
java.lang.reflect.InvocationTargetException:com/ibatis/sqlmap/client/SqlMapExecutor

I have attached the screen shot of my java service .I am invoking an external jar and the jar uses spring + ibatis framework.

Thanks,
KrishnaPriya A

Hi Krishna,

in which package is your service located?
Default?

If this Jar should be visible instancewide it is better to place it under /opt/mount1/wm/webMethods/IntegrationServer/instances/default/lib/jars/custom.

If this Jar should be visible only to certain packages than it should be placed in the first package under code/jars and all other packages need a Package Dependency to this package.

Is there any thing related to this in the /opt/mount1/wm/webMethods/IntegrationServer/instances/default/logs/server.log?

Regards,
Holger

Hi Holger,

Yes the package where the service located is Default. This jar is specific to the package and so I have placed at the package level.

There was no detailed error logged in the server log or error log .

Thanks,
KrishnaPriya A

Hi Krishna,

I did some research on the net.

As Ibatis was retired in 2010, please consider if you can switch to its successor MyBatis instead.

BTW:
Which version of Ibatis are you using?

Regards,
Holger

Hi Holger,

I a using ibatis-2.3.0.677.jar.

Do you have any idea if we have to do any other configurations like applicationcontext.xml for the spring framework .

Thanks,
KrishnaPriya A

Hi Krishna,

can you elaborate on the ibatis-jar if there is such class in it?
The jar can be openend with zip-compatible program.

A longer StackTrace might definitely help to determine where the mentioned class SqlMapExecutor is referenced.

I have checked ibatis-3-core-3.0.0.220.jar and there is no class with this name.
They all start with "org\apache\ibatis".

Regards,
Holger

Hi Holger,

I am using the old ibatis file .It has package com.ibatis .The package org\apache\ibatis\ is for myibatis.

The detail stack trace is not logged .

Do you have any idea if we have to do any other configurations like applicationcontext.xml for the spring framework .

Thanks,
Krishnapriya A

Did you tried to place the jar in
/opt/mount1/wm/webMethods/IntegrationServer/instances/default/lib/jars ?

and restart the server and try agin

Hi Venkata,

more likely the path should be /opt/mount1/wm/webMethods/IntegrationServer/instances/default/lib/jars/custom in this case.

Regards,
Holger

Hi Krishna,

if you are not forced to use the version 2.3.0.677, can you try out ibatis-2.3.4.726 which is the latest version available form Apache Archives for the Ibatis 2-stream?

Please increase the Log-Level for the IS to Debug and see if you get a StackTrace then.

Having the StackTrace available might ease in narrowing down, why and where the InvocationTargetExcpetion is thrown.

Regards,
Holger

Addendum:

Eventually you might be hittting a bug here.

From Release.txt for 2.3.4.726 (Listed for Version 2.3.1):
o Fixed IBATIS-406 Bug in Ibatis sqlMap when one resultMap has multiple results that are resultMaps… then the groupby attribute only seems to work for the first embedded resultMap.
o Fixed IBATIS-435 Bug Using iBATIS 2.3.0 And Spring Framework

Regards,
Holger

Hi Krishna Priya,

Did the suggestions worked or U still facing same issue?

Thanks,
Venkata