cancel
Showing results for 
Search instead for 
Did you mean: 

SAPJCo problem --> Could not initialize dynamic link library sapjcorfc

Former Member
0 Kudos

Hi there,

I have a J2EE application running on Websphere Application Server ND V6.1 (on MS Windows Server, Enterprise Edition with

SP2). J2EE application need to communicate to SAP on P560 z/OS via SAP Java Connector (SAP JCo). As per instructions given by

SAP JCo, I have created a folder and extracted SAPJCo zip to that, and also copied librfc32.dll & sapjcorfc.dll to

C:\Windows\system32 folder and created the shared libraries at the Application server level on Websphere to point to the

sapjco.jar file.

Now when I start my J2EE Application on Webpshere, I get hte error which is under the dashed line. The main complaint is.....

<b>java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer

'com.sap.mw.jco.rfc.MiddlewareRFC'

JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [D:\Software\SAPJCo\sapjcorfc.dll (JVMPORT015E Unable

to resolve DLL references - a prerequisite DLL may be missing)].</b>

Please let me know if any one has experienced similar problems. As we have a milestone to present this in a very short time,

I appreciate if any one could help me out as soon as possible.

==========================================================================================================================

Cannot resolve reference to bean 'sapConnector' while setting bean property 'sapConnector'; nested exception is

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sapConnector' defined in class path

resource [sapInterfaceContext.xml]: Instantiation of bean failed; nested exception is

org.springframework.beans.BeanInstantiationException: Could not instantiate bean class

[au.com.allianz.fsi.journal.sap.SapConnector]: Constructor threw exception; nested exception is

java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer

'com.sap.mw.jco.rfc.MiddlewareRFC'

JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [D:\Software\SAPJCo\sapjcorfc.dll (JVMPORT015E Unable

to resolve DLL references - a prerequisite DLL may be missing)]. java.library.path

[D:\WebSphere61\AppServer\java\jre\bin;.;D:\WebSphere61\AppServer\bin;D:\WebSphere61\AppServer\java\bin;D:\WebSphere61\AppSer

ver\java\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Software\SAPJCo;D:\WebSphere61\AppServer\lib\WMQ\

java\lib]

at

org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

at

org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.jav

a:109)

at

org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:381)

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:120)

at

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanF

actory.java:781)

at

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFa

ctory.java:699)

at

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.ja

va:386)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:255)

at

org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:252)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

at

org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java

:287)

at

org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.jav

a:689)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:358)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)

at com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:635)

at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:279)

at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:283)

at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:88)

at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)

at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:655)

at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:608)

at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)

at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)

at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1312)

at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1129)

at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)

at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:814)

at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:965)

at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2131)

at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:341)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)

Regards

Satish

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

The following error is id due to the following cause :



Exception: Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC' default_cpc_mode at com.sap.mw.jco.JCO.<clinit>(JCO.java:309) 

Exception: Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC' JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [C:devcu rrjcosapjcorfc.dll]. Required version "2.1.5 (2005-02-15)". at com.sap.mw.jco.JCO.<clinit>(JCO.java:735) 

Exception: Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC' JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc. Found version "2.0.11 (2005-01-21)" but required version "2.1.5 (2005-02-15)". at com.sap.mw.jco.JCO.<clinit>(JCO.java:735) 

Cause: These exceptions typically occur when different versions of sapjcorfc.dll and sapjco.jar have been installed. Anytime the JCo connector is upgraded to a new version, you need to ensure that all three libraries are updated (librfc32.dll, sapjcorfc.dll, and sapjco.jar). If any are left at the older version, one of the above exceptions is likely to occur. 

Resolution: Extract sapjcorfc.dll and sapjco.jar from the original JCo archive. Copy these files to the appropriate locations, overwriting the originally installed versions. Ensure that the PATH statement is updated to reflect the directory location of the DLL files and the Java CLASSPATH points to sapjco.jar.

U can use the following link to solve any problem associating JCO :

http://searchsap.techtarget.com/general/0,295582,sid21_gci1096472,00.html

Please reward with points if the answer is helpful.

Thanks

ritu

Former Member
0 Kudos

i guess there is no issue with the JCo dlls but you are missing some DLL on which these two i.e. librfc32 & sapjcorfc dlls depend upon..

one option i can suggest you is to make use of Dependency walker on Windows. right click on the DLL librfc & sapjcorfc and select open with dependency walker or select executable depends.exe...it shows the prerequisites...