File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Problem with java-rmi.cgi
Joined: Nov 14, 2013
Nov 14, 2013 01:59:32
I know this might not be the correct thread but i give it a try.
My problem is that i can't get my RMI http-to-cgi connection to get going.
My client is running behind a restricted firewall with only HTTP 80 open.
My server is not behind any firewall.
Everytime i'm trying to connect to my webserver it says this:
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is: java.io.IOException: HTTP request failed
In my apache error log it says:
[error] [client xx.xxx.x.xx] (104)Connection reset by peer: ap_content_length_filter: apr_bucket_read() failed
In my access log it says:
"POST http://xx.xxx.xxx.xxx/cgi-bin/java-rmi.cgi?forward=1099 HTTP/1.1" 500 415 "-" "Java/1.7.0"
I've set my socket factory like this:
And my java-rmi.cgi script looks like this:
# This class will support a QUERY_STRING of the form "forward=<port>" # with a REQUEST_METHOD "POST". The body of the request will be # forwarded (as another POST request) to the server listening on the # specified port (must be >= 1024). The response from this forwarded # request will be the response to the original request. # # CONFIGURATION: # # Fill in correct absolute path to Java interpreter below. For example, # the "PATH=" line might be changed to the follow if the JDK is installed # at the path "/home/peter/java": # # PATH=/home/peter/java/bin:$PATH # PATH=/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin:$PATH exec java \ -DAUTH_TYPE="$AUTH_TYPE" \ -DCONTENT_LENGTH="$CONTENT_LENGTH" \ -DCONTENT_TYPE="$CONTENT_TYPE" \ -DGATEWAY_INTERFACE="$GATEWAY_INTERFACE" \ -DHTTP_ACCEPT="$HTTP_ACCEPT" \ -DPATH_INFO="$PATH_INFO" \ -DPATH_TRANSLATED="$PATH_TRANSLATED" \ -DQUERY_STRING="$QUERY_STRING" \ -DREMOTE_ADDR="$REMOTE_ADDR" \ -DREMOTE_HOST="$REMOTE_HOST" \ -DREMOTE_IDENT="$REMOTE_IDENT" \ -DREMOTE_USER="$REMOTE_USER" \ -DREQUEST_METHOD="$REQUEST_METHOD" \ -DSCRIPT_NAME="$SCRIPT_NAME" \ -DSERVER_NAME="$SERVER_NAME" \ -DSERVER_PORT="$SERVER_PORT" \ -DSERVER_PROTOCOL="$SERVER_PROTOCOL" \ -DSERVER_SOFTWARE="$SERVER_SOFTWARE" \ sun.rmi.transport.proxy.CGIHandler
I can't figure out why i get HTTP 500 everytime...
Maybe my script?
My AUTH_TYPE and QUERY_STRING is always empty, but i do get remote host and port and server.
EDIT: I tried the script in my web browser and it works fine. Doing what it's supose to do. Anyone here that know anything about the java-rmi.cgi script?
Joined: Dec 08, 2010
Nov 14, 2013 05:18:35
Welcome to CodeRanch!
Its nice to see that you are using code tags in your first post itself!
As this question is more specific to RMI-CGI (and not '
in General'), I'm moving it to 'Distributed Java' forum.
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
I agree. Here's the link:
subject: Problem with java-rmi.cgi
J2EE Client Application - Part II
How far can you take HttpURLConnection
CGI client cannot contact web
no tomcat CGI redirect() ??
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014