Hej alle har et kæmpe stort problem.
Kan ikke få en Java Application til at blive kørt nogen idere.
Opsætning.
I IIS har jeg sat Application Mapping op til at være som føljer
Extension Executable Path Verbs
..class C:\j2sdk1.4.0\bin\java.exe %s (all)
når jeg så prøver føljende for jeg en fejl
http://localhost/Java/SampleJava.class
fejl meddelelse
/*******************
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
java.lang.NoClassDefFoundError: C:\Inetpub\wwwroot\java\SampleJava/class
Exception in thread "main"
/*******************
filen SampleJava.java ser sådan her ud
/**************
import java.util.Hashtable;import java.io.DataInputStream;import
java.util.StringTokenizer;
class sampleJava {
String userMethod = null; String queryString = null; String[] EnvVar =
{"GATEWAY_INTERFACE", "SERVER_NAME", "SERVER_SOFTWARE",
"SERVER_PROTOCOL", "SERVER_PORT", "PATH_INFO",
"PATH_TRANSLATED", "SCRIPT_NAME", "DOCUMENT_ROOT",
"REMOTE_HOST", "REMOTE_ADDR", "AUTH_TYPE", "REMOTE_USER",
"REMOTE_IDENT", "HTTP_FROM", "HTTP_ACCEPT",
"HTTP_USER_AGENT", "HTTP_REFERER", "REQUEST_METHOD",
"CONTENT_TYPE", "CONTENT_LENGTH", "QUERY_STRING"};
// Constructor public sampleJava() { userMethod =
System.getProperty(new String("REQUEST_METHOD")); queryString =
System.getProperty(new String("QUERY_STRING")); }
// Display environment variables private void display() {
System.out.println("Content-type: text/html\n");
System.out.println("<html>"); System.out.println("<head>");
System.out.println("<title>Environment and User Variables</title>");
System.out.println("</head>"); System.out.println("<body>");
System.out.println("<h1>Environment and User variables</h1>");
System.out.println("<h2>Environment Variables</h2>");
System.out.println("<table>");
for (int i = 0; i < 22; i++) { if (System.getProperty(EnvVar[i])
!= null) { System.out.println("<tr>");
System.out.println("<tr>"); System.out.println("<td align=right>" +
EnvVar[i] + " : "); System.out.println("<td>" +
System.getProperty(EnvVar[i])); } else {
System.out.println("<tr>"); System.out.println("<td align=right>" +
EnvVar[i] + " : "); System.out.println("<td>NONE"); } }
System.out.println("</table>"); System.out.println("</body>");
System.out.println("</html>"); System.out.flush(); }
// Display error message private void errmsg(String message) {
System.out.println("Content-type: text/html\n");
System.out.println("<html>"); System.out.println("<head>");
System.out.println("<title>Error</title>");
System.out.println("</head>"); System.out.println("<body>");
System.out.println("<h1>Error</h1>"); System.out.println("<hr>");
System.out.println("<p>"); System.out.println("An internal error
occurred."); System.out.println("The specific error message is shown
below:"); System.out.println("<p><pre>" + message + "</pre><p>");
System.out.println("<p>"); System.out.println("<hr>");
System.out.println("</body>"); System.out.println("</html>");
System.out.flush(); }
public final static void main(String [] args) { sampleJava myCGI =
new sampleJava();
if (myCGI.userMethod == null) { myCGI.errmsg("No REQUEST_METHOD
specified"); throw new InternalError("No REQUEST_METHOD
ified"); } else { if (myCGI.userMethod.equals("GET") &&
myCGI.queryString.equals("YourInput=")) { myCGI.errmsg("No user
data"); throw new InternalError("No user data"); } else
{ myCGI.display(); } } }}
/**************
Men tror ikke det er filen har også lavet et anden java application men med
samme fejl.
Hvad gør jeg galt
PS håber i kan hjælpe mig
MvH
Michael