cancel
Showing results for 
Search instead for 
Did you mean: 

Running the file2socket sample program

Former Member
0 Kudos

In the ESP Examples Guide, there is a very short section regarding the file2socket and socket2file Java programs. Here is the ant command for running file2socket

$ANT_HOME/bin/ant -f build.xml send -Dport=SERVERSOCKET_PORT -Dfile=UPLOAD_FILE -Dbuffer=BUFFER_SIZE -Dtimeout=TIMEOUT -Dnumber=COUNT_NUMBER -Dverbose=VERBOSE

I'm running this on Windows Server 2016. I have tried running it in every combination of directories and working directories I can think of, but it always fails with some variant of this error message:

C:\ant\apache-ant-1.10.0\bin>ant -f c:\esp\build.xml send -Dport=3001 -Dfile=C:\ESP\data\tx1.xml -Dbuffer=10000 -Dtimeout=5 -Dnumber=1
Buildfile: c:\esp\build.xml
send:
     [java] c:\esp\ant_build\lib does not exist.
     [java]     at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:495)
     [java]     at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:70)

And sure enough the build.xml file references a directory named "ant_build", which doesn't exist anywhere.

Can someone please help me get this command to work?

Thanks in advance,

Dan Tarnower

Accepted Solutions (1)

Accepted Solutions (1)

JWootton
Advisor
Advisor
0 Kudos

Dan - I generally find that when people are looking for troubleshooting assistance, unless it's a common pitfall that many have run into, you're unlikely to get a response in the community forum. You're better off contacting SAP Customer Support and to formally engage the experts and get their assistance.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I hope I can get some help with this problem. I can't get the sample program to work at all.

I have gotten past the original issue by creating the directories that ant was looking for. I had copied the Java code and build.xml files to another folder, and executed the "compile" and "jar" build commands. Now when I run "send" I get:

C:\ESP>ant -f c:\esp\build.xml send -Dport=3001 -Dfile=C:\ESP\data\tx1.xml -Dbuffer=10000 -Dtimeout=5 -Dnumber=1
Unable to locate tools.jar. Expected to find it in C:\sybase\ESP-5_1\lib\lib\tools.jar
Buildfile: c:\esp\build.xml


send:
     [java] Could not find File2Socket. Make sure you have it in your classpath
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:140)
     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:834)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:228)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:137)
     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:110)
     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
     [java]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.lang.reflect.Method.invoke(Method.java:483)
     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
     [java]     at org.apache.tools.ant.Target.execute(Target.java:435)
     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:456)
     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
     [java]     at org.apache.tools.ant.Main.runBuild(Main.java:857)
     [java]     at org.apache.tools.ant.Main.startAnt(Main.java:236)
     [java]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
     [java]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)
     [java] Java Result: -1


BUILD SUCCESSFUL
Total time: 0 seconds

I have tried running the jar file by itself, I've tried running the class file by itself. At the suggestion of a google search,I tried adding this to the "jar" code in the build.xml file:

 <manifest>
    <attribute name="Main-Class" value="com.sybase.esp.adapter.framework.exampleutils.File2Socket"/>
  </manifest>

Depending on what I try, the errors change a bit but it never actually runs. The google searches don't really ever address this particular problem, so they are of limited help.

Can somebody please help? The ESP adapter isn't connecting to the client's server application and everybody is getting restless.