invoking jawin code from Tomcat
Bob Farnik <[email protected]> Tue, 14 Mar 2006 07:46:53 -0500
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
I wonder what might be the difference if invoking COM via jawin from Java
application and doing the same thing from JSP within Tomcat 5.5 context.
Java application works, JSP does not.
Java application code creates an instance of JavaNativeBridge calling
oJNB = new JavaNativeBridge();
JavaNativeBridge class constructor creates the instance of the COM object
IBSCFunctions (its stub generated from TLB with jcomgen):
import com.develop.jawin.COMException;
public class JavaNativeBridge implements HttpSessionBindingListener
{
private IBSCFunctions moBSCFns;
public JavaNativeBridge() throws COMException
{
System.out.println("Creating IBSCFunctions with " + CBSCFunctions.clsID);
moBSCFns = new IBSCFunctions(CBSCFunctions.clsID);
System.out.println("IBSCFunctions created as " + moBSCFns.toString());
}
The code above works, I can access all COM methods.
But when I move the classes and jawin stuff to the Tomcat WEB-INF structures
and try to invoke almost the same code from JSP:
<%@page import="BSCBeans.JavaNativeBridge"%>
<%@page import="com.develop.jawin.COMException"%>
<%
String str = "BFX no object";
JavaNativeBridge oJNB;
try
{
str = "********** Attempting to create JavaNativeBridge ";
System.out.println(str);
oJNB = new BSCBeans.JavaNativeBridge();
str = oJNB.toString();
System.out.println(str);
}
catch(COMException e){
System.out.println("COM Interface failure");
e.printStackTrace();
System.out.println(e.toString());
}
catch(Exception e){
System.out.println("JAVA code failure");
e.printStackTrace();
System.out.println(e.toString());
}
%>
it freezes inside the JavaNativeBridge constructor, when trying to create an
instance of my COM IBSCFunctions using its GUID.
No exception, no error message, no relevant records in Tomcat logs.
Anybody has got an idea what might be wrong here?