cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.RuntimeException - .jcoDestination does not exist.

Former Member
0 Kudos

I am developing a Java Servlet that uses SAP JCo 3. It uses properties files (.jcoserver and .jcodestination) for SAP connection information. These properties files are being deployed inside a Web project on WebSphere 6.1. When I run teh servlet, it can't find the .jcodestination file and I receive the following Java exception.

Caused by: java.lang.RuntimeException: File C:\work\tools\IBM\WebSphere\AppServer\profiles\AppSrv01\.\SAP_CONNECTION.jcoDestination does not exist.

at com.sap.conn.jco.rt.FileDestinationsDataProvider.loadProperties(FileDestinationsDataProvider.java:91)

at com.sap.conn.jco.rt.FileDestinationsDataProvider.getDestinationProperties(FileDestinationsDataProvider.java:77)

at com.sap.conn.jco.rt.DefaultDestinationManager.getProperties(DefaultDestinationManager.java:296)

at com.sap.conn.jco.rt.DefaultDestinationManager.update(DefaultDestinationManager.java:169)

at com.sap.conn.jco.rt.DefaultDestinationManager.searchDestination(DefaultDestinationManager.java:347)

at com.sap.conn.jco.rt.DefaultDestinationManager.getDestinationInstance(DefaultDestinationManager.java:98)

at com.sap.conn.jco.JCoDestinationManager.getDestination(JCoDestinationManager.java:61)

at com.sap.conn.jco.rt.DefaultServer.update(DefaultServer.java:131)

at com.sap.conn.jco.rt.DefaultServer.<init>(DefaultServer.java:107)

at com.sap.conn.idoc.jco.rt.DefaultJCoIDocServer.<init>(DefaultJCoIDocServer.java:41)

at com.sap.conn.idoc.jco.rt.DefaultJCoIDocServerFactory.createServer(DefaultJCoIDocServerFactory.java:17)

at com.sap.conn.idoc.jco.rt.DefaultJCoIDocServerFactory.createServer(DefaultJCoIDocServerFactory.java:13)

at com.sap.conn.jco.rt.DefaultServerManager.getServer(DefaultServerManager.java:108)

at com.sap.conn.jco.rt.StandaloneServerFactory.getServerInstance(StandaloneServerFactory.java:169)

at com.sap.conn.idoc.jco.JCoIDoc.getServer(JCoIDoc.java:96)

Edited by: Luc Ouellet on Feb 18, 2010 4:36 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Luc,

Instead of using the default DestinationDataProvider that is shipped with the JCo I usually code one most of the times myself, because it gives you greater control and flexibility (you can determine yourself what the source of the JCo connection properties is and what format you want to use). If that's not what you want or you've done this before, ignore my posting...

Here's what you'd need to do:

<ol>

<li>Implement a class for interface com.sap.conn.jco.ext.DestinationDataProvider. For a very simple implementation you just need to implement method getDestinationProperties(String) and use the following dummy coding for the other two methods:


	public boolean supportsEvents() {
		return false;
	}

	public void setDestinationDataEventListener(
			DestinationDataEventListener eventListener) {
		throw new UnsupportedOperationException("not implemented");
	}

</li>

<li>To utilize your new DestinationDataProvider you'll have to register an instance of the class via the method com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(DestinationDataProvider). Make sure though to register it only once or unregister it if you want to supply a different version.</li>

</ol>

Cheers, harald

Former Member
0 Kudos

Hi,

in a first view i would say the Pathname should contain a additional backslash:

\.\SAP_CONNECTION\.jcoDestination

Regards

Johannes

Former Member
0 Kudos

Sorry, I should have used the full name for properties files. SERVER.jcoserver and SAP_CONNECTION.jcodestination. The extra slash did not fix the problem.

Former Member
0 Kudos

Hi,

anyway this seem to be a problem with the file-path.

Does your propertiesfile exit at that location ?

If you include somthing like this

File f = new File();

what is the output of this

f.getAbsolutePath()

I suggest you provide the complete path then accessing the file.

Johannes