cancel
Showing results for 
Search instead for 
Did you mean: 

JCO3.0.1 is not supported with multiple class loader

Former Member
0 Kudos
168

Hi experts,

appreciate if any one could suggest few work around here.

With new version of JCO3.0.1 , now Java stand alone applications needs

to register their DesitnationDataProvider and ServerDataProvider with

JCO Environment class.

We have done exactly that. We have created our own

DestinationDataProvide class which stores destinations and its

properties in a HashMap. We also register the Provider with the

Environment class.

Our application deploys in an application Server. It can be deployed

multiple times.

So whenever we deployed and started our application, we try to register

the provider with the JCO Environment class as shown below

Here is static part of DestinationDataProvider class which register its

Singleton instance with the Environment class.

static

{

destinationDataProvider_ = new

JCo3DestinationDataProvider();

Environment.registerDestinationDataProvider

(destinationDataProvider_);

}

This static block execute when our application is deployed and started.

But as i said user can also deploy our application multiple times. So,

when user try to deploy the application for second time, the class

loader which loads all our classes, also loads the

DestinationDataProvider class once again. This eventually makes the

class to call register method on to Environment once again. This time

JCO Environment class throws exception that a destination provider is

already registered.

Note - JCO3 jar is only loaded once.

So, with multiple class loader there is no way i cannot restrict my

application to register only once with JCO Environment class.

And also i dont see JCO providing any option/API to get me the already

registered DestinationDataProvider.

I have downloaded latest JCO3.0.2 API and seen following new APIs

isDestinationDataProviderRegistered()

isServerDataProviderRegistered()

These APIs tells me whether a DataProvider is already registered or

not.But, if you go through my problem again - my second application needs

access to already registered data provider if it is there. I cannot

unregister existing DataProvider and register a new one. If i register

new DestinationDataProvider in second application it will break first

application as it is not having all its destinations which it has

registered before.

thanks,

Swamy

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Swamy,

I face the very exact problem. Any solutions yet?

Thanks,

Daniel

thomas_wenzel
Discoverer
0 Kudos

Hi Daniel,

try to install the following Microsoft patch found [here|http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=766a6af7-ec73-40ff-b072-9112bab119c2] from knowledge base article [KB973544|http://support.microsoft.com/?kbid=973544].

This has solved my problem.

Kind regards

Thomas

Edited by: Thomas Wenzel on Jan 25, 2010 2:44 PM

0 Kudos

thanx a lot, Thomas, it also solved the problem for me!

Monika.

Former Member
0 Kudos

hello Swamy

did it solve the problem?

i also encounter simular problem. i want to know the reason if it solved.

in my case, single app on weblogic works perfectly, but 2nd app doesn't work.

also single app cannot redeploy cause of it.

i guess this problem appears on windows server 2003 only...

environment:

windows server 2003

weblogic 10

sapjco 3.0.2

jdk 1.5

log:

ERROR xxx.xxx.service.exception.ExceptionHandler: [L1243995754608]Error getting the version of the native layer: java.lang.UnsatisfiedLinkError: com/sap/conn/rfc/driver/CpicDriver.nativeCpicGetVersion

java.lang.ExceptionInInitializerError: Error getting the version of the native layer: java.lang.UnsatisfiedLinkError: com/sap/conn/rfc/driver/CpicDriver.nativeCpicGetVersion

at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:207)

at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)

at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)

at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

at java.lang.Class.newInstance0(Class.java:350)

at java.lang.Class.newInstance(Class.java:303)

at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)

at com.sap.conn.jco.ext.Environment.registerSessionReferenceProvider(Environment.java:236)

...

Former Member
0 Kudos

Hi,

i had the same problem. The SAPJCO3.dll depends on dll's from the [Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)|http://www.microsoft.com/downloads/thankyou.aspx?familyId=200b2fd9-ae1a-4a14-984d-389c36f85647&displayLang=en].

If this path

C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700

does not exist or is empty, you have to download this package from Microsoft and install it.

This is the assembly from the SAPJCO3.dll:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

<dependency>

<dependentAssembly>

<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

</dependentAssembly>

</dependency>

</assembly

I hope this helps.

Andi