on 02-17-2010 9:17 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
in a first view i would say the Pathname should contain a additional backslash:
\.\SAP_CONNECTION\.jcoDestination
Regards
Johannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.