Java komponenter og ASP
Jeg ønsker at benytte mig af java komponenter i asp (duh!) og har følgende problem:Efter at have rodet microsofts dokumentation igennem (både online, og deres SDK for Java [4.0]) er jeg kommet frem til at de ikke aner hvad de ævler om.
Jeg har brugt ca 4 timer på at følge deres guide punkt for punkt, og hver gang kommer "min" server (Win2K/IIS5)med følgende problem:
"Calling a method of a Java component from ASP:
Server object error 'ASP 0177 : 80040111'
Server.CreateObject Failed
/msjdk/samples/asp/IIS_sample/HelloWorld_test.asp, line 19
ClassFactory cannot supply requested class"
HelloWorld_test.asp ser ud som følger (leveret af MS):
<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Developer Studio">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Java Component Samples: HelloWorld</TITLE>
</HEAD>
<BODY>
Calling a method of a Java component from ASP:<P>
<%
Dim Obj
' Create the Java component
Set Obj = Server.CreateObject("IISSample.HelloWorld") ' [linje 19]
' Call the method and print the returned string
Response.Write Obj.sayHello
%>
</BODY>
</HTML>
Ud over MS SDK[4.0], er der installeret JDK 1.2 på serveren.
Ovenstående kode er fra de samples som følger med MS SDK. Der står bl.a. følgende til dem (har gjort det ... 4 gange efterhånden):
[Using the Samples
The following instructions apply to all ASP samples.
To run the samples
Important To run these samples, you must have a Web browser that supports ASP (such as Microsoft® Internet Explorer 4.0 or later).
Install the Internet Information Server and the com.ms.iis.asp package from the Microsoft SDK for Java. To install the com.ms.iis.asp package on Windows 2000 machines, run IntegrationClasses2000.exe, which is located in the %SDKDIR%\Bin directory. To install this package on versions of Windows prior to Windows 2000, run IntegrationClasses.exe, which is also located in the %SDKDIR%\Bin directory.
Compile the *.java files. Use iiscomp.cmd in the \IISSample directory to compile the ASP classes and aspcomp.cmd in the \aspcomp directory to compile the framework classes. \IISSample and \aspcomp are subdirectories of %Windir%\Java\Trustlib.
Note If you are working in Microsoft® Visual J++®, you must install the new Java compiler from the Microsoft SDK for Java. This means copying jvc.exe, jps.dll, and msjvc.dll from the SDK's installation into your DevStudio\SharedIDE\bin directory. You must also set the destination for the project (Project/Properties/Compile/Output Directory) to the %WINDIR%\java\trustlib directory.
Alternatively, you can use the pre-built *.class files provided in the %SDKDIR%\Samples\ASP\IISSample folder. To do this, copy *.class into the %WINDIR%\java\trustlib\IISSample directory. You must also copy the classes in %SDKDIR%\Samples\ASP\aspcomp to the %WINDIR%\java\trustlib\aspcomp directory.
Configure a virtual root on your host server.
Double-click your host machine in your IISManager, and then right click the default Web page.
Select New, and then choose Virtual Directory.
In the wizard, enter all required information.
When prompted for the path, specify the directory on your drive that contains the files from IISSample.
Check Read and Run Scripts to enable ASP.
Run regit.cmd, which registers your components with COM. This assumes that javareg is on your path. Javareg comes with both Visual J++ and the Microsoft SDK for Java.
Start the Web server.
Change to the directory that contains the *.asp file (ASP Samples) in your IISManager, right-click the directory, and then choose Browse. This will load the ASP page.]
Jeg har følgende ClassPath i systemet:
[%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\jdk\lib;C:\Program Files\jdk\src;C:\Program Files\Microsoft SDK for Java 4.0\Bin]
Er der nogen som kan lave/henvise til en guide der VIRKER??? Eller evt fortælle mig HVORFOR det ikke virker?
Håber jeg har været grundig nok i beskrivelsen ... er der yderligere spørgsmål, så spørg løs ...
Hektor