File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Tomcat CGI to lunch Java Jar Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat CGI to lunch Java Jar Server" Watch "Tomcat CGI to lunch Java Jar Server" New topic

Tomcat CGI to lunch Java Jar Server

Rui Miranda

Joined: Jul 11, 2011
Posts: 2
Hey community,

I'm having a problem making a cgi to run my alredy packed and "ready-for-sale" Java Server, in jar compact fully functional when i run the jar in the windows environment.
Now im trying to make a cgi, on Tomcat6.0 WebServer via Eclipse, using a Dynamic Web Project with the strutcure(briefed):

>index.jsp (Where i have the links to the cgi's/bat's)

I have alredy sucessfuly seted Tomcat to run CGI, the prof of that is that i can execute helloworld.bat with no problems. The ServerRemoteStart.bat is as follow:

And it works fine if i copy paste it to the cmd, but when i click the link in the index to the ServerRemoteStart.bat i get the following error:

********* = HostName
The 3 last lines are my handling of the IOException(there's nothing alredy running on that port, runned Netstat -a -n -o to checked)

PS: i would like to change the server java code as least as possible, pref no change.

Does this problem as somthing to do with the tomcat environment ports? It's my first time using this kind of Server so realy have no other clue or sulution ideia here

Thanks in advance,
Rui Miranda

Rui Miranda

Joined: Jul 11, 2011
Posts: 2
Debug update, commented the part of the Java Server that was trowing the UnkownHostException(it was only used to print the host IP to the server console) and know i get the following exeception when trying to instanceate the ServerSocket:

Searched the ENTIRE WEB, no one as ever gotten the 126 error, my stated of mind is a mix of blessed but most of all extremly frusted, any clues ot there?
I agree. Here's the link:
subject: Tomcat CGI to lunch Java Jar Server
jQuery in Action, 3rd edition