Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sap and java interface problem

Former Member
0 Likes
387

hi,

iam writing a program for iteracting sap and java system.

i write a pgm in java to interact sap , in notepad, when i am trying to execute the program it is showing this error.

C:\>javac firstEx.java

error: cannot read: firstEx.java

1 error

This is my program. pls any one help me.

import com.sap.mw.jco.*;

public class firstEx {

static myFirstServer serverConnections[] = new myFirstServer[3];

public static void startServers() {

JCO.addClientPool("POOL", 3, "800", "sridevi" ,"rvst2009" , "EN",

"5.137.151.198" ,"00");

IRepository repository = JCO.createRepository("REP", "POOL");

for(int i = 0; i < serverConnections.length; i++) {

serverConnections<i> = new myFirstServer

("5.137.151.198", //gateway host, often the same as host

"sapgw00", //gateway service, generally sapgw+<SYSNR>

"JCOSERVER01", // corresponds to program ID defined in SM59

repository);

serverConnections<i>.start();

};

}

public static void stopServers() {

for(int i = 0; i < serverConnections.length; i++)

{

serverConnections<i>.stop();

};

}

public static void main(String[] args) {

startServers() ;

}

}

2 REPLIES 2
Read only

anuj_srivastava
Active Participant
0 Likes
364

Hi Sri ,

The error suggest that the code is not able to read the java Exe.

Can you check whether you have full access to read a Exe file from your code.

The authorization can be a error.

Kindly check the authorization for the same.

Regards ,

Anuj

Read only

0 Likes
364

you will get better replies in the java related forums under application server.